/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_CAS_DETAILINFOEXTCFG') 
 CREATE TABLE T_CAS_DETAILINFOEXTCFG (
FCREATER BIGINT DEFAULT 0 NOT NULL,
FEXTFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FTARFIELDNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
FDATATYPE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FBILLTYPE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFIER BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME,
FID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '0' NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\CAS_table.sql **/

/**Begin D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_COREBILL_SETTING_PE' AND KSQL_COL_NAME IN ('FREPBATCHTAG'))
 ALTER TABLE T_CAS_COREBILL_SETTING_PE ADD (FREPBATCHTAG NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_COREBILL_SETTING_QE' AND KSQL_COL_NAME IN ('FREQBATCHBILLFIELDPROP'))
 ALTER TABLE T_CAS_COREBILL_SETTING_QE ADD (FREQBATCHBILLFIELDPROP NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_COREBILL_SETTING' AND KSQL_COL_NAME IN ('FHANDINPUT'))
 ALTER TABLE T_CAS_COREBILL_SETTING ADD (FHANDINPUT CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_COREBILL_SETTING' AND KSQL_COL_NAME IN ('FHANDCLOUD'))
 ALTER TABLE T_CAS_COREBILL_SETTING ADD (FHANDCLOUD NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_COREBILL_SETTING' AND KSQL_COL_NAME IN ('FHANDSERVICENAME'))
 ALTER TABLE T_CAS_COREBILL_SETTING ADD (FHANDSERVICENAME NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_COREBILL_SETTING' AND KSQL_COL_NAME IN ('FHANDMETHODNAME'))
 ALTER TABLE T_CAS_COREBILL_SETTING ADD (FHANDMETHODNAME NVARCHAR(80) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_CAS_COREBILL_SETTING' AND KSQL_COL_NAME IN ('FHANDAPPID'))
 ALTER TABLE T_CAS_COREBILL_SETTING ADD (FHANDAPPID NVARCHAR(50) DEFAULT ' ' NOT NULL );

/**End D:\PDM_UPGRADE\PDM1\CAS_table.sql **/
