Files
simrsx-be/cmd/main-migration/migrations/20251031084657.sql
T
2025-10-31 15:47:18 +07:00

14 lines
574 B
SQL

-- Create "Rehab" table
CREATE TABLE "public"."Rehab" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Encounter_Id" bigint NULL,
"Doctor_Id" bigint NULL,
"AllocatedVisitCount" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Rehab_Doctor" FOREIGN KEY ("Doctor_Id") REFERENCES "public"."Doctor" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Rehab_Encounter" FOREIGN KEY ("Encounter_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);