You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 25, 2021. It is now read-only.
model Merchant {
id String @default(cuid()) @id
}
model Payload {
id String @default(cuid()) @id
merchant . Merchant?
}
When I update to preview15
And create a migration
I see a breaking change
ALTERTABLE"public"."Merchant" DROP COLUMN "Payload;ALTER TABLE "public"."Payload" ADD COLUMN "merchant" text REFERENCES "public"."Merchant"("id") ON DELETE SET NULL;
Expected behaviour: be able to perform this migration without a data loss.
The text was updated successfully, but these errors were encountered:
This migration was probably caused by a change we made recently in how prisma interprets "implicit self-relations" like the relation between Merchant and Payload in your schema. Relevant links: spec, PR.
And you are right, the current behaviour is leading to systematic data loss when doing that type of schema changes. We haven't had the time and resources to implement something better yet, but we are very much aware of that and are planning to work on it. Discussion is centralized here.
Given a schema
When I update to
preview15
And create a migration
I see a breaking change
Expected behaviour: be able to perform this migration without a data loss.
The text was updated successfully, but these errors were encountered: