You are here

function workflow_update_5 in Workflow 6.2

Same name and namespace in other branches
  1. 5.2 workflow.install \workflow_update_5()
  2. 5 workflow.install \workflow_update_5()
  3. 6 workflow.install \workflow_update_5()

File

./workflow.install, line 213

Code

function workflow_update_5() {
  $ret[] = update_sql("ALTER TABLE {workflow_node} ADD stamp int(10) unsigned AFTER uid");
  $sql = "SELECT MAX(stamp) AS stamp, nid FROM {workflow_node_history} GROUP BY nid";
  $result = db_query($sql);
  while ($row = db_fetch_object($result)) {
    $ret[] = update_sql("UPDATE {workflow_node} SET stamp = {$row->stamp} WHERE nid = {$row->nid}");
  }
  return $ret;
}