/**Begin C:\Users\rd_zhixiong_w\Downloads\PDM_UPGRADE\PDM1\TM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_TRADE_F' AND KSQL_COL_NAME IN ('FFAR_SELL_CURRENCY_ID')) 
 ALTER TABLE T_TM_TRADE_F ADD (FFAR_SELL_CURRENCY_ID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_TRADE_F' AND KSQL_COL_NAME IN ('FFAR_BUY_CURRENCY_ID')) 
 ALTER TABLE T_TM_TRADE_F ADD (FFAR_BUY_CURRENCY_ID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_TRADE_F' AND KSQL_COL_NAME IN ('FSELL_CURRENCY_ID')) 
 ALTER TABLE T_TM_TRADE_F ADD (FSELL_CURRENCY_ID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_TRADE_F' AND KSQL_COL_NAME IN ('FBUY_CURRENCY_ID')) 
 ALTER TABLE T_TM_TRADE_F ADD (FBUY_CURRENCY_ID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_TRADE_F' AND KSQL_COL_NAME IN ('FFAR_SELL_AMOUNT')) 
 ALTER TABLE T_TM_TRADE_F ADD (FFAR_SELL_AMOUNT DECIMAL(19,6) DEFAULT 0.000000 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_TRADE_F' AND KSQL_COL_NAME IN ('FFAR_BUY_AMOUNT')) 
 ALTER TABLE T_TM_TRADE_F ADD (FFAR_BUY_AMOUNT DECIMAL(19,6) DEFAULT 0.000000 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_TRADE_F' AND KSQL_COL_NAME IN ('FSELL_AMOUNT')) 
 ALTER TABLE T_TM_TRADE_F ADD (FSELL_AMOUNT DECIMAL(19,6) DEFAULT 0.000000 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_TM_TRADE_F' AND KSQL_COL_NAME IN ('FBUY_AMOUNT')) 
 ALTER TABLE T_TM_TRADE_F ADD (FBUY_AMOUNT DECIMAL(19,6) DEFAULT 0.000000 NOT NULL );

/**End C:\Users\rd_zhixiong_w\Downloads\PDM_UPGRADE\PDM1\TM_table.sql **/
