spacedrive icon indicating copy to clipboard operation
spacedrive copied to clipboard

Use PCR for migrations

Open Brendonovich opened this issue 3 years ago • 1 comments

Using our own migration engine is cringe. Since we're using Prisma we can use their migration engine which is much more reliable and cool. Using a prerelease of PCR 0.6.2 we can use the migration engine to alleviate a lot of our migration issues, but it will require some different approaches for developing migrations and changing the schema:

  • In development, migrations do not need to be generated. The equivalent of prisma db push will be ran on launch to synchronise the database and the Prisma schema. Sometimes this may require resetting the database, which can be done by changing the false in _db_push to true in core/src/utils/db.rs. Once schema changes are finalized, migrations should be generated with cargo prisma migrate dev as usual.
  • In production, the equivalent of prisma migrate deploy will be ran and the migrations will be loaded onto the user's machine. This is a non-destructive operation and will simply apply the migrations we have already created and (hopefully) tested.

Should close #173

Brendonovich avatar Sep 17 '22 06:09 Brendonovich

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
spacedrive-landing ✅ Ready (Inspect) Visit Preview Sep 21, 2022 at 2:02PM (UTC)
spacedrive-web ✅ Ready (Inspect) Visit Preview Sep 21, 2022 at 2:02PM (UTC)

vercel[bot] avatar Sep 17 '22 06:09 vercel[bot]