

-------------------------------------------------------------------------------
--  sendmail queue
-------------------------------------------------------------------------------
CREATE TABLE SENDMAIL_QUEUE(
        ID BIGINT NOT NULL,
        SUBJECT VARCHAR(50),
	SENDER VARCHAR(200),
	RECEIVER VARCHAR(200),
	CC VARCHAR(200),
	BCC VARCHAR(200),
	CONTENT VARCHAR(65535),
	ATTACHMENT VARCHAR(200),
	DATA VARCHAR(65535),
	CREATE_TIME TIMESTAMP,
	STATUS VARCHAR(50),
	INFO VARCHAR(200),
	CONFIG_ID BIGINT,
	TEMPLATE_ID BIGINT,
	SCOPE_ID VARCHAR(50),
        CONSTRAINT PK_SENDMAIL_QUEUE PRIMARY KEY(ID),
        CONSTRAINT FK_SENDMAIL_QUEUE_CONFIG FOREIGN KEY(CONFIG_ID) REFERENCES SENDMAIL_CONFIG(ID),
	CONSTRAINT FK_SENDMAIL_QUEUE_TEMPLATE FOREIGN KEY(TEMPLATE_ID) REFERENCES SENDMAIL_TEMPLATE(ID)
);

