/**Begin D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_BDM_GOODS_INFO_L') 
 CREATE TABLE T_BDM_GOODS_INFO_L (
FID BIGINT DEFAULT 0 NOT NULL,
FPKID VARCHAR(36) DEFAULT ' ' NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FGOODSNAME NVARCHAR(200) DEFAULT ' ' NOT NULL
);

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_GOODS_INFO' AND KSQL_COL_NAME ='FMASTERID') 
 ALTER TABLE T_BDM_GOODS_INFO ADD (FMASTERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_GOODS_INFO' AND KSQL_COL_NAME ='FSTATUS') 
 ALTER TABLE T_BDM_GOODS_INFO ADD (FSTATUS VARCHAR(30) DEFAULT 'C' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_GOODS_INFO' AND KSQL_COL_NAME ='FCTRLSTRATEGY') 
 ALTER TABLE T_BDM_GOODS_INFO ADD (FCTRLSTRATEGY VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_GOODS_INFO' AND KSQL_COL_NAME ='FUSEORG') 
 ALTER TABLE T_BDM_GOODS_INFO ADD (FUSEORG BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_GOODS_INFO' AND KSQL_COL_NAME ='FSOURCEDATAID') 
 ALTER TABLE T_BDM_GOODS_INFO ADD (FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_GOODS_INFO' AND KSQL_COL_NAME ='FBITINDEX') 
 ALTER TABLE T_BDM_GOODS_INFO ADD (FBITINDEX BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_GOODS_INFO' AND KSQL_COL_NAME ='FSOURCEBITINDEX') 
 ALTER TABLE T_BDM_GOODS_INFO ADD (FSOURCEBITINDEX BIGINT DEFAULT 0 NOT NULL );

/**End D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\BDM_table.sql **/
