-- Table: public."FACT_SESSION"

-- DROP TABLE public."FACT_SESSION";

CREATE TABLE public."FACT_SESSION"
(
    "SESSION_ID" bigint NOT NULL DEFAULT nextval('"FACT_SESSION_SESSION_ID_seq"'::regclass),
    "DATE_ID" bigint NOT NULL,
    "USER_ID" bigint NOT NULL,
    "START" bigint NOT NULL,
    "END" bigint NOT NULL,
    "TIME" bigint NOT NULL,
    "SRC_ID" bigint NOT NULL,
    CONSTRAINT "FACT_SESSION_pkey" PRIMARY KEY ("SESSION_ID"),
    CONSTRAINT "DATE_ID_FK" FOREIGN KEY ("DATE_ID")
        REFERENCES public."DIM_DATE" ("DATE_ID") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "USER_ID_FK" FOREIGN KEY ("USER_ID")
        REFERENCES public."DIM_USER" ("USER_ID") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)
WITH (
    OIDS = FALSE
)
TABLESPACE pg_default;

ALTER TABLE public."FACT_SESSION"
    OWNER to monnethicadmin;

-- Index: fki_USER_ID_FK

-- DROP INDEX public."fki_USER_ID_FK";

CREATE INDEX "fki_USER_ID_FK"
    ON public."FACT_SESSION" USING btree
    ("USER_ID")
    TABLESPACE pg_default;