Add and delete migration files

This commit is contained in:
Sean Morley
2024-04-11 23:58:09 +00:00
parent a17c482522
commit a03fc5fb4e
38 changed files with 1663 additions and 945 deletions

View File

@@ -0,0 +1,11 @@
CREATE TABLE IF NOT EXISTS "worldTravelRegions" (
"id" serial PRIMARY KEY NOT NULL,
"name" text NOT NULL,
"country_id" text NOT NULL
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "worldTravelRegions" ADD CONSTRAINT "worldTravelRegions_country_id_worldTravelCountries_id_fk" FOREIGN KEY ("country_id") REFERENCES "worldTravelCountries"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;