Gezim
12/23/2021, 3:36 AMprisma migrate dev --create-only, Prisma asks me to reset the database in dev. Why is this happening?Joël
prisma migrate dev (and --create-only) will check things like migrations missing from your migrations folder but already applied to the dev database, or migrations that were modified since they were applied (via a checksum) and guide you towards resolving the problem (the reset).Joël
Gezim
12/23/2021, 6:23 PMprisma db pull just prior to attempting the prisma migrate dev… command. In the prisma folder I only have schema.prisma. There isn’t a prisma migration table in the database either.Gezim
12/23/2021, 6:24 PMGezim
12/23/2021, 6:24 PMJoël
Joël
As part of adding Prisma Migrate to your development environment, you must reset your development database. This will result in data loss in the development database only.
Joël
Gezim
12/24/2021, 10:05 PMThis will result in data loss in the development database only.How does that work? How will it know not to run that “initial” migration in prod?
Gezim
01/04/2022, 4:04 AMprisma migrate dev from the above guide:
Error: P3006
Migration `20220104035918_initial_migration` failed to apply cleanly to the shadow database.
Error:
db error: ERROR: type "e" does not exist
0: sql_migration_connector::flavour::postgres::sql_schema_from_migration_history
at migration-engine/connectors/sql-migration-connector/src/flavour/postgres.rs:367
1: sql_migration_connector::validate_migrations
at migration-engine/connectors/sql-migration-connector/src/lib.rs:351
2: migration_core::api::DevDiagnostic
at migration-engine/core/src/api.rs:108Gezim
01/04/2022, 4:08 AMCREATE EXTENSION IF NOT EXISTS "uuid-ossp";Gezim
01/04/2022, 5:11 AMnpx prisma migrate dev and trying a bunch of times (instead of prisma migrate dev) fixed itJoël
Joël
How does that work? How will it know not to run that “initial” migration in prod?It’s explained in the baseline step https://www.prisma.io/docs/guides/database/developing-with-prisma-migrate/add-prisma-migrate-to-a-project#baseline-your-production-environment