create table QX_EMAIL_SERVICE_LOG (
	PKEY int NOT NULL ,
	MESSAGE_ID int NULL ,
	MESSAGE_TYPE int NULL ,
	E_TO varchar(255) NULL ,
	E_FROM varchar(255) NULL ,
	E_SUBJECT varchar(1022) NULL ,
	MESSAGE_LEVEL int NULL ,
	CREATED datetime NULL ,
	OWNER_ID int NULL ,
	WORKGROUP_ID int NULL ,
	OBJECT_TYPE int null,
	OBJECT_ID int null,
	FILTER_ID int NULL ,
	ROUTING_ID int NULL ,
	DESCRIPTION varchar(1022) NULL ,
	ACCOUNT_ID int NULL ,
	constraint PK_QX_EMAIL_SERVICE_LOG primary key (PKEY)
)
go

INSERT INTO QX_LOG_CLASS VALUES (1, 'Email Inbox', 'QX_EMAIL_SERVICE_LOG');
INSERT INTO QX_LOG_CLASS VALUES (2, 'Email Outbox', 'QX_EMAIL_SERVICE_LOG');
INSERT INTO QX_LOG_CLASS VALUES (3, 'Email Trash', 'QX_EMAIL_SERVICE_LOG');
INSERT INTO QX_LOG_CLASS VALUES (4, 'Email Autoreply', 'QX_EMAIL_SERVICE_LOG');
INSERT INTO QX_LOG_CLASS VALUES (5, 'Email Filter', 'QX_EMAIL_SERVICE_LOG');
INSERT INTO QX_LOG_CLASS VALUES (6, 'Email Routing', 'QX_EMAIL_SERVICE_LOG');
INSERT INTO QX_LOG_CLASS VALUES (7, 'Email Ticket', 'QX_EMAIL_SERVICE_LOG');
INSERT INTO QX_LOG_CLASS VALUES (8, 'Email System', 'QX_EMAIL_SERVICE_LOG');
go

UPDATE QX_SYS_PROP SET PROP_VAL = '049' WHERE (PROP_ID = 'DB_CORE_VERSION');
go