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

 EXEC P_ALTERPK 'PK_T_META_FIELDS', 'T_META_FIELDS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_META_FIELDS' AND KSQL_INDNAME = 'IDX_T_META_FIELDS') CREATE INDEX IDX_T_META_FIELDS ON T_META_FIELDS ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_META_FIELDS_L', 'T_META_FIELDS_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_META_FIELDSENTRY', 'T_META_FIELDSENTRY', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_META_FIELDSENTRY' AND KSQL_INDNAME = 'IDX_T_META_FIELDSENTRY') CREATE INDEX IDX_T_META_FIELDSENTRY ON T_META_FIELDSENTRY ( FID ,FSEQ );



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