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.
-
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
![image](https://private-user-images.githubusercontent.com/38223184/354468182-04f939ce-bb82-4d1c-b1eb-ba90b6506b4c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk0MjYwNzcsIm5iZiI6MTczOTQyNTc3NywicGF0aCI6Ii8zODIyMzE4NC8zNTQ0NjgxODItMDRmOTM5Y2UtYmI4Mi00ZDFjLWIxZWItYmE5MGI2NTA2YjRjLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNTAyMTMlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjUwMjEzVDA1NDkzN1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTNmMjNiN2RhNTVkYTlmMjFlMmEzOGQyYTNhMGJiYmQyZjM3ZTUwNzIxZjFjMDNkODA5OTljYzlmMGZhZDY4NWUmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0In0.ZlErnoaJlHQhr6_Mvx_NexW8qR3QCTybKTFgCwuVS58)
Beta Was this translation helpful? Give feedback.
All reactions