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
Prisma Migrate generates incorrect sql when chaining different types of table altering operations (remove map from @id, add native type to other field) #24331
If you perform two different types of alteration on a table for instance renaming a constraint and altering the data type of a column then prisma migrate dev will generate incorrect sql code.
Database error code: 42601
Database error:
ERROR: syntax error at or near ","
This is because the generated sql will look like this:
ALTERTABLE"Fruits" RENAME CONSTRAINT"custom_name" TO "fruits_pkey",
ALTER COLUMN "name"SET DATA TYPE TEXT; -- this should be a separate ALTER TABLE statement --
Expected behavior
the generated sql should look like this :
ALTERTABLE"Fruits" RENAME CONSTRAINT"custom_name" TO "fruits_pkey";
ALTERTABLE"Fruits" ALTER COLUMN "name"SET DATA TYPE TEXT;