I can't migrate PostGIS tables..
See original GitHub issueBug description
I think that verifying with shadow database failed because migrate tools drop table spatial_ref_sys so public.geometry does not exist…
How to reproduce
1.make schema with geo table
generator client {
provider = "prisma-client-js"
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
}
model Geom {
geomId Int @id @default(autoincrement())
geomData Unsupported("\"public\".geometry(multipolygon, 4326)")
createdAt DateTime @default(now()) @db.Timestamptz
updatedAt DateTime @updatedAt @db.Timestamptz
}
-
npx prisma migrate --name init
-
modify schema schema.prisma
...
model test {
id Int @id @default(autoincrement())
}
- again
npx prisma migrate --name add_test_table
Expected behavior
working well!
Prisma information
Error: P3006
Migration `20220503113444_add_geom` failed to apply cleanly to the shadow database.
Error:
db error: ERROR: type "public.geometry" does not exist
0: sql_migration_connector::validate_migrations
at migration-engine/connectors/sql-migration-connector/src/lib.rs:272
1: migration_core::state::DevDiagnostic
at migration-engine/core/src/state.rs:250
Environment & setup
- OS: Mac Os
- Database: Postgresql with PostGIS
- Node.js version: 16
Prisma Version
prisma : 3.13.0
@prisma/client : 3.13.0
Current platform : darwin
Query Engine (Node-API) : libquery-engine efdf9b1183dddfd4258cd181a72125755215ab7b (at node_modules/@prisma/engines/libquery_engine-darwin.dylib.node)
Migration Engine : migration-engine-cli efdf9b1183dddfd4258cd181a72125755215ab7b (at node_modules/@prisma/engines/migration-engine-darwin)
Introspection Engine : introspection-core efdf9b1183dddfd4258cd181a72125755215ab7b (at node_modules/@prisma/engines/introspection-engine-darwin)
Format Binary : prisma-fmt efdf9b1183dddfd4258cd181a72125755215ab7b (at node_modules/@prisma/engines/prisma-fmt-darwin)
Default Engines Hash : efdf9b1183dddfd4258cd181a72125755215ab7b
Studio : 0.459.0
Issue Analytics
- State:
- Created a year ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
Migrating PostgreSQL table with Lat Lon columns to existing ...
Let's assume that your 'deg' columns are +ve for North/East and -ve for South/West, and that all other metrics are +ve only, ...
Read more >Do not drop PostGIS table · Issue #76 · prisma/migrate - GitHub
PostGIS requires spatial_ref_sys table which Prisma is trying to drop when performing the initial migration.
Read more >Chapter 3. PostGIS Administration
5) load the PostGIS functions into a template database called template_postgis . If the template_postgis database exists in your PostgreSQL installation then it ......
Read more >postgres, cannot see table data after migration - Stack Overflow
After I've migrated a table from another database I cannot see the data in the postgres table. With \d I can see the...
Read more >Preparing PostgreSQL for migration with Database Migration ...
If you're worried about the data in that table changing during the migration, you can copy the data over right before promoting the...
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
Can you maybe open a quick new issue with just your reproduction? That would make it easier for us to reproduce and discuss. Thanks.
@janpio suggestion worked for me!