mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-08 11:37:25 +00:00
migration scripts
This commit is contained in:
parent
1df047a84a
commit
b8be604ab3
3 changed files with 9660 additions and 0 deletions
27
src/app/db/migrations/0205_wonderful_pixie.sql
Normal file
27
src/app/db/migrations/0205_wonderful_pixie.sql
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
CREATE TYPE "public"."override_source" AS ENUM('classifier', 'user');--> statement-breakpoint
|
||||
CREATE TYPE "public"."property_type" AS ENUM('House', 'Bungalow', 'Flat', 'Maisonette', 'Park home', 'Unknown');--> statement-breakpoint
|
||||
CREATE TYPE "public"."wall_type" AS ENUM('Cavity', 'Solid Brick', 'Timber frame', 'Sandstone', 'Unknown');--> statement-breakpoint
|
||||
CREATE TABLE "landlord_property_type_overrides" (
|
||||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"portfolio_id" bigint NOT NULL,
|
||||
"description" text NOT NULL,
|
||||
"value" "property_type" NOT NULL,
|
||||
"source" "override_source" NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
CONSTRAINT "landlord_property_type_overrides_portfolio_description_unique" UNIQUE("portfolio_id","description")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE TABLE "landlord_wall_type_overrides" (
|
||||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL,
|
||||
"portfolio_id" bigint NOT NULL,
|
||||
"description" text NOT NULL,
|
||||
"value" "wall_type" NOT NULL,
|
||||
"source" "override_source" NOT NULL,
|
||||
"created_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
"updated_at" timestamp with time zone DEFAULT now() NOT NULL,
|
||||
CONSTRAINT "landlord_wall_type_overrides_portfolio_description_unique" UNIQUE("portfolio_id","description")
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE "landlord_property_type_overrides" ADD CONSTRAINT "landlord_property_type_overrides_portfolio_id_portfolio_id_fk" FOREIGN KEY ("portfolio_id") REFERENCES "public"."portfolio"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
||||
ALTER TABLE "landlord_wall_type_overrides" ADD CONSTRAINT "landlord_wall_type_overrides_portfolio_id_portfolio_id_fk" FOREIGN KEY ("portfolio_id") REFERENCES "public"."portfolio"("id") ON DELETE cascade ON UPDATE no action;
|
||||
9626
src/app/db/migrations/meta/0205_snapshot.json
Normal file
9626
src/app/db/migrations/meta/0205_snapshot.json
Normal file
File diff suppressed because it is too large
Load diff
|
|
@ -1436,6 +1436,13 @@
|
|||
"when": 1779092260406,
|
||||
"tag": "0204_bizarre_black_bird",
|
||||
"breakpoints": true
|
||||
},
|
||||
{
|
||||
"idx": 205,
|
||||
"version": "7",
|
||||
"when": 1779791011744,
|
||||
"tag": "0205_wonderful_pixie",
|
||||
"breakpoints": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Loading…
Add table
Reference in a new issue