/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_PAY_PLAN' AND KSQL_COL_NAME ='FENTRYSRCID') 
 ALTER TABLE T_FA_LEASE_PAY_PLAN ADD (FENTRYSRCID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_RENT_SETTLE' AND KSQL_COL_NAME ='FSRCID') 
 ALTER TABLE T_FA_LEASE_RENT_SETTLE ADD (FSRCID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_PAY_RULE' AND KSQL_COL_NAME ='FENTRYSRCID') 
 ALTER TABLE T_FA_LEASE_PAY_RULE ADD (FENTRYSRCID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_CONTRACT_NEW' AND KSQL_COL_NAME ='FBACKTIME') 
 ALTER TABLE T_FA_LEASE_CONTRACT_NEW ADD (FBACKTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_CONTRACT_NEW' AND KSQL_COL_NAME ='FVERSION') 
 ALTER TABLE T_FA_LEASE_CONTRACT_NEW ADD (FVERSION NVARCHAR(50) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_CONTRACT_NEW' AND KSQL_COL_NAME ='FPREVIOUSBACKID') 
 ALTER TABLE T_FA_LEASE_CONTRACT_NEW ADD (FPREVIOUSBACKID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_CONTRACT_NEW' AND KSQL_COL_NAME ='FSETTLESHARESRCID') 
 ALTER TABLE T_FA_LEASE_CONTRACT_NEW ADD (FSETTLESHARESRCID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_LEASE_CONTRACT_NEW' AND KSQL_COL_NAME ='FISBAK') 
 ALTER TABLE T_FA_LEASE_CONTRACT_NEW ADD (FISBAK CHAR(1) DEFAULT '0' NOT NULL );

/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
