-- Create "InfraGroup" table
CREATE TABLE "public"."InfraGroup" (
  "Id" bigserial NOT NULL,
  "CreatedAt" timestamptz NULL,
  "UpdatedAt" timestamptz NULL,
  "DeletedAt" timestamptz NULL,
  "Code" character varying(50) NULL,
  "Name" character varying(100) NULL,
  PRIMARY KEY ("Id"),
  CONSTRAINT "uni_InfraGroup_Code" UNIQUE ("Code")
);
-- Create "ItemGroup" table
CREATE TABLE "public"."ItemGroup" (
  "Id" bigserial NOT NULL,
  "CreatedAt" timestamptz NULL,
  "UpdatedAt" timestamptz NULL,
  "DeletedAt" timestamptz NULL,
  "Code" character varying(50) NULL,
  "Name" character varying(100) NULL,
  PRIMARY KEY ("Id"),
  CONSTRAINT "uni_ItemGroup_Code" UNIQUE ("Code")
);
-- Create "Employee" table
CREATE TABLE "public"."Employee" (
  "Id" bigserial NOT NULL,
  "CreatedAt" timestamptz NULL,
  "UpdatedAt" timestamptz NULL,
  "DeletedAt" timestamptz NULL,
  "User_Id" bigint NULL,
  "Person_Id" bigint NULL,
  "Position_Code" character varying(20) NOT NULL,
  "Division_Code" character varying(10) NULL,
  "Number" character varying(20) NULL,
  "Status_Code" character varying(10) NOT NULL,
  PRIMARY KEY ("Id"),
  CONSTRAINT "fk_Employee_Division" FOREIGN KEY ("Division_Code") REFERENCES "public"."Division" ("Code") ON UPDATE NO ACTION ON DELETE NO ACTION
);
