lepikhinb / laravel-typescript

MIT License
387 stars 46 forks source link

SQLServer error when column type is "geography" #24

Closed Healyhatman closed 1 year ago

Healyhatman commented 1 year ago

An error is thrown in the doctrine package, in AbstractPlatform if your table has a column type of "geography". My current workaround is to temporarily edit that file and have it return "string" instead of throwing an exception.

The documentation also fails to mention how you can actually use the "paths" in the config. Here is an example, to show how Spatie Permissions and the Laravel Database Notifications can be included when generating

    'paths' => [
        'Illuminate\Notifications\\' => 'vendor\laravel\framework\src\Illuminate\Notifications',
        'Spatie\Permission\Models\\' => 'vendor\spatie\laravel-permission\src\Models'
    ],

Submitting this issue so I can find this again next time I need to generate models and need to remember how to fix it.

Healyhatman commented 1 year ago

https://github.com/mstaack/laravel-postgis/issues/144

Just needed to add the types to config/database.php

    'dbal' => [
        'types' => [
            'geometry' => \Doctrine\DBAL\Types\StringType::class,
            'geography' => \Doctrine\DBAL\Types\StringType::class,
        ]
    ],