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

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_ISSUE_TITLE' AND KSQL_COL_NAME ='FCREATEORGID') 
 ALTER TABLE T_BDM_INV_ISSUE_TITLE ADD (FCREATEORGID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_ISSUE_TITLE' AND KSQL_COL_NAME ='FSOURCEDATAID') 
 ALTER TABLE T_BDM_INV_ISSUE_TITLE ADD (FSOURCEDATAID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_ISSUE_TITLE' AND KSQL_COL_NAME ='FBITINDEX') 
 ALTER TABLE T_BDM_INV_ISSUE_TITLE ADD (FBITINDEX INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_ISSUE_TITLE' AND KSQL_COL_NAME ='FSOURCEBITINDEX') 
 ALTER TABLE T_BDM_INV_ISSUE_TITLE ADD (FSOURCEBITINDEX INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_ISSUE_TITLE' AND KSQL_COL_NAME ='FCREATORID') 
 ALTER TABLE T_BDM_INV_ISSUE_TITLE ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_ISSUE_TITLE' AND KSQL_COL_NAME ='FMODIFIERID') 
 ALTER TABLE T_BDM_INV_ISSUE_TITLE ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_ISSUE_TITLE' AND KSQL_COL_NAME ='FENABLE') 
 ALTER TABLE T_BDM_INV_ISSUE_TITLE ADD (FENABLE VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_ISSUE_TITLE' AND KSQL_COL_NAME ='FMASTERID') 
 ALTER TABLE T_BDM_INV_ISSUE_TITLE ADD (FMASTERID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_ISSUE_TITLE' AND KSQL_COL_NAME ='FCTRLSTRATEGY') 
 ALTER TABLE T_BDM_INV_ISSUE_TITLE ADD (FCTRLSTRATEGY VARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BDM_INV_ISSUE_TITLE' AND KSQL_COL_NAME ='FUSEORG') 
 ALTER TABLE T_BDM_INV_ISSUE_TITLE ADD (FUSEORG BIGINT DEFAULT 0 NOT NULL );
 
 
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_INV_TITLE_MASTERID') CREATE INDEX IDX_BDM_INV_TITLE_MASTERID ON T_BDM_INV_ISSUE_TITLE ( FMASTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BDM_INV_TITLE_CREATE') CREATE INDEX IDX_BDM_INV_TITLE_CREATE ON T_BDM_INV_ISSUE_TITLE ( FCREATEORGID );

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