
create sequence "DynamicTemplateConfig_DynamicTemplateConfigId_seq"


CREATE TABLE IF NOT EXISTS public."DynamicTemplateConfig"
(
    "DynamicTemplateConfigId" bigint NOT NULL DEFAULT nextval('"DynamicTemplateConfig_DynamicTemplateConfigId_seq"'::regclass),
    "ReportName" character varying(255) COLLATE pg_catalog."default",
    "DynamicReportId" bigint NOT NULL,
	"Active" boolean DEFAULT true,
    "CreatedBy" bigint NOT NULL,
    "CreatedDate" timestamp without time zone NOT NULL,
    "ModifiedBy" bigint,
    "ModifiedDate" timestamp without time zone,
    CONSTRAINT "DynamicTemplateConfig_pkey" PRIMARY KEY ("DynamicTemplateConfigId"),
    CONSTRAINT "FK_DynamicTemplateConfig_CreatedBy" FOREIGN KEY ("CreatedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
    CONSTRAINT "FK_DynamicTemplateConfig_ModifiedBy" FOREIGN KEY ("ModifiedBy")
        REFERENCES public."Account" ("AccountId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION,
	CONSTRAINT "FK_DynamicTemplateConfig_DynamicReportId" FOREIGN KEY ("DynamicReportId")
        REFERENCES public."DynamicReport" ("DynamicReportId") MATCH SIMPLE
        ON UPDATE NO ACTION
        ON DELETE NO ACTION
)

--------------------------------------------------------------------------------------------------------------------------


insert into "LogType" values (77, 'DynamicTemplateConfig', true)
