Skip to content

Conversation

@aanfarhan
Copy link
Contributor

It's possible to change spatial column type (PostgreSQL) between the default geography become geometry by adding column modifiers isGeometry().
In one of my project I was having trouble how to create database migration of spatial column type geometry, but fortunately solved my problem after reading this code Illuminate/Database/Schema/Grammars/PostgresGrammar.php#L943

Example of migrations code:

Schema::create('some_table', function (Blueprint $table) {
    //....
    $table->geometry('geometry_column')->nullable()->isGeometry(); // this generate spatial column type geometry
    $table->geometry('geography_column')->nullable(); // this generate spatial column type geography
    //....
});

By submitting this PR I hope that anyone can solve this same problem by reading the Laravel documentation. Thanks.

@taylorotwell taylorotwell merged commit 18c555a into laravel:8.x Nov 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants