Here are some untested proposed update functions for the modules for people who may be upgrading from 5.x to 6.x.

mp_orders.install:

mp_orders_update_6000() {
  $ret = array();
  db_add_index($ret, 'mp_seller_order_statuses', 'order_status', array('order_status'));
  db_add_index($ret, 'mp_seller_order_statuses', 'seller_paid_status', array('seller_paid_status'));
  return $ret;
}

mp_file.install:

n/a

mp_quote.install

n/a

mp_products.install:

mp_products_update_6000() {
  $ret = array();
  db_add_index($ret, 'mp_seller_rates', 'class', array('class'));
  db_add_primary_key($ret, 'mp_seller_rates', array('rid', 'class'));
  return $ret;
}

mp_reports.install

mp_reports_update_6000() {
  $ret = array();
  db_add_index($ret, 'mp_seller_payments', 'uid', array('uid'));
  db_add_index($ret, 'mp_seller_payments', 'status', array('status'));
  db_add_index($ret, 'mp_seller_payments', 'txn_id', array('txn_id'));
  return $ret;
}

If anyone has any suggestions of what else needs updating between 5.x to 6.x or wants to test these, please feel free.

Comments

syndicateStorm’s picture

Looks good at first glance. Thanks Turgrid. Would be nice if we could convince a 5.x user to try it out :-)

fehin’s picture

Can we put it anywhere in the files and do we need to add function in front of each one of them? For example

function mp_orders_update_6000() {
  $ret = array();
  db_add_index($ret, 'mp_seller_order_statuses', 'order_status', array('order_status'));
  db_add_index($ret, 'mp_seller_order_statuses', 'seller_paid_status', array('seller_paid_status'));
  return $ret;
}
syndicateStorm’s picture

Yes, good catch, we need to write "function" before the function.

I'm sure the update function would work anywhere, but it should be at the end of the file.

Any luck getting these to work?