mirror of
https://github.com/hanzo-apps/dataroom.git
synced 2026-10-30 14:47:36 +00:00
- Replace all Papermark branding with Hanzo Dataroom - Update metadata, titles, descriptions, OG tags - Update email templates footer and branding - Replace papermark.io/com URLs with dataroom.hanzo.ai - Update powered-by component - Update x-powered-by header - Update legal references to Hanzo AI, Inc. - Update social handles to @hanzoai - Update README, CLA, LICENSE, SECURITY docs
1.0 KiB
1.0 KiB
Create migrations after changes in schema.prisma
So you have made changes to the schema.prisma file and you want to apply those changes to the database.
Chances are you are getting this error from Prisma after running npx prisma migrate dev:
Drift detected: Your database schema is not in sync with your migration history.
...
Do you want to continue? All data will be lost.
Requirements
- Local prisma
npm install -g prisma
# npx prisma won't work
- shadow database, otherwise you overwrite your local db
Steps
- Create a new migration folder
mkdir -p prisma/migrations/20240408000000_add_model
- Generate the migration
prisma migrate diff --from-migrations prisma/migrations --to-schema-datamodel prisma/schema.prisma --shadow-database-url "postgresql://<USER>@localhost:5432/hanzo-dataroom-shadow-db" --script > prisma/migrations/20240408000000_add_model/migration.sql
- Apply the migration
prisma migrate resolve --applied 20240408000000_add_model