From baf7ba20b1c3c97eaa37023821ac9ccd7788391f Mon Sep 17 00:00:00 2001 From: Rafi Arrafif Date: Tue, 7 Apr 2026 12:00:00 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20db:=20enforce=20season?= =?UTF-8?q?=20field=20constraint?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migration.sql | 10 ++++++++++ prisma/schema.prisma | 4 ++-- 2 files changed, 12 insertions(+), 2 deletions(-) create mode 100644 prisma/migrations/20260421141307_enforce_season_year_in_media/migration.sql diff --git a/prisma/migrations/20260421141307_enforce_season_year_in_media/migration.sql b/prisma/migrations/20260421141307_enforce_season_year_in_media/migration.sql new file mode 100644 index 0000000..c493a50 --- /dev/null +++ b/prisma/migrations/20260421141307_enforce_season_year_in_media/migration.sql @@ -0,0 +1,10 @@ +/* + Warnings: + + - Made the column `season` on table `medias` required. This step will fail if there are existing NULL values in that column. + - Made the column `yearReleased` on table `medias` required. This step will fail if there are existing NULL values in that column. + +*/ +-- AlterTable +ALTER TABLE "medias" ALTER COLUMN "season" SET NOT NULL, +ALTER COLUMN "yearReleased" SET NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 38fd036..bdce447 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -36,8 +36,8 @@ model Media { status String startAiring DateTime? endAiring DateTime? - season Season? - yearReleased Int? @db.SmallInt + season Season + yearReleased Int @db.SmallInt synopsis String @db.Text ageRating String mediaType MediaType