/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\IM_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_IM_NEGATIVE_TIP_CF', 'T_IM_NEGATIVE_TIP_CF', 'FID', '1';

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

EXEC P_ALTERPK 'PK_T_SBS_NEGATIVE_TIP_COLS', 'T_SBS_NEGATIVE_TIP_COLS', 'FENTRYID', '1';

IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_SBS_NEGATIVE_TIP_COLS' AND KSQL_INDNAME = 'IDX_SBS_NEGATIVE_TIP_COLS_FK') CREATE INDEX IDX_SBS_NEGATIVE_TIP_COLS_FK ON T_SBS_NEGATIVE_TIP_COLS ( FID );

EXEC P_ALTERPK 'PK_T_IM_NEGATIVE_TIP_CF_L', 'T_IM_NEGATIVE_TIP_CF_L', 'FPKID', '1';

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


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