/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\PUR_constraint.sql **/
 EXEC P_ALTERPK 'PK_PUR_REGSUPGOODS_ATT', 'T_PUR_REGSUPGOODS_ATT', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_REGSUPGOODS_ATT_FBDID') CREATE INDEX IDX_REGSUPGOODS_ATT_FBDID ON T_PUR_REGSUPGOODS_ATT ( FBASEDATAID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_REGSUPGOODS_ATT_FENTRYID') CREATE INDEX IDX_REGSUPGOODS_ATT_FENTRYID ON T_PUR_REGSUPGOODS_ATT ( FENTRYID );


 EXEC P_ALTERPK 'PK_T_PUR_SUPCHGENTRY_ATT', 'T_PUR_SUPCHGENTRY_ATT', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INX_SUPCHGENTRY_ATT_FBDID') CREATE INDEX INX_SUPCHGENTRY_ATT_FBDID ON T_PUR_SUPCHGENTRY_ATT ( FBASEDATAID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INX_SUPCHGENTRY_ATT_FENTRYID') CREATE INDEX INX_SUPCHGENTRY_ATT_FENTRYID ON T_PUR_SUPCHGENTRY_ATT ( FENTRYID );


 EXEC P_ALTERPK 'PK_T_PUR_SUPCHGENTRY_CHGATT', 'T_PUR_SUPCHGENTRY_CHGATT', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INX_CHGENTRY_CHGATT_FBDID') CREATE INDEX INX_CHGENTRY_CHGATT_FBDID ON T_PUR_SUPCHGENTRY_CHGATT ( FBASEDATAID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'INX_CHGENTRY_CHGATT_FENTRYID') CREATE INDEX INX_CHGENTRY_CHGATT_FENTRYID ON T_PUR_SUPCHGENTRY_CHGATT ( FENTRYID );


 EXEC P_ALTERPK 'PK_T_PUR_REGSUPCONTRACT_ATT', 'T_PUR_REGSUPCONTRACT_ATT', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'PK_REGSUPCONTRACT_ATT_FBDID') CREATE INDEX PK_REGSUPCONTRACT_ATT_FBDID ON T_PUR_REGSUPCONTRACT_ATT ( FBASEDATAID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'PK_REGSUPCONTRACT_ATT_FENTRYID') CREATE INDEX PK_REGSUPCONTRACT_ATT_FENTRYID ON T_PUR_REGSUPCONTRACT_ATT ( FENTRYID );



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