-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Description
Issue Description
I'm getting the following error upon applying migration on the new version:
`A migration failed to apply. New migrations cannot be applied before the error is recovered from. Read more about how to resolve migration issues in a production database: https://pris.ly/d/migrate-resolve
Migration name: 20250522054050_add_organisations
Database error code: 23502
Database error:
ERROR: null value in column "organisationId" of relation "OrganisationGroup" violates not-null constraint
DETAIL: Failing row contains (org_group_xirhimhddwenzbbf, null, INTERNAL_TEAM, MEMBER, null, 2, ADMIN).
DbError { severity: "ERROR", parsed_severity: Some(Error), code: SqlState(E23502), message: "null value in column "organisationId" of relation "OrganisationGroup" violates not-null constraint", detail: Some("Failing row contains (org_group_xirhimhddwenzbbf, null, INTERNAL_TEAM, MEMBER, null, 2, ADMIN)."), hint: None, position: None, where_: None, schema: Some("public"), table: Some("OrganisationGroup"), column: Some("organisationId"), datatype: None, constraint: None, file: Some("execMain.c"), line: Some(1972), routine: Some("ExecConstraints") }`
By rolling back the failed migration using "npx prisma migrate resolve --rolled-back "20250522054050_add_organisations" --schema ../../packages/prisma/schema.prisma" i'm able to downgrade to version 1.11 which works.
Steps to Reproduce
No response
Expected Behavior
No response
Current Behavior
No response
Screenshots (optional)
No response
Operating System [e.g., Windows 10]
No response
Browser [e.g., Chrome, Firefox]
No response
Version [e.g., 2.0.1]
No response
Please check the boxes that apply to this issue report.
- I have searched the existing issues to make sure this is not a duplicate.
- I have provided steps to reproduce the issue.
- I have included relevant environment information.
- I have included any relevant screenshots.
- I understand that this is a voluntary contribution and that there is no guarantee of resolution.
- I want to work on creating a PR for this issue if approved