
CREATE SEQUENCE IF NOT EXISTS public."GatePass_GatePassId_seq"
    INCREMENT 1
    START 1
    MINVALUE 1
    MAXVALUE 9223372036854775807
    CACHE 1;


CREATE TABLE IF NOT EXISTS public."GatePass"
(
    "GatePassId" integer NOT NULL DEFAULT nextval('"GatePass_GatePassId_seq"'::regclass),
    "AdmissionId" integer NOT NULL,
    "ValidUpto" timestamp(6) without time zone NOT NULL,
    "Remark" text COLLATE pg_catalog."default",
    "CreatedBy" integer NOT NULL,
    "CreatedDate" timestamp(6) without time zone NOT NULL,
    "ModifiedBy" integer,
    "ModifiedDate" timestamp(6) without time zone,
    CONSTRAINT "GatePass_pkey" PRIMARY KEY ("GatePassId"),
    CONSTRAINT "FK_GatePass_AdmissionId" FOREIGN KEY ("AdmissionId")
        REFERENCES public."Admission" ("AdmissionId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "FK_GatePass_CreatedBy" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE CASCADE,
    CONSTRAINT "FK_GatePass_ModifiedBy" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE CASCADE
)

TABLESPACE pg_default;
