/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\FA_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_FA_BUSY_CHG_RECORD', 'T_FA_BUSY_CHG_RECORD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_BUSY_CHG_RECORD' AND KSQL_INDNAME = 'IDX_FA_BUSY_CHG_RECORD_BILLID') CREATE INDEX IDX_FA_BUSY_CHG_RECORD_BILLID ON T_FA_BUSY_CHG_RECORD ( FBILLID ,FBILLENTITYNAME ,FISDELETE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_BUSY_CHG_RECORD' AND KSQL_INDNAME = 'IDX_FA_BUSY_CHG_RECORD_PERIOD') CREATE INDEX IDX_FA_BUSY_CHG_RECORD_PERIOD ON T_FA_BUSY_CHG_RECORD ( FORGID ,FDEPREUSEID ,FPERIODID ,FISDELETE );

 
 EXEC P_ALTERPK 'PK_T_FA_BUSY_CHG_REC_ENTRY', 'T_FA_BUSY_CHG_REC_ENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_BUSY_CHG_REC_ENTRY' AND KSQL_INDNAME = 'IDX_FA_BUSY_CHG_REC_REALCARDID') CREATE INDEX IDX_FA_BUSY_CHG_REC_REALCARDID ON T_FA_BUSY_CHG_REC_ENTRY ( FREALCARDMASTERID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_BUSY_CHG_REC_ENTRY' AND KSQL_INDNAME = 'IDX_FA_BUSY_CHG_REC_FK') CREATE INDEX IDX_FA_BUSY_CHG_REC_FK ON T_FA_BUSY_CHG_REC_ENTRY ( FID );
 

 EXEC P_ALTERPK 'PK_T_FA_PERIOD_BUSY_CHG', 'T_FA_PERIOD_BUSY_CHG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_FA_PERIOD_BUSY_CHG' AND KSQL_INDNAME = 'IDX_FA_PERIOD_BUSY_CHG') CREATE INDEX IDX_FA_PERIOD_BUSY_CHG ON T_FA_PERIOD_BUSY_CHG ( FORGID ,FDEPREUSEID ,FPERIODID ,FREALCARDMASTERID );



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