Tyler Bell
10/15/2021, 9:25 PMprisma migrate deploy
but that too resulted in errors such as this one…
DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState("42704"), message: "constraint \"CustomField_memberId_fkey\" of relation \"CustomField\" does not exist", detail: None, hint: None, position: None, where_: None, schema: None, table: None, column: None, datatype: None, constraint: None, file: Some("tablecmds.c"), line: Some(10987), routine: Some("ATExecDropConstraint") }
We tried manually fixing the errors one by one, but we didn’t get any where with it. No matter what we did, migrate deploy
would never succeed.
That led us to try to start from a clean slate. We tried the following….
1. we first duplicated our production database for testing purposes.
2. we deleted the _prisma_migrations
table
3. we deleted the migrations
folder
4. we then followed the instructions here on adding prisma to an existing project.
a. ran prisma pull db
b. ran prisma migrate dev --name initial-migration --create-only
which resulted in yet another Drift detected: Your database schema is not in sync with your migration history.
message.
At this point we are kinda at a loss 😅
Does anyone know a good approach to take here?tom
10/18/2021, 5:29 AMTyler Bell
10/18/2021, 12:33 PMTyler Bell
10/18/2021, 12:34 PMmigrate dev
when we should have been using db push
which is what created the problems.
At this point we are trying to figure out how to enable migrate deploy
again without losing any production DB data.tom
10/18/2021, 2:29 PMmigrate status
, but it could hlp.Tyler Bell
10/18/2021, 2:44 PMmigrate status
but was still unable to resolve the issues.Tyler Bell
10/18/2021, 3:23 PMtom
10/20/2021, 6:28 AMTyler Bell
10/20/2021, 5:22 PMTyler Bell
10/20/2021, 5:22 PMtom
10/21/2021, 5:25 AMtom
10/21/2021, 11:33 AMtom
10/21/2021, 11:34 AMtom
10/21/2021, 11:41 AMTyler Bell
10/21/2021, 2:00 PMFrederik
12/08/2021, 2:50 PMmigrate diff
- please take a look if you have a moment and let us know if this would be useful: https://github.com/prisma/prisma/issues/10561