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

 EXEC P_ALTERPK 'PK_T_PERM_CTRLTYPE_L', 'T_PERM_CTRLTYPE_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERM_CTRLTYPE_L') CREATE INDEX IDX_PERM_CTRLTYPE_L ON T_PERM_CTRLTYPE_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_PERM_CTRLTYPE', 'T_PERM_CTRLTYPE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERM_CTRLTYPE') CREATE INDEX IDX_PERM_CTRLTYPE ON T_PERM_CTRLTYPE ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_PERM_OPREXROLE', 'T_PERM_OPREXROLE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERM_OPREXROLE') CREATE INDEX IDX_PERM_OPREXROLE ON T_PERM_OPREXROLE ( FOPERATIONRULEOBJID );


 EXEC P_ALTERPK 'PK_T_PERM_OPREXUSRGRP', 'T_PERM_OPREXUSRGRP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERM_OPREXUSRGRP') CREATE INDEX IDX_PERM_OPREXUSRGRP ON T_PERM_OPREXUSRGRP ( FOPERATIONRULEOBJID );



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