fix: Use constants.ts for brand colours > db DEFAULT (#13167)

* fix: user proper default values if no brand colour is set.

* fix:default value

* fix: more ?? to defined default as color is possibly null
This commit is contained in:
sean-brydon authored and GitHub committed 2024-01-11 20:22:35 +00:00
1 parent 9901c91e9b
commit bc6267e99b
9 files changed
+50 -22

No files matched your search

@@ -0,0 +1,17 @@
ALTER TABLE "Team" ALTER COLUMN "brandColor" DROP NOT NULL,
ALTER COLUMN "brandColor" DROP DEFAULT,
ALTER COLUMN "darkBrandColor" DROP NOT NULL,
ALTER COLUMN "darkBrandColor" DROP DEFAULT;
-- AlterTable
ALTER TABLE "users" ALTER COLUMN "brandColor" DROP NOT NULL,
ALTER COLUMN "brandColor" DROP DEFAULT,
ALTER COLUMN "darkBrandColor" DROP NOT NULL,
ALTER COLUMN "darkBrandColor" DROP DEFAULT;
UPDATE "Team" SET "brandColor" = NULL WHERE "brandColor" = '#292929';
UPDATE "Team" SET "darkBrandColor" = NULL WHERE "darkBrandColor" = '#fafafa';
UPDATE "users" SET "brandColor" = NULL WHERE "brandColor" = '#292929';
UPDATE "users" SET "darkBrandColor" = NULL WHERE "darkBrandColor" = '#fafafa';
+4 -4
View File
@@ -224,8 +224,8 @@ model User {
availability Availability[]
invitedTo Int?
webhooks Webhook[]
brandColor String @default("#292929")
darkBrandColor String @default("#fafafa")
brandColor String?
darkBrandColor String?
// the location where the events will end up
destinationCalendar DestinationCalendar?
away Boolean @default(false)
@@ -299,8 +299,8 @@ model Team {
/// @zod.custom(imports.teamMetadataSchema)
metadata Json?
theme String?
brandColor String @default("#292929")
darkBrandColor String @default("#fafafa")
brandColor String?
darkBrandColor String?
verifiedNumbers VerifiedNumber[]
parentId Int?
parent Team? @relation("organization", fields: [parentId], references: [id], onDelete: Cascade)