Skip to content

Commit

Permalink
update bool defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeKarow committed Dec 11, 2023
1 parent 824af8b commit f2d2e94
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
Warnings:
- Made the column `mailOnly` on table `OrgLocation` required. This step will fail if there are existing NULL values in that column.
- Made the column `mapCityOnly` on table `OrgLocation` required. This step will fail if there are existing NULL values in that column.
- Made the column `notVisitable` on table `OrgLocation` required. This step will fail if there are existing NULL values in that column.
*/
-- Update values for Location
UPDATE
"OrgLocation"
SET
"mailOnly" = FALSE
WHERE
"mailOnly" IS NULL;

UPDATE
"OrgLocation"
SET
"mapCityOnly" = FALSE
WHERE
"mapCityOnly" IS NULL;

UPDATE
"OrgLocation"
SET
"notVisitable" = FALSE
WHERE
"notVisitable" IS NULL;

-- AlterTable
ALTER TABLE "OrgLocation"
ALTER COLUMN "mailOnly" SET NOT NULL,
ALTER COLUMN "mailOnly" SET DEFAULT FALSE,
ALTER COLUMN "mapCityOnly" SET NOT NULL,
ALTER COLUMN "mapCityOnly" SET DEFAULT FALSE,
ALTER COLUMN "notVisitable" SET NOT NULL,
ALTER COLUMN "notVisitable" SET DEFAULT FALSE;
6 changes: 3 additions & 3 deletions packages/db/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -631,9 +631,9 @@ model OrgLocation {
postCode String?
primary Boolean @default(false)
mailOnly Boolean?
notVisitable Boolean?
mapCityOnly Boolean?
mailOnly Boolean @default(false)
notVisitable Boolean @default(false)
mapCityOnly Boolean @default(false)
description FreeText? @relation(fields: [descriptionId], references: [id], onDelete: SetNull, onUpdate: Cascade)
descriptionId String? @unique
Expand Down

0 comments on commit f2d2e94

Please sign in to comment.