/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\HDM_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FAFFRECORDID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FAFFRECORDID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FAFFACTIONID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FAFFACTIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FLABORRELTYPEID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FLABORRELTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FLABORRELSTATUSID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FLABORRELSTATUSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FPOSTYPEID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FPOSTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FPOSSTATUSID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FPOSSTATUSID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FPARTPERSONID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FPARTPERSONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FAPOSITIONTYPE')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FAPOSITIONTYPE VARCHAR(2) DEFAULT '  ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FASTDPOSITIONID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FASTDPOSITIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FCMPEMPID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FCMPEMPID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FPOSITIONTYPE')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FPOSITIONTYPE VARCHAR(2) DEFAULT '  ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FSTDPOSITIONID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FSTDPOSITIONID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FASUPERIORID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FASUPERIORID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_HDM_PARTTIMEAPPLYBILL_A' AND KSQL_COL_NAME ='FSUPERIORID')
 ALTER TABLE T_HDM_PARTTIMEAPPLYBILL_A ADD (FSUPERIORID BIGINT DEFAULT 0 NOT NULL );

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