add table person-relative, add fk personrelative into person

This commit is contained in:
dpurbosakti
2025-09-02 13:33:01 +07:00
parent e8a7123f30
commit 53f798ce29
7 changed files with 163 additions and 40 deletions

No files matched your search

@@ -0,0 +1,20 @@
-- Create "PersonRelative" table
CREATE TABLE "public"."PersonRelative" (
"Id" bigserial NOT NULL,
"CreatedAt" timestamptz NULL,
"UpdatedAt" timestamptz NULL,
"DeletedAt" timestamptz NULL,
"Person_Id" bigint NULL,
"Relationship_Code" character varying(100) NOT NULL,
"Name" character varying(100) NULL,
"Address" character varying(100) NULL,
"Village_Code" character varying(10) NULL,
"Gender_Code" character varying(10) NULL,
"PhoneNumber" character varying(30) NULL,
"Education_Code" character varying(10) NULL,
"Occupation_Code" character varying(10) NULL,
"Occupation_Name" character varying(50) NULL,
PRIMARY KEY ("Id"),
CONSTRAINT "fk_PersonRelative_Village" FOREIGN KEY ("Village_Code") REFERENCES "public"."Village" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION,
CONSTRAINT "fk_Person_Relatives" FOREIGN KEY ("Person_Id") REFERENCES "public"."Person" ("Id") ON UPDATE NO ACTION ON DELETE NO ACTION
);