Files
simrsx-be/cmd/main-migration/migrations/20251111040358.sql
T
2025-11-11 11:04:56 +07:00

18 lines
715 B
SQL

-- Create "FileAttachment" table
CREATE TABLE "public"."FileAttachment" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"EntityType_Code" text NULL,
"Ref_Id" bigint NULL,
"Type_Code" text NULL,
"Name" text NULL,
"FilePath" text NULL,
"FileName" text NULL,
"Upload_Employee_Id" bigint NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_Encounter_FileAttachments" FOREIGN KEY ("Ref_Id") REFERENCES "public"."Encounter" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_FileAttachment_Upload_Employee" FOREIGN KEY ("Upload_Employee_Id") REFERENCES "public"."Employee" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);