/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\POM_table.sql **/

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSWSENTRY' AND KSQL_COL_NAME ='FBILLNO')
 ALTER TABLE T_POM_MROSWSENTRY ADD (FBILLNO NVARCHAR(30) DEFAULT ' ' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSWSENTRY' AND KSQL_COL_NAME ='FBILLSTATUS')
 ALTER TABLE T_POM_MROSWSENTRY ADD (FBILLSTATUS NVARCHAR(1) DEFAULT '' NOT NULL );


IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSWSENTRY' AND KSQL_COL_NAME ='FCREATORID')
 ALTER TABLE T_POM_MROSWSENTRY ADD (FCREATORID BIGINT DEFAULT 0 NOT NULL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSWSENTRY' AND KSQL_COL_NAME ='FMODIFIERID')
 ALTER TABLE T_POM_MROSWSENTRY ADD (FMODIFIERID BIGINT DEFAULT 0 NOT NULL );


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSWSENTRY' AND KSQL_COL_NAME ='FAUDITORID')
 ALTER TABLE T_POM_MROSWSENTRY ADD (FAUDITORID BIGINT DEFAULT 0 NOT NULL );


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSWSENTRY' AND KSQL_COL_NAME ='FAUDITDATE')
 ALTER TABLE T_POM_MROSWSENTRY ADD (FAUDITDATE DATETIME );


 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSWSENTRY' AND KSQL_COL_NAME ='FMODIFYTIME')
 ALTER TABLE T_POM_MROSWSENTRY ADD (FMODIFYTIME DATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROSWSENTRY' AND KSQL_COL_NAME ='FCREATETIME')
 ALTER TABLE T_POM_MROSWSENTRY ADD (FCREATETIME DATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROORDER' AND KSQL_COL_NAME ='FAPPROVALSTATUS')
 ALTER TABLE T_POM_MROORDER ADD (FAPPROVALSTATUS NVARCHAR(5) DEFAULT '' NOT NULL);

 IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_POM_MROORDERENTRY' AND KSQL_COL_NAME ='FREFWORKCARD')
 ALTER TABLE T_POM_MROORDERENTRY ADD (FREFWORKCARD BIGINT DEFAULT 0 NOT NULL);
/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\POM_table.sql **/
