mirror of
https://github.com/temetro/temetro.git
synced 2026-08-09 01:59:30 +00:00
2f36875d37
New staff_profile table (org + user, unique) holding a clinician's clinical specialty. GET /api/staff and /api/staff/providers now include specialty; new PATCH /api/staff/:userId (member:update) upserts it. Migration 0023. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
10 lines
723 B
SQL
10 lines
723 B
SQL
CREATE TABLE "staff_profile" (
|
|
"organization_id" text NOT NULL,
|
|
"user_id" text NOT NULL,
|
|
"specialty" text,
|
|
"updated_at" timestamp DEFAULT now() NOT NULL
|
|
);
|
|
--> statement-breakpoint
|
|
ALTER TABLE "staff_profile" ADD CONSTRAINT "staff_profile_organization_id_organization_id_fk" FOREIGN KEY ("organization_id") REFERENCES "public"."organization"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
ALTER TABLE "staff_profile" ADD CONSTRAINT "staff_profile_user_id_user_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
|
|
CREATE UNIQUE INDEX "staff_profile_org_user_idx" ON "staff_profile" USING btree ("organization_id","user_id"); |