Error when creating a geography column in migrations #93
Replies: 3 comments
-
This seems like a database issue, can you try to execute the SQL from your error manually? Otherwise, this seems like an issue with the schema where this is installed? |
Beta Was this translation helpful? Give feedback.
-
Hi, I just thought the same thing, I removed the public schema from the other schemas and it gave me the same error, I also removed the default configuration that Laravel brings in which it says which schema it connects to, it also didn't work, for the moment I found that with a function from Postgrest itself I managed to do it: public function up(): void I don't know if this can be added to your code if necessary, although I see it as a last resort. thanks. |
Beta Was this translation helpful? Give feedback.
-
Okay, seems like this is some issue with your database setup. I'm going to close this for now :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello, I am getting this error when I want to add a geography field even though my postgrest database already has postgis.
#Error
SQLSTATE[42704]: Undefined object: 7 ERROR: type "public.geometry" does not exist at character 55 (Connection: pgsql, SQL: alter table "profile_locations" add column "location" public.GEOMETRY(POINT,4326) not null)
#My migration
``<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('profile_locations', function (Blueprint $table) {
$table->magellanPoint('location', 4326);
});
}
}; ``
My database

Beta Was this translation helpful? Give feedback.
All reactions