IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PRIVACY_UPGRADE_HISTORY')
 CREATE TABLE T_PRIVACY_UPGRADE_HISTORY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTITYNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FTABLENAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FFIELDNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FDBROUTE VARCHAR(20) DEFAULT ' ' NOT NULL,
FSCHEMATPLID BIGINT DEFAULT 0 NOT NULL,
FTAGTPLID BIGINT DEFAULT 0 NOT NULL,
FDATATYPE CHAR(1) DEFAULT '0' NOT NULL,
FTPLENTRYROWID BIGINT DEFAULT 0 NOT NULL,
FTAGID BIGINT DEFAULT 0 NOT NULL,
FSCHEMAID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FSTATUS CHAR(1) DEFAULT '0' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PRIVACY_UPGRADEPROTOCOL') 
 CREATE TABLE T_PRIVACY_UPGRADEPROTOCOL (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FDATA NCLOB,
FSTATUS CHAR(1) DEFAULT '0' NOT NULL,
FCREATETIME DATETIME DEFAULT GETDATE() NOT NULL
);

