CREATE SEQUENCE IF NOT EXISTS public."UserExcelHistory_UserExcelHistoryId_seq";



-- Table: public.UserExcelHistory

-- DROP TABLE IF EXISTS public."UserExcelHistory";

CREATE TABLE IF NOT EXISTS public."UserExcelHistory"
(
    "UserExcelHistoryId" integer NOT NULL DEFAULT nextval('"UserExcelHistory_UserExcelHistoryId_seq"'::regclass),
    "SheetName" text COLLATE pg_catalog."default",
    "UploadedBy" integer,
    "CreatedDate" timestamp without time zone,
    "LocationId" integer,
    "AddedUsers" text COLLATE pg_catalog."default",
    CONSTRAINT "UserExcelHistory_pkey" PRIMARY KEY ("UserExcelHistoryId"),
    CONSTRAINT "UserExcelHistory_LocationId_fkey" FOREIGN KEY ("LocationId")
        REFERENCES public."Location" ("LocationId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "UserExcelHistory_UploadedBy_fkey" FOREIGN KEY ("UploadedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)

TABLESPACE pg_default;

ALTER TABLE IF EXISTS public."UserExcelHistory"
    OWNER to postgres;