Brendonovich / prisma-client-rust

Type-safe database access for Rust
https://prisma.brendonovich.dev
Apache License 2.0
1.76k stars 104 forks source link

bug - changing primary key names #271

Closed brecht-derooms closed 1 year ago

brecht-derooms commented 1 year ago

Coming from a db that is not managed by prisma but by another ORM I noticed that it generates a.

I assume this is a minor bug and that the rename constraint shouldn't have been generated in this case or that the add constraint should have not bene generated but in that case the SQL syntax is not entirely correct either (it might require to "alter table" statements iirc).

-- AlterTable
ALTER TABLE "product_reservations" DROP CONSTRAINT "pk-product_reservations",
RENAME CONSTRAINT "pk-product_reservations" TO "product_reservations_pkey",
... column changes
ADD CONSTRAINT "product_reservations_pkey" PRIMARY KEY ("id");

Easy to fix manually though.

Brendonovich commented 1 year ago

PCR doesn't manage migration SQL, you'll want to report this over in the Prisma repo.