-
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.
- Loading branch information
1 parent
1a80808
commit 04a7889
Showing
7 changed files
with
1,866 additions
and
2 deletions.
There are no files selected for viewing
17 changes: 17 additions & 0 deletions
17
apps/api/src/storage/migrations/0006_create_user_details.sql
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,17 @@ | ||
CREATE TABLE IF NOT EXISTS "user_details" ( | ||
"id" uuid PRIMARY KEY DEFAULT gen_random_uuid() NOT NULL, | ||
"created_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
"updated_at" timestamp(3) with time zone DEFAULT CURRENT_TIMESTAMP NOT NULL, | ||
"user_id" uuid NOT NULL, | ||
"contact_phone_number" text, | ||
"description" text, | ||
"contact_email" text, | ||
"job_title" text, | ||
CONSTRAINT "user_details_user_id_unique" UNIQUE("user_id") | ||
); | ||
--> statement-breakpoint | ||
DO $$ BEGIN | ||
ALTER TABLE "user_details" ADD CONSTRAINT "user_details_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action; | ||
EXCEPTION | ||
WHEN duplicate_object THEN null; | ||
END $$; |
Oops, something went wrong.