From c62f0d769693885533dde2eb306df0f977bbd9c4 Mon Sep 17 00:00:00 2001 From: zzhhaa Date: Thu, 12 Dec 2024 12:24:18 +0000 Subject: [PATCH] feat: rename rent table and set fields required --- .../migration.sql | 3 +++ .../migration.sql | 5 +++++ prisma/schema.prisma | 8 ++++---- 3 files changed, 12 insertions(+), 4 deletions(-) create mode 100644 prisma/migrations/20241212122143_rename_rent_table_columns/migration.sql create mode 100644 prisma/migrations/20241212122332_make_rent_fields_required/migration.sql diff --git a/prisma/migrations/20241212122143_rename_rent_table_columns/migration.sql b/prisma/migrations/20241212122143_rename_rent_table_columns/migration.sql new file mode 100644 index 0000000..5a250d1 --- /dev/null +++ b/prisma/migrations/20241212122143_rename_rent_table_columns/migration.sql @@ -0,0 +1,3 @@ +-- AlterTable +ALTER TABLE "rent" RENAME COLUMN "ladcode" TO "lad_code"; +ALTER TABLE "rent" RENAME COLUMN "monthlymeanrent" TO "monthly_mean_rent"; diff --git a/prisma/migrations/20241212122332_make_rent_fields_required/migration.sql b/prisma/migrations/20241212122332_make_rent_fields_required/migration.sql new file mode 100644 index 0000000..a25a632 --- /dev/null +++ b/prisma/migrations/20241212122332_make_rent_fields_required/migration.sql @@ -0,0 +1,5 @@ +-- AlterTable +ALTER TABLE "rent" ALTER COLUMN "itl3" SET NOT NULL, +ALTER COLUMN "lad_code" SET NOT NULL, +ALTER COLUMN "region" SET NOT NULL, +ALTER COLUMN "monthly_mean_rent" SET NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 86e4c55..4b55772 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -61,10 +61,10 @@ model PricesPaid { model Rent { id Int @id @default(autoincrement()) - itl3 String? @db.VarChar(250) - ladCode String? @map("ladcode") @db.VarChar(250) - region String? @db.VarChar(250) - monthlyMeanRent Float? @map("monthlymeanrent") + itl3 String @db.VarChar(250) + ladCode String @map("lad_code") @db.VarChar(250) + region String @db.VarChar(250) + monthlyMeanRent Float @map("monthly_mean_rent") @@map("rent") }