79293315

Date: 2024-12-19 06:45:32
Score: 2.5
Natty:
Report link

Go into your schema and make the change:

NormalizedName String @unique @db.VarChar(64) NormalizedName String? @unique @db.VarChar(64)

Then create a draft migration:

$ npx prisma migrate dev --name migration-name --create-only

Then edit the migration in SQL (this allow null values ie optional)

ALTER TABLE myTable ALTER COLUMN myColumn {DataType} NULL;

OR Postgres

ALTER TABLE myTable ALTER COLUMN myColumn DROP NOT NULL;

etc.

Then apply the modified SQL:

$ npx prisma migrate dev

I hope this works for you :)

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Contains question mark (0.5):
  • User mentioned (1): @unique
  • User mentioned (0): @unique
  • Low reputation (1):
Posted by: mohd sulthan