/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BOS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_PERM_ADMINAPPENTRY', 'T_PERM_ADMINAPPENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERM_ADMINAPP') CREATE INDEX IDX_PERM_ADMINAPP ON T_PERM_ADMINAPPENTRY ( FID ,FENTRYID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERM_ADMINAPP_APPID') CREATE INDEX IDX_PERM_ADMINAPP_APPID ON T_PERM_ADMINAPPENTRY ( FAPPID );


 EXEC P_ALTERPK 'PK_T_PERM_ADMINORGENTRY', 'T_PERM_ADMINORGENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERM_ADMINORG') CREATE INDEX IDX_PERM_ADMINORG ON T_PERM_ADMINORGENTRY ( FID ,FENTRYID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERM_ADMINORG_ORG') CREATE INDEX IDX_PERM_ADMINORG_ORG ON T_PERM_ADMINORGENTRY ( FADMINORGID );



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