Add new migrations and update Adventure interface

This commit is contained in:
Sean Morley
2024-04-22 00:56:43 +00:00
parent a3d4d757a9
commit 921d36aa70
13 changed files with 2326 additions and 54 deletions

View File

@@ -0,0 +1,18 @@
CREATE TABLE IF NOT EXISTS "adventures" (
"id" serial PRIMARY KEY NOT NULL,
"userId" text NOT NULL,
"adventureName" text NOT NULL,
"location" text,
"activityTypes" json,
"description" text,
"rating" integer,
"link" text,
"imageUrl" text,
"date" text
);
--> statement-breakpoint
DO $$ BEGIN
ALTER TABLE "adventures" ADD CONSTRAINT "adventures_userId_user_id_fk" FOREIGN KEY ("userId") REFERENCES "user"("id") ON DELETE no action ON UPDATE no action;
EXCEPTION
WHEN duplicate_object THEN null;
END $$;