create table dbo.QX_AUTO_REPLY (
    PKEY int not null,
    NAME varchar(255) not null,
    DESCRIPTION varchar(255) null,
    SUCCESSFUL_SUBJECT varchar(255) not null,
    SUCCESSFUL_BODY text null,
    UPDATE_SUBJECT varchar(255) not null,
    UPDATE_BODY text null,
    FAIL_SUBJECT varchar(255) not null,
    FAIL_BODY text null,
    CREATED_BY int not null,
    CREATED_DATE datetime,

    constraint PK_QX_AUTO_REPLY primary key (PKEY),
    constraint FK_AUTO_REPLY_CREATED_BY_QX_USERS foreign key (CREATED_BY) references QX_USERS (PKEY),
)ON [PRIMARY]
go

alter table dbo.QX_ACCOUNT add constraint FK_ACCOUNT_AUTOREPLY_QX_AUTO_REPLY foreign key (AUTOREPLY_ID) references dbo.QX_AUTO_REPLY (PKEY)
go

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