/**Begin D:\PDM_UPGRADE\PDM1\HBSS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPRANKSCHEME' AND KSQL_COL_NAME ='FCREATEORGID') 
 ALTER TABLE T_HBSS_CAPRANKSCHEME ADD (FCREATEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPRANKSCHEME' AND KSQL_COL_NAME ='FORGID') 
 ALTER TABLE T_HBSS_CAPRANKSCHEME ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPRANKSCHEME' AND KSQL_COL_NAME ='FUSEORGID') 
 ALTER TABLE T_HBSS_CAPRANKSCHEME ADD (FUSEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPRANKSCHEME' AND KSQL_COL_NAME ='FCTRLSTRATEGY') 
 ALTER TABLE T_HBSS_CAPRANKSCHEME ADD (FCTRLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPRANKSCHEME' AND KSQL_COL_NAME ='FSRCCREATEORGID')
 ALTER TABLE T_HBSS_CAPRANKSCHEME ADD (FSRCCREATEORGID BIGINT DEFAULT 0 NOT NULL );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYGROUP' AND KSQL_COL_NAME ='FCREATEORGID')
 ALTER TABLE T_HBSS_CAPACITYGROUP ADD (FCREATEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYGROUP' AND KSQL_COL_NAME ='FORGID')
 ALTER TABLE T_HBSS_CAPACITYGROUP ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYGROUP' AND KSQL_COL_NAME ='FUSEORGID')
 ALTER TABLE T_HBSS_CAPACITYGROUP ADD (FUSEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYGROUP' AND KSQL_COL_NAME ='FCTRLSTRATEGY')
 ALTER TABLE T_HBSS_CAPACITYGROUP ADD (FCTRLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYGROUP' AND KSQL_COL_NAME ='FSRCCREATEORGID')
 ALTER TABLE T_HBSS_CAPACITYGROUP ADD (FSRCCREATEORGID BIGINT DEFAULT 0 NOT NULL );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYITEM' AND KSQL_COL_NAME ='FCREATEORGID')
 ALTER TABLE T_HBSS_CAPACITYITEM ADD (FCREATEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYITEM' AND KSQL_COL_NAME ='FORGID')
 ALTER TABLE T_HBSS_CAPACITYITEM ADD (FORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYITEM' AND KSQL_COL_NAME ='FUSEORGID')
 ALTER TABLE T_HBSS_CAPACITYITEM ADD (FUSEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYITEM' AND KSQL_COL_NAME ='FCTRLSTRATEGY')
 ALTER TABLE T_HBSS_CAPACITYITEM ADD (FCTRLSTRATEGY VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYITEM' AND KSQL_COL_NAME ='FSRCCREATEORGID') 
 ALTER TABLE T_HBSS_CAPACITYITEM ADD (FSRCCREATEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HBSS_CAPACITYITEM' AND KSQL_COL_NAME ='FVERSIONSOURCE') 
 ALTER TABLE T_HBSS_CAPACITYITEM ADD (FVERSIONSOURCE VARCHAR(2) DEFAULT '1' NOT NULL );

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