Postgis verstion update

Hello, How can I update from version 3.2.4 postgis to 3.2.6. 3.2.4 is currently in my database and that version is not existing anywhere now. So if I want to deploy my migrations on staging environment i have a problem
DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E22023), message: "extension \"postgis\" has no installation script nor update path for version \"3.2.4\"", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("extension.c"), line: Some(1535), routine: Some("CreateExtensionInternal
DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E22023), message: "extension \"postgis\" has no installation script nor update path for version \"3.2.4\"", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("extension.c"), line: Some(1535), routine: Some("CreateExtensionInternal
3.2.6 is next available Is there a way to somehow change 3.2.4 to 3.2.6 in already created migration and do not mess up my data on production env ? Or what is a solution
1 Reply
RaphaelEtim
RaphaelEtim2w ago
Hi @Aleksandar Dimitrijevic Can you try enabling the postgresqlExtensions preview feature in your Prisma schema:
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions"]
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["postgresqlExtensions"]
}
In your Prisma schema, you can specify the PostGIS extension with the desired version:
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [postgis(version: "3.2.6")]
}
datasource db {
provider = "postgresql"
url = env("DATABASE_URL")
extensions = [postgis(version: "3.2.6")]
}
After making these changes, you should create a new migration to update the PostGIS version. You can do this by running:
npx prisma migrate dev --name update_postgis_version
npx prisma migrate dev --name update_postgis_version
This should create a new migration file that includes the necessary SQL to update the PostGIS extension. https://www.prisma.io/docs/orm/prisma-schema/postgresql-extensions
How to represent PostgreSQL extensions in your Prisma schema | Pris...
How to represent PostgreSQL extensions in your Prisma scheme, introspect extensions in your database, and apply changes to extensions with Prisma Migrate
Want results from more Discord servers?
Add your server