/**Begin C:\PDM_UPGRADE\PDM1\MAL_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_MAL_GOODS', 'T_MAL_GOODS', 'FID', '1';

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

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_GOODS_FCLASSID') CREATE INDEX IDX_MAL_GOODS_FCLASSID ON T_MAL_GOODS ( FCLASSID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_GOODS_FBRANDID') CREATE INDEX IDX_MAL_GOODS_FBRANDID ON T_MAL_GOODS ( FBRANDID );


 EXEC P_ALTERPK 'PK_T_MAL_GOODS_L', 'T_MAL_GOODS_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_MAL_GOODS_PRICE', 'T_MAL_GOODS_PRICE', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_GOODS_PRICE_FMAL_FTIME') CREATE INDEX IDX_MAL_GOODS_PRICE_FMAL_FTIME ON T_MAL_GOODS_PRICE ( FMALLGOODSID ,FMODIFYTIME  DESC );


 EXEC P_ALTERPK 'PK_T_MAL_GOODS_STATUS', 'T_MAL_GOODS_STATUS', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_MAL_GOODS_STATUS_FMALID') CREATE INDEX IDX_MAL_GOODS_STATUS_FMALID ON T_MAL_GOODS_STATUS ( FMALLGOODSID );
/**End C:\PDM_UPGRADE\PDM1\MAL_constraint.sql **/
