/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BAS_DINGDING', 'T_BAS_DINGDING', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_T_BAS_DINGDING_APPKEY') CREATE INDEX IDX_T_BAS_DINGDING_APPKEY ON T_BAS_DINGDING ( FAPPKEY );


 EXEC P_ALTERPK 'PK_T_BAS_DINGDING_L', 'T_BAS_DINGDING_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_WXGZH', 'T_BAS_WXGZH', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_WXGZH_L', 'T_BAS_WXGZH_L', 'FPKID', '1';

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


EXEC p_DropIdx 'idx_bas_assistantdentry_grp', 'T_BAS_ASSISTANTDATAENTRY';
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_BAS_ASSISTANTDENTRY_GRP') CREATE INDEX IDX_BAS_ASSISTANTDENTRY_GRP ON T_BAS_ASSISTANTDATAENTRY ( FGROUPID ,FCREATEORGID );


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