clickbar / laravel-magellan

A modern PostGIS toolbox for Laravel
MIT License
193 stars 11 forks source link

update-postgis-columns inserts code at top of the file #85

Open brausepulver opened 2 months ago

brausepulver commented 2 months ago

Running the command on a model with geometry columns in the database but no $postgisColumns inserts code at the top of the file outside of the class:

<?php

    protected array $postgisColumns = [
        'geog' => [
            'type' => 'geography',
            'srid' => 4326,
        ],
    ];

    use HasPostgisColumns;

This only happens when $postgisColumns is not present on the model. When $postgisColumns is present the column definitions are inserted correctly.

In other cases the command prompts to change code that is the exact same as the proposed code.

saibotk commented 2 months ago

Oh good catch sorry for the inconvenience, and thanks for filing the issue 👍