Skip to content

Commit

Permalink
feat: add user details endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
wielopolski committed Nov 7, 2024
1 parent 1a80808 commit 04a7889
Show file tree
Hide file tree
Showing 7 changed files with 1,866 additions and 2 deletions.
17 changes: 17 additions & 0 deletions apps/api/src/storage/migrations/0006_create_user_details.sql
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 $$;
Loading

0 comments on commit 04a7889

Please sign in to comment.