/**Begin D:\PDM_UPGRADE\PDM1\BCM_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_TRANSACTIONLOGSET' AND KSQL_COL_NAME IN ('FSEQ')) 
 ALTER TABLE T_BCM_TRANSACTIONLOGSET ADD (FSEQ INT DEFAULT 0 NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_INVRELATION' AND KSQL_COL_NAME IN ('FISDELETE')) 
 ALTER TABLE T_BCM_INVRELATION ADD (FISDELETE CHAR(1) DEFAULT '0' NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BCM_EXPORTURLLIST' AND KSQL_COL_NAME IN ('FFILENAME')) 
 ALTER TABLE T_BCM_EXPORTURLLIST ADD (FFILENAME NVARCHAR(500) DEFAULT ' ' NOT NULL );
 
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_EXPORTURLLIST_L') 
 CREATE TABLE T_BCM_EXPORTURLLIST_L (
FPKID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID NVARCHAR(50) DEFAULT ' ' NOT NULL,
FFILENAME NVARCHAR(500) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BCM_ADJUSTIMPORT')
 CREATE TABLE T_BCM_ADJUSTIMPORT (
FPKID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


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