/** 加字段 **/


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTBOTP_SYNCLOG' AND KSQL_COL_NAME ='fsourceoperate')
 ALTER TABLE T_CTBOTP_SYNCLOG ADD (fsourceoperate CHAR(1) DEFAULT '0' NOT NULL );


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTBOTP_GSYNCLOG' AND KSQL_COL_NAME ='fsourceoperate')
 ALTER TABLE T_CTBOTP_GSYNCLOG ADD (fsourceoperate CHAR(1) DEFAULT '0' NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTBOTP_TSYNCLOG' AND KSQL_COL_NAME ='fsourceoperate')
 ALTER TABLE T_CTBOTP_TSYNCLOG ADD (fsourceoperate CHAR(1) DEFAULT '0' NOT NULL );


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTBOTP_SYNCLOG' AND KSQL_COL_NAME ='frootjobid')
 ALTER TABLE T_CTBOTP_SYNCLOG ADD (frootjobid BIGINT DEFAULT 0 NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTBOTP_GSYNCLOG' AND KSQL_COL_NAME ='frootjobid')
 ALTER TABLE T_CTBOTP_GSYNCLOG ADD (frootjobid BIGINT DEFAULT 0 NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CTBOTP_TSYNCLOG' AND KSQL_COL_NAME ='frootjobid')
 ALTER TABLE T_CTBOTP_TSYNCLOG ADD (frootjobid BIGINT DEFAULT 0 NOT NULL );


/** 加字段 **/

/** 加索引 **/

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_SYNCLOG_ROOTJOBID') CREATE INDEX IDX_CTBOTP_SYNCLOG_ROOTJOBID ON T_CTBOTP_SYNCLOG ( FROOTJOBID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_GSYNCLOG_ROOTJOBID') CREATE INDEX IDX_CTBOTP_GSYNCLOG_ROOTJOBID ON T_CTBOTP_GSYNCLOG ( FROOTJOBID );

  IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_CTBOTP_TSYNCLOG_ROOTJOBID') CREATE INDEX IDX_CTBOTP_TSYNCLOG_ROOTJOBID ON T_CTBOTP_TSYNCLOG ( FROOTJOBID );

/** 加索引 **/
