-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: added share trip route, added get trip route. test: added integ…
…ration test for both
- Loading branch information
1 parent
256e7d6
commit 435e4e8
Showing
16 changed files
with
758 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
CREATE TABLE IF NOT EXISTS "shared_trips" ( | ||
"id" serial PRIMARY KEY NOT NULL, | ||
"user_id" uuid NOT NULL, | ||
"trip_id" serial NOT NULL, | ||
"share_code" text NOT NULL, | ||
"created_at" timestamp with time zone DEFAULT now() NOT NULL, | ||
"expires_at" timestamp with time zone, | ||
CONSTRAINT "shared_trips_share_code_unique" UNIQUE("share_code") | ||
); | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "shared_trips" ADD CONSTRAINT "shared_trips_trip_id_trips_trip_id_fk" FOREIGN KEY ("trip_id") REFERENCES "public"."trips"("trip_id") ON DELETE cascade ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
Oops, something went wrong.