IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCDATACHANNEL' AND KSQL_COL_NAME IN ('FCHANNELFACTORYCLASS')) 
 ALTER TABLE T_PUR_SCDATACHANNEL ADD (FCHANNELFACTORYCLASS VARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCDATACHANNEL' AND KSQL_COL_NAME IN ('FPRESET')) 
 ALTER TABLE T_PUR_SCDATACHANNEL ADD (FPRESET CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCDATACHANNEL' AND KSQL_COL_NAME IN ('FISCDATASOURCEID')) 
 ALTER TABLE T_PUR_SCDATACHANNEL ADD (FISCDATASOURCEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCDATACHANNEL' AND KSQL_COL_NAME IN ('FISDEFAULT')) 
 ALTER TABLE T_PUR_SCDATACHANNEL ADD (FISDEFAULT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCDATACHANNEL' AND KSQL_COL_NAME IN ('FJOINTCHANNELTYPEID')) 
 ALTER TABLE T_PUR_SCDATACHANNEL ADD (FJOINTCHANNELTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCDATACHANNEL' AND KSQL_COL_NAME IN ('FJOINTISCTYPE')) 
 ALTER TABLE T_PUR_SCDATACHANNEL ADD (FJOINTISCTYPE VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_PUR_SCDATAHANDLEFAIL' AND KSQL_COL_NAME IN ('FDEFINESCENEID')) 
 ALTER TABLE T_PUR_SCDATAHANDLEFAIL ADD (FDEFINESCENEID VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_DATACHANNELTYPE') 
 CREATE TABLE T_PBD_DATACHANNELTYPE (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FJOINTSYSTEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FJOINTCHANNELFACTORYCLASS VARCHAR(255) DEFAULT ' ' NOT NULL,
FPRESET CHAR(1) DEFAULT '0' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SERVICEDEFINE') 
 CREATE TABLE T_PBD_SERVICEDEFINE (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FSERVICETYPE VARCHAR(80) DEFAULT ' ' NOT NULL,
FIMPLEMENTATION VARCHAR(255) DEFAULT ' ' NOT NULL,
FSERVICEARGSCLASS VARCHAR(255) DEFAULT ' ' NOT NULL,
FCONFIGFORM VARCHAR(80) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_STRATEGYCONFIG') 
 CREATE TABLE T_PBD_STRATEGYCONFIG (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FGROUPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FFILTERFORMULA VARCHAR(512) DEFAULT ' ' NOT NULL,
FFILTERFORMULA_TAG NCLOB,
FFILTERJSON VARCHAR(512) DEFAULT ' ' NOT NULL,
FFILTERJSON_TAG NCLOB,
FPRESET CHAR(1) DEFAULT '0' NOT NULL,
FENABLE CHAR(1) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_EXECUTESCHEME') 
 CREATE TABLE T_PBD_EXECUTESCHEME (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FEXECUTESCENEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FEXECUTESERVICEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FEXECUTECHANNELID VARCHAR(36) DEFAULT ' ' NOT NULL,
FFAILSTRATEGY VARCHAR(50) DEFAULT ' ' NOT NULL,
FJOINTSYSTEMTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FENABLE CHAR(1) DEFAULT '0' NOT NULL,
FPRESET CHAR(1) DEFAULT '0' NOT NULL,
FISV VARCHAR(80) DEFAULT ' ' NOT NULL,
FENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FOPERATEKEY VARCHAR(255) DEFAULT ' ' NOT NULL,
FEXECUTETYPE VARCHAR(120) DEFAULT ' ' NOT NULL,
FEXECUTEINTERFACE VARCHAR(255) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_EXECUTESCHEME_E') 
 CREATE TABLE T_PBD_EXECUTESCHEME_E (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FEXECUTEUSER NVARCHAR(255) DEFAULT ' ' NOT NULL,
FEXECUTETIME DATETIME,
FEXECUTESTAMP BIGINT DEFAULT 0 NOT NULL,
FEXECUTECOUNT BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_EXECUTEENTRY') 
 CREATE TABLE T_PBD_EXECUTEENTRY (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FENTRYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FEXECUTESERVICECONFIG NCLOB,
FSERVICEDESC NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_SCENEDEFINE') 
 CREATE TABLE T_PBD_SCENEDEFINE (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FBIZAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTITYID VARCHAR(36) DEFAULT ' ' NOT NULL,
FPRESET CHAR(1) DEFAULT '0' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_MSERVICECONFIG') 
 CREATE TABLE T_PBD_MSERVICECONFIG (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FBIZCLOUDID VARCHAR(36) DEFAULT ' ' NOT NULL,
FBIZAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FMSERVICEDESC NVARCHAR(512) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PBD_JOINTSCENEPLUGIN') 
 CREATE TABLE T_PBD_JOINTSCENEPLUGIN (
FID VARCHAR(36) DEFAULT ' ' NOT NULL,
FNUMBER NVARCHAR(80) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(512) DEFAULT ' ' NOT NULL,
FPLUGINSCENEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FCHANNELTYPEID VARCHAR(36) DEFAULT ' ' NOT NULL,
FSCENEPLUGINDESC NVARCHAR(512) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);