suggested SQL statements to set DEFAULT values are wrong
Hello,
I'm going through the steps to upgrade from prisma 1.13 to 2.17 and so far it was a pleasant experience. However, I came across an issue with the generated SQL statements to fix the DEFAULT constraint on many fields, please see below for a comparison between datamodel and generated SQL:
datamodel:
status: AdStatus @default(value: "DRAFT")
displayMode: AdDisplayModeType @default(value: "SINGLE")
suggested SQL statements:
ALTER TABLE `Ad` CHANGE `status` `status` MEDIUMTEXT DEFAULT 'DRAFT';
ALTER TABLE `Ad` CHANGE `displayMode` `displayMode` MEDIUMTEXT DEFAULT 'SINGLE';
as you can see:
- status is an enum field with a default value of DRAFT, but SQL is MEDIUMTEXT the same applies to displayMode
using Prisma v1.13
Any Updates on this how you fix this problem. this issue still there in upgrade CLI please help to fix this problem.
Do these SQL statements fail because of this? What is the type of the columns before? (Is it possible that enums from Prisma 1 are stores as mediumtext by default?)