This commit is contained in:
@@ -19,10 +19,14 @@ model LauncherNotice {
|
||||
startsAt DateTime? @map("starts_at") @db.Timestamptz(3)
|
||||
endsAt DateTime? @map("ends_at") @db.Timestamptz(3)
|
||||
priority Int @default(0)
|
||||
createdById String? @map("created_by_id") @db.Uuid
|
||||
createdByName String? @map("created_by_name")
|
||||
createdByEmail String? @map("created_by_email")
|
||||
createdAt DateTime @default(now()) @map("created_at") @db.Timestamptz(3)
|
||||
updatedAt DateTime @updatedAt @map("updated_at") @db.Timestamptz(3)
|
||||
|
||||
@@index([appKey, isActive, priority])
|
||||
@@index([createdByEmail])
|
||||
@@map("launcher_notices")
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
DO $$
|
||||
BEGIN
|
||||
IF to_regclass('public.launcher_notices') IS NOT NULL THEN
|
||||
ALTER TABLE "launcher_notices"
|
||||
ADD COLUMN IF NOT EXISTS "created_by_id" UUID,
|
||||
ADD COLUMN IF NOT EXISTS "created_by_name" TEXT,
|
||||
ADD COLUMN IF NOT EXISTS "created_by_email" TEXT;
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF to_regclass('public.launcher_notices') IS NOT NULL THEN
|
||||
CREATE INDEX IF NOT EXISTS "launcher_notices_created_by_email_idx" ON "launcher_notices"("created_by_email");
|
||||
END IF;
|
||||
END $$;
|
||||
Reference in New Issue
Block a user