diff --git a/packages/prisma/src/prisma/migrations/20231206072146_update_recipe_nonnullable/migration.sql b/packages/prisma/src/prisma/migrations/20231206072146_update_recipe_nonnullable/migration.sql index eaa965008..522cf3631 100644 --- a/packages/prisma/src/prisma/migrations/20231206072146_update_recipe_nonnullable/migration.sql +++ b/packages/prisma/src/prisma/migrations/20231206072146_update_recipe_nonnullable/migration.sql @@ -15,12 +15,21 @@ UPDATE "Recipes" SET "folder" = 'inbox' WHERE "folder" IS NULL; -- AlterTable ALTER TABLE "Recipes" ALTER COLUMN "title" SET NOT NULL, ALTER COLUMN "description" SET NOT NULL, +ALTER COLUMN "description" SET DEFAULT '', ALTER COLUMN "yield" SET NOT NULL, +ALTER COLUMN "yield" SET DEFAULT '', ALTER COLUMN "activeTime" SET NOT NULL, +ALTER COLUMN "activeTime" SET DEFAULT '', ALTER COLUMN "totalTime" SET NOT NULL, +ALTER COLUMN "totalTime" SET DEFAULT '', ALTER COLUMN "source" SET NOT NULL, +ALTER COLUMN "source" SET DEFAULT '', ALTER COLUMN "url" SET NOT NULL, +ALTER COLUMN "url" SET DEFAULT '', ALTER COLUMN "notes" SET NOT NULL, +ALTER COLUMN "notes" SET DEFAULT '', ALTER COLUMN "ingredients" SET NOT NULL, +ALTER COLUMN "ingredients" SET DEFAULT '', ALTER COLUMN "instructions" SET NOT NULL, +ALTER COLUMN "instructions" SET DEFAULT '', ALTER COLUMN "folder" SET NOT NULL; diff --git a/packages/prisma/src/prisma/schema.prisma b/packages/prisma/src/prisma/schema.prisma index e2ed5c451..4d825707d 100644 --- a/packages/prisma/src/prisma/schema.prisma +++ b/packages/prisma/src/prisma/schema.prisma @@ -213,15 +213,15 @@ model Recipe { userId String @db.Uuid fromUserId String? @db.Uuid title String - description String - yield String - activeTime String - totalTime String - source String - url String - notes String - ingredients String - instructions String + description String @default("") + yield String @default("") + activeTime String @default("") + totalTime String @default("") + source String @default("") + url String @default("") + notes String @default("") + ingredients String @default("") + instructions String @default("") folder String @db.VarChar(255) createdAt DateTime @default(now()) @db.Timestamptz(6) updatedAt DateTime @updatedAt @db.Timestamptz(6)