/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\MDL_constraint.sql **/
 EXEC P_ALTERPK 'PK_META_DYNPLUGIN', 'T_META_DYNPLUGIN', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_META_DYNPLUGIN' AND KSQL_INDNAME = 'IDX_META_DYNPLUGIN_METHOD') CREATE INDEX IDX_META_DYNPLUGIN_METHOD ON T_META_DYNPLUGIN ( FEVENTMETHOD );


 EXEC P_ALTERPK 'PK_META_DYNPLUGIN_L', 'T_META_DYNPLUGIN_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_META_DYNPLUGIN_L' AND KSQL_INDNAME = 'IDX_META_DYNPLUGIN_L_ID') CREATE UNIQUE INDEX IDX_META_DYNPLUGIN_L_ID ON T_META_DYNPLUGIN_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_META_DYNPLUGINBIND', 'T_META_DYNPLUGINBIND', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_META_DYNPLUGINBIND' AND KSQL_INDNAME = 'IDX_META_DYNPLUBIND_DYNPLU') CREATE INDEX IDX_META_DYNPLUBIND_DYNPLU ON T_META_DYNPLUGINBIND ( FDYNPLUGINID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_META_DYNPLUGINBIND' AND KSQL_INDNAME = 'IDX_META_DYNPLUBIND_OBJTYPE') CREATE INDEX IDX_META_DYNPLUBIND_OBJTYPE ON T_META_DYNPLUGINBIND ( FOBJECTTYPEID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_META_DYNPLUGINBIND' AND KSQL_INDNAME = 'IDX_META_DYNPLUBIND_OPTKEY') CREATE INDEX IDX_META_DYNPLUBIND_OPTKEY ON T_META_DYNPLUGINBIND ( FOPERATIONKEY );


 EXEC P_ALTERPK 'PK_META_DYNPLUGINBIND_L', 'T_META_DYNPLUGINBIND_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_META_DYNPLUGINBIND_L' AND KSQL_INDNAME = 'IDX_META_DYNPLUGINBIND_L_ID') CREATE UNIQUE INDEX IDX_META_DYNPLUGINBIND_L_ID ON T_META_DYNPLUGINBIND_L ( FID ,FLOCALEID );



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