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


EXEC p_DropIdx 'IX_PERM_00000019', 'T_PERM_USERPERMDETAIL';
EXEC p_DropIdx 'IX_PERM_UPD_BIZ_ENT', 'T_PERM_USERPERMDETAIL';
EXEC p_DropIdx 'IDX_PERM_UPDPEB', 'T_PERM_USERPERMDETAIL';

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

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

EXEC p_DropIdx 'IX_PERM_00000018', 'T_PERM_USERPERM';
IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IX_PERM_00000018') CREATE INDEX IX_PERM_00000018 ON T_PERM_USERPERM ( FUSERID ,FORGID ,FDIMTYPE ,FISINCLUDESUBORG );


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