/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BASE_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BD_PRODGROUP', 'T_BD_PRODGROUP', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_PRODGROUP_L', 'T_BD_PRODGROUP_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_PRODGROUPCONTROL', 'T_BD_PRODGROUPCONTROL', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BD_PRODGROUPCONTROL_L', 'T_BD_PRODGROUPCONTROL_L', 'FPKID', '1';

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



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