Skip to content

Commit

Permalink
feat: Rename build_prices table, make not null
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr committed Dec 6, 2024
1 parent 4cb34ff commit 3439fe7
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
/*
Warnings:
- You are about to drop the `buildprices` table. If the table is not empty, all the data it contains will be lost.
*/
-- Alter table
ALTER TABLE "buildprices" RENAME TO "build_prices";

-- Alter table
ALTER TABLE "build_prices" RENAME COLUMN "housetype" TO "house_type";
ALTER TABLE "build_prices" RENAME COLUMN "pricerange" TO "price_range";
ALTER TABLE "build_prices" RENAME COLUMN "pricemid" TO "price_mid";
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AlterTable
ALTER TABLE "build_prices" RENAME CONSTRAINT "buildprices_pkey" TO "build_prices_pkey";
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/*
Warnings:
- Made the column `house_type_description` on table `build_prices` required. This step will fail if there are existing NULL values in that column.
- Made the column `house_type` on table `build_prices` required. This step will fail if there are existing NULL values in that column.
- Made the column `price_range` on table `build_prices` required. This step will fail if there are existing NULL values in that column.
- Made the column `price_mid` on table `build_prices` required. This step will fail if there are existing NULL values in that column.
*/
-- AlterTable
ALTER TABLE "build_prices" ALTER COLUMN "house_type_description" SET NOT NULL,
ALTER COLUMN "house_type" SET NOT NULL,
ALTER COLUMN "price_range" SET NOT NULL,
ALTER COLUMN "price_mid" SET NOT NULL;
10 changes: 5 additions & 5 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ datasource db {

model BuildPrices {
id Int @id @default(autoincrement())
houseTypeDescription String? @map("house_type_description") @db.VarChar(250)
houseType String? @map("housetype") @db.VarChar(1)
priceRange String? @map("pricerange") @db.VarChar(50)
priceMid Float? @map("pricemid")
houseTypeDescription String @map("house_type_description") @db.VarChar(250)
houseType String @map("house_type") @db.VarChar(1)
priceRange String @map("price_range") @db.VarChar(50)
priceMid Float @map("price_mid")
@@map("buildprices")
@@map("build_prices")
}

model GDHI {
Expand Down

0 comments on commit 3439fe7

Please sign in to comment.