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

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


 EXEC P_ALTERPK 'PK_PUR_COMPCONFIG_L', 'T_PUR_COMPCONFIG_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_COMPENTRY_FJ', 'T_PUR_COMPENTRY_FJ', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_COMPGROUP_L', 'T_PUR_COMPGROUP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_COMPONENT', 'T_PUR_COMPONENT', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_COMPONENT_FCTIME') CREATE INDEX IDX_PUR_COMPONENT_FCTIME ON T_PUR_COMPONENT ( FCREATETIME );


 EXEC P_ALTERPK 'PK_PUR_CONFIGENTRY', 'T_PUR_CONFIGENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_CONFIGENTRY_FID_FSEQ') CREATE INDEX IDX_PUR_CONFIGENTRY_FID_FSEQ ON T_PUR_CONFIGENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_PUR_COMPENTRY', 'T_PUR_COMPENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_COMPENTRY_FID_FSEQ') CREATE INDEX IDX_PUR_COMPENTRY_FID_FSEQ ON T_PUR_COMPENTRY ( FID ,FSEQ );


 EXEC P_ALTERPK 'PK_PUR_COMPGROUP', 'T_PUR_COMPGROUP', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_COMPGROUP_FNUMBER') CREATE INDEX IDX_PUR_COMPGROUP_FNUMBER ON T_PUR_COMPGROUP ( FSTATUS );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUR_COMPGROUP_FCTIME') CREATE INDEX IDX_PUR_COMPGROUP_FCTIME ON T_PUR_COMPGROUP ( FCREATETIME );


 EXEC P_ALTERPK 'PK_PUR_COMPCNENT_L', 'T_PUR_COMPCNENT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_PUR_COMPCONFIG', 'T_PUR_COMPCONFIG', 'FID', '1';

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



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