Arun Kumar
07/06/2021, 9:31 AMintrospect command to update to the schema for the dev env. Now I want to update the schema on the qa env as well. How can I achieve this?janpio
Arun Kumar
07/06/2021, 10:39 AMjanpio
db push or create migrations (As files) via migrate dev.janpio
db push should be fine - it will just create your Prisma schema in the database you are connected to)Arun Kumar
07/06/2021, 10:46 AMArun Kumar
07/06/2021, 10:48 AMintrospect. Should I run the db push command as ci/cd pipeline?janpio
janpio
Arun Kumar
07/06/2021, 10:50 AMinstropect on local env and db push on the qa and prodRyan
07/06/2021, 10:50 AMprisma migrate deploy.Ryan
07/06/2021, 10:50 AMpush on prod is dangerous. Go for migrate in this case for both QA and Prod as it’s easier to maintain.Arun Kumar
07/06/2021, 10:54 AMRyan
07/06/2021, 10:56 AMprisma migrate deploy just applies all the migrations from your current Dev to QA. You do not need to name any migrations.Arun Kumar
07/06/2021, 1:00 PM3 migrations found in prisma/migrations
Error: P3009
migrate found failed migrations in the target database, new migrations will not be applied. Read more about how to resolve migration issues in a production database: <https://pris.ly/d/migrate-resolve>
The `20210519144318_changed` migration started at 2021-07-06 12:28:19.900106 UTC failed with the following logs:Ryan
07/06/2021, 1:27 PMprisma migrate normally on further migrations.Arun Kumar
07/06/2021, 2:01 PMError: P3006
Migration `20210519144318_changed` failed to apply cleanly to the shadow database.
Error:
Database error
Error querying the database: db error: ERROR: type "bigserial" does not exist
0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
at migration-engine\connectors\sql-migration-connector\src\flavour\<http://postgres.rs:367|postgres.rs:367>
1: sql_migration_connector::validate_migrations
at migration-engine\connectors\sql-migration-connector\src\<http://lib.rs:322|lib.rs:322>
2: migration_core::api::DevDiagnostic
at migration-engine\core\src\<http://api.rs:89|api.rs:89>Arun Kumar
07/06/2021, 2:02 PMjanpio
janpio
Arun Kumar
07/07/2021, 6:44 AMjanpio
bigserial exist on your Postgres database? If so, why does it not?
Why is it in your migration file?
Can you share that part of your schema and the mgiration SQL?Arun Kumar
07/08/2021, 5:15 AMArun Kumar
07/08/2021, 5:19 AMid Int @id @default(autoincrement())Arun Kumar
07/08/2021, 5:19 AMALTER TABLE "Facility" DROP CONSTRAINT "Facility_pkey",
ALTER COLUMN "id" SET DATA TYPE BIGSERIAL,Arun Kumar
07/08/2021, 5:21 AMALTER TABLE "Patient" DROP CONSTRAINT "Patient_pkey",
ALTER COLUMN "id" SET DATA TYPE BIGSERIAL,`