Add country_code field to userVisitedWorldTravel table

This commit is contained in:
Sean Morley
2024-04-14 13:39:32 +00:00
parent 5e1d7ef160
commit c5ce984cac
7 changed files with 411 additions and 2 deletions

View File

@@ -0,0 +1,6 @@
ALTER TABLE "userVisitedWorldTravel" ADD COLUMN "country_code" text NOT NULL;--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "userVisitedWorldTravel" ADD CONSTRAINT "userVisitedWorldTravel_country_code_worldTravelCountries_country_code_fk" FOREIGN KEY ("country_code") REFERENCES "worldTravelCountries"("country_code") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;