/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BOS_constraint.sql **/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_BC_FROLEID') CREATE INDEX IX_PERM_BC_FROLEID ON T_PERM_BIZROLECOMROLE ( FROLEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_UPD_BIZ_ENT') CREATE INDEX IX_PERM_UPD_BIZ_ENT ON T_PERM_USERPERMDETAIL ( FBIZAPPID ,FENTITYTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_RD_BIZ_ENT') CREATE INDEX IX_PERM_RD_BIZ_ENT ON T_PERM_ROLEPERMDETIAL ( FBIZAPPID ,FENTITYTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_BDP_BIZ_ENT') CREATE INDEX IX_PERM_BDP_BIZ_ENT ON T_PERM_BIZROLEDISPERM ( FBIZAPPID ,FENTITYTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_BP_BIZ_ENT') CREATE INDEX IX_PERM_BP_BIZ_ENT ON T_PERM_BIZROLEPERM ( FBIZAPPID ,FENTITYTYPEID );

EXEC p_DropIdx 'IDX_T_PERM_BIZROLEORG_ROLEORG', 'T_PERM_BIZROLEORG';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_PERM_BIZROLEORG_ROLEORG') CREATE INDEX IDX_T_PERM_BIZROLEORG_ROLEORG ON T_PERM_BIZROLEORG ( FID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_BO_FORGID') CREATE INDEX IX_PERM_BO_FORGID ON T_PERM_BIZROLEORG ( FORGID );


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