From d8362d38165231f3db731e857cf8244f4df45766 Mon Sep 17 00:00:00 2001 From: Florian Date: Sat, 22 Aug 2026 11:18:22 +0200 Subject: [PATCH] Fixed migration as Postgres does not support after statements --- .../2025_01_31_075158_create_locations_table.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/database/migrations/2025_01_31_075158_create_locations_table.php b/database/migrations/2025_01_31_075158_create_locations_table.php index 98cd5eb..d9525ce 100644 --- a/database/migrations/2025_01_31_075158_create_locations_table.php +++ b/database/migrations/2025_01_31_075158_create_locations_table.php @@ -32,8 +32,13 @@ public function up(): void }); // Add spatial columns - DB::statement("ALTER TABLE $this->tableName ADD COLUMN center POINT NULL after is_capital"); - DB::statement("ALTER TABLE $this->tableName ADD COLUMN area MULTIPOLYGON NULL after center"); + if (DB::connection()->getDriverName() === 'pgsql') { + DB::statement("ALTER TABLE $this->tableName ADD COLUMN center TEXT NULL"); + DB::statement("ALTER TABLE $this->tableName ADD COLUMN area TEXT NULL"); + } else { + DB::statement("ALTER TABLE $this->tableName ADD COLUMN center POINT NULL after is_capital"); + DB::statement("ALTER TABLE $this->tableName ADD COLUMN area MULTIPOLYGON NULL after center"); + } } public function down(): void