This commit is contained in:
@@ -30,6 +30,21 @@ model LauncherNotice {
|
||||
@@map("launcher_notices")
|
||||
}
|
||||
|
||||
model LauncherTerm {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
key String @unique
|
||||
body String
|
||||
isRequired Boolean @default(true) @map("is_required")
|
||||
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([createdByEmail])
|
||||
@@map("launcher_terms")
|
||||
}
|
||||
|
||||
model ProvisionedDevice {
|
||||
id String @id @default(uuid()) @db.Uuid
|
||||
accountEmail String @map("account_email")
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
DO $$
|
||||
BEGIN
|
||||
IF to_regclass('public.launcher_notices') IS NOT NULL THEN
|
||||
CREATE TABLE IF NOT EXISTS "launcher_terms" (
|
||||
"id" UUID NOT NULL,
|
||||
"key" TEXT NOT NULL,
|
||||
"body" TEXT NOT NULL,
|
||||
"is_required" BOOLEAN NOT NULL DEFAULT true,
|
||||
"created_by_id" UUID,
|
||||
"created_by_name" TEXT,
|
||||
"created_by_email" TEXT,
|
||||
"created_at" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
"updated_at" TIMESTAMPTZ(3) NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
|
||||
CONSTRAINT "launcher_terms_pkey" PRIMARY KEY ("id")
|
||||
);
|
||||
|
||||
CREATE UNIQUE INDEX IF NOT EXISTS "launcher_terms_key_key" ON "launcher_terms"("key");
|
||||
CREATE INDEX IF NOT EXISTS "launcher_terms_created_by_email_idx" ON "launcher_terms"("created_by_email");
|
||||
|
||||
ALTER TABLE "launcher_terms" DROP COLUMN IF EXISTS "title";
|
||||
ALTER TABLE "launcher_terms" DROP COLUMN IF EXISTS "priority";
|
||||
ALTER TABLE "launcher_terms" DROP COLUMN IF EXISTS "version";
|
||||
ALTER TABLE "launcher_terms" DROP COLUMN IF EXISTS "is_active";
|
||||
ALTER TABLE "launcher_terms" DROP COLUMN IF EXISTS "starts_at";
|
||||
ALTER TABLE "launcher_terms" DROP COLUMN IF EXISTS "ends_at";
|
||||
END IF;
|
||||
END $$;
|
||||
Reference in New Issue
Block a user