/**Begin C:\Users\rd_zhenhui_chen\Documents\PDM\PDM_UPGRADE\pdm_new\BOS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_SEC_GRAYAPPUSERGROUP', 'T_SEC_GRAYAPPUSERGROUP', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SEC_GRAYAPPUSERGROUP_FK') CREATE INDEX IDX_SEC_GRAYAPPUSERGROUP_FK ON T_SEC_GRAYAPPUSERGROUP ( FID );


 EXEC P_ALTERPK 'PK_T_SEC_GRAYGROUP', 'T_SEC_GRAYGROUP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'SEC_GRAYGROUP_IDX') CREATE INDEX SEC_GRAYGROUP_IDX ON T_SEC_GRAYGROUP ( FNUMBER ,FNAME );


 EXEC P_ALTERPK 'PK_T_SEC_GRAYGROUP_USER', 'T_SEC_GRAYGROUP_USER', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'SEC_GRAYGROUP_USER_FK') CREATE INDEX SEC_GRAYGROUP_USER_FK ON T_SEC_GRAYGROUP_USER ( FID );



/**End C:\Users\rd_zhenhui_chen\Documents\PDM\PDM_UPGRADE\pdm_new\BOS_constraint.sql **/
