From 90655dcf92110fbc87e238b329a29df46bc86b03 Mon Sep 17 00:00:00 2001 From: Rafi Arrafif Date: Sun, 1 Mar 2026 12:28:16 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=9A=20chore:=20rename=20hero=20banner?= =?UTF-8?q?=20table=20in=20schema?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration.sql | 20 ++++++++++++ .../migration.sql | 32 +++++++++++++++++++ prisma/schema.prisma | 1 + 3 files changed, 53 insertions(+) create mode 100644 prisma/migrations/20260301052432_add_hero_banner/migration.sql create mode 100644 prisma/migrations/20260301052641_rename_hero_banner/migration.sql diff --git a/prisma/migrations/20260301052432_add_hero_banner/migration.sql b/prisma/migrations/20260301052432_add_hero_banner/migration.sql new file mode 100644 index 0000000..64de72c --- /dev/null +++ b/prisma/migrations/20260301052432_add_hero_banner/migration.sql @@ -0,0 +1,20 @@ +-- CreateTable +CREATE TABLE "HeroBanner" ( + "id" UUID NOT NULL, + "isClickable" BOOLEAN NOT NULL DEFAULT false, + "title" VARCHAR(225), + "description" TEXT, + "buttonContent" VARCHAR(100), + "buttonLink" TEXT, + "imageUrl" TEXT, + "startDate" TIMESTAMP(3) NOT NULL, + "endDate" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "creatorId" UUID NOT NULL, + + CONSTRAINT "HeroBanner_pkey" PRIMARY KEY ("id") +); + +-- AddForeignKey +ALTER TABLE "HeroBanner" ADD CONSTRAINT "HeroBanner_creatorId_fkey" FOREIGN KEY ("creatorId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/migrations/20260301052641_rename_hero_banner/migration.sql b/prisma/migrations/20260301052641_rename_hero_banner/migration.sql new file mode 100644 index 0000000..8fb2907 --- /dev/null +++ b/prisma/migrations/20260301052641_rename_hero_banner/migration.sql @@ -0,0 +1,32 @@ +/* + Warnings: + + - You are about to drop the `HeroBanner` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropForeignKey +ALTER TABLE "HeroBanner" DROP CONSTRAINT "HeroBanner_creatorId_fkey"; + +-- DropTable +DROP TABLE "HeroBanner"; + +-- CreateTable +CREATE TABLE "hero_banner" ( + "id" UUID NOT NULL, + "isClickable" BOOLEAN NOT NULL DEFAULT false, + "title" VARCHAR(225), + "description" TEXT, + "buttonContent" VARCHAR(100), + "buttonLink" TEXT, + "imageUrl" TEXT, + "startDate" TIMESTAMP(3) NOT NULL, + "endDate" TIMESTAMP(3) NOT NULL, + "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "updatedAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP, + "creatorId" UUID NOT NULL, + + CONSTRAINT "hero_banner_pkey" PRIMARY KEY ("id") +); + +-- AddForeignKey +ALTER TABLE "hero_banner" ADD CONSTRAINT "hero_banner_creatorId_fkey" FOREIGN KEY ("creatorId") REFERENCES "users"("id") ON DELETE RESTRICT ON UPDATE CASCADE; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index b3bcf48..d907814 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -568,6 +568,7 @@ model HeroBanner { updatedAt DateTime @default(now()) @updatedAt creatorId String @db.Uuid createdBy User @relation("UserHeroBanner", fields: [creatorId], references: [id]) + @@map("hero_banner") } model SystemPreference {