From ed45f12a02f1d3759d52c60ca6604bdd574fc737 Mon Sep 17 00:00:00 2001 From: zzhhaa Date: Thu, 12 Dec 2024 12:33:23 +0000 Subject: [PATCH 1/2] feat: rename prices_paid table and columns --- .../migration.sql | 6 ++++++ .../migration.sql | 2 ++ prisma/schema.prisma | 6 +++--- 3 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 prisma/migrations/20241212122823_rename_prices_paid_table_and_columns/migration.sql create mode 100644 prisma/migrations/20241212123044_rename_prices_paid_constraint/migration.sql diff --git a/prisma/migrations/20241212122823_rename_prices_paid_table_and_columns/migration.sql b/prisma/migrations/20241212122823_rename_prices_paid_table_and_columns/migration.sql new file mode 100644 index 0000000..831d9d2 --- /dev/null +++ b/prisma/migrations/20241212122823_rename_prices_paid_table_and_columns/migration.sql @@ -0,0 +1,6 @@ +-- Alter table +ALTER TABLE "pricespaid" RENAME TO "prices_paid"; + +-- Alter table +ALTER TABLE "prices_paid" RENAME COLUMN "propertytype" TO "property_type"; +ALTER TABLE "prices_paid" RENAME COLUMN "transactionidentifier" TO "transaction_identifier"; \ No newline at end of file diff --git a/prisma/migrations/20241212123044_rename_prices_paid_constraint/migration.sql b/prisma/migrations/20241212123044_rename_prices_paid_constraint/migration.sql new file mode 100644 index 0000000..0be686b --- /dev/null +++ b/prisma/migrations/20241212123044_rename_prices_paid_constraint/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE "prices_paid" RENAME CONSTRAINT "pricespaid_pkey" TO "prices_paid_pkey"; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 86e4c55..80b5d65 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -50,13 +50,13 @@ model ItlLookup { model PricesPaid { id Int @id @default(autoincrement()) - transactionIdentifier String? @map("transactionidentifier") @db.VarChar(250) + transactionIdentifier String? @map("transaction_identifier") @db.VarChar(250) price Float? postcode String? @db.VarChar(250) - propertyType String? @map("propertytype") @db.VarChar(250) + propertyType String? @map("property_type") @db.VarChar(250) newBuild String? @map("newbuild") @db.VarChar(250) - @@map("pricespaid") + @@map("prices_paid") } model Rent { From 38c9393bf49c12188f533e44bd240103a6629e96 Mon Sep 17 00:00:00 2001 From: zzhhaa Date: Thu, 12 Dec 2024 12:34:44 +0000 Subject: [PATCH 2/2] feat: make prices_paid fields required --- .../migration.sql | 6 ++++++ prisma/schema.prisma | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) create mode 100644 prisma/migrations/20241212123358_make_prices_paid_fields_required/migration.sql diff --git a/prisma/migrations/20241212123358_make_prices_paid_fields_required/migration.sql b/prisma/migrations/20241212123358_make_prices_paid_fields_required/migration.sql new file mode 100644 index 0000000..2f259db --- /dev/null +++ b/prisma/migrations/20241212123358_make_prices_paid_fields_required/migration.sql @@ -0,0 +1,6 @@ +-- AlterTable +ALTER TABLE "prices_paid" ALTER COLUMN "transaction_identifier" SET NOT NULL, +ALTER COLUMN "price" SET NOT NULL, +ALTER COLUMN "postcode" SET NOT NULL, +ALTER COLUMN "property_type" SET NOT NULL, +ALTER COLUMN "newbuild" SET NOT NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 80b5d65..ee34678 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -50,11 +50,11 @@ model ItlLookup { model PricesPaid { id Int @id @default(autoincrement()) - transactionIdentifier String? @map("transaction_identifier") @db.VarChar(250) - price Float? - postcode String? @db.VarChar(250) - propertyType String? @map("property_type") @db.VarChar(250) - newBuild String? @map("newbuild") @db.VarChar(250) + transactionIdentifier String @map("transaction_identifier") @db.VarChar(250) + price Float + postcode String @db.VarChar(250) + propertyType String @map("property_type") @db.VarChar(250) + newBuild String @map("newbuild") @db.VarChar(250) @@map("prices_paid") }