/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FA_CARD_VERSION2') 
 CREATE TABLE T_FA_CARD_VERSION2 (
FID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FCARDMASTERID BIGINT DEFAULT 0 NOT NULL,
FBEFREALCARDID BIGINT DEFAULT 0 NOT NULL,
FAFTREALCARDID BIGINT DEFAULT 0 NOT NULL,
FACCOUNTDATE DATETIME,
FVERSIONTIME DATETIME,
FSRCBILLID BIGINT DEFAULT 0 NOT NULL,
FSRCBILLENTITYNAME VARCHAR(30) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_CHANGEBILL' AND KSQL_COL_NAME ='FCHTYPEDETAIL') 
 ALTER TABLE T_FA_CHANGEBILL ADD (FCHTYPEDETAIL CHAR(1) DEFAULT '3' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FA_FUTURE_CHG_FIN_REL' AND KSQL_COL_NAME ='FISDELETED') 
 ALTER TABLE T_FA_FUTURE_CHG_FIN_REL ADD (FISDELETED CHAR(1) DEFAULT '0' NOT NULL );

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