For the complete documentation index, see llms.txt. This page is also available as Markdown.

MIGRATIONS

Prisma Migrations

Get Started

https://www.prisma.io/docs/concepts/components/prisma-migrate/get-started https://www.prisma.io/docs/concepts/components/prisma-migrate/migrate-development-production

Baseline Existing DBs (staging and prod)

https://www.prisma.io/docs/guides/database/developing-with-prisma-migrate/add-prisma-migrate-to-a-project#baseline-your-production-environment

cd applications/api-v2
yarn prisma migrate resolve --applied 20230110221201_init
yarn prisma migrate resolve --applied 20230110221244_functions_v2

Sync Process

Steps to sync

  1. Create an empty DB, and point DATABASE_URL env var to that one.

  2. Delete the applications/api-v2/prisma/migrations path and the *.toml lock.

  3. Run yarn prisma migrate dev --name init, so that an init migration gets created.

  4. Switch back DATABASE_URL to staging DB.

  5. Run yarn prisma migrate resolve --applied *****_init, so that we tell Prisma the creation migrations are ran.

  6. Run yarn prisma migrate dev --name sync_staging, so we simulate a new migration and get the Drift message.

Staging

Pending Drift issues to resolve on staging after this PR updates:

Production

Pending Drift issues to resolve on prod after this PR updates:

Last updated

Was this helpful?