`migrate dev` and PostGis Views
See original GitHub issueBug description
Hi there, i am having difficulties running prisma migrate dev on a postgres db with postgis installed.
Looking at past issues with PostGis (https://github.com/prisma/prisma/issues/4745), spatial_ref_sys looks like is properly ignored now. But i also have in my database “geometry_columns” and “geography_columns” views which prisma migrate cannot seem to do anything about.
Error: P3016
The fallback method for database resets failed, meaning Migrate could not clean up the database entirely. Original error:
Database error
Error querying the database: db error: ERROR: cannot drop view geography_columns because extension postgis requires it
HINT: You can drop extension postgis instead.
0: sql_migration_connector::best_effort_reset
with connection=<connection details>
at migration-engine/connectors/sql-migration-connector/src/lib.rs:100
1: migration_core::api::Reset
at migration-engine/core/src/api.rs:159
Unfortunately i cannot remove the PostGis extension. (ps. i am new to postgis and it is also possible that i have configured PostGis wrongly, as there doesnt seem to be anyone with the same issue)
Is there any place i can define a list of ignored tables / views for migrate?
How to reproduce
- With PostGis and related views enabled in database
- Run prisma migrate dev
Expected behavior
No response
Prisma information
Running prisma migrate dev --name init
Environment & setup
- OS: Mac OS
- Database: PostgreSQL
- Node.js version: 14.4.0
Prisma Version
"@prisma/client": "^2.25.0"
"prisma": "^2.25.0"
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Chapter 3. PostGIS Administration
Upgrading existing spatial databases can be tricky as it requires replacement or introduction of new PostGIS object definitions. Unfortunately not all ...
Read more >Making spatial view in PostGIS and adding it as layer in QGIS?
I view is built from the geonames database, loaded into PostGIS. The geoname table/spatial data can be selected/viewed in QGIS just fine. When ......
Read more >PostgreSQL Migration with Database Migration Service
Check whether all the features that you use in your source databases are available in Cloud SQL for PostgreSQL. For all data-type and...
Read more >PostGIS For Newbies - Crunchy Data
Refresh your database and you should be able to see the new tables. If you query the streets or neighborhoods and click to...
Read more >Postgres database versioning and schema migration with Git ...
We use Git and Flyway to automate our schema migrations. It greatly reduces the friction of merging schema changes made by multiple developers...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ok I researched this and geometry_columns and spatial_ref_sys used to be tables, but they are views in newer versions of postgis. We have code to ignore these, it just needs to be extended to views. Working on this.
created as https://github.com/prisma/prisma/issues/14182