You are here

function form_builder_update_7002 in Form Builder 7

Same name and namespace in other branches
  1. 7.2 form_builder.install \form_builder_update_7002()

Migrate to ctools_object_cache.

File

./form_builder.install, line 59

Code

function form_builder_update_7002() {
  module_enable(array(
    'ctools',
  ));
  $sql = <<<SQL
INSERT INTO {ctools_object_cache}
  (sid, name, obj, updated, data)
SELECT l.sid, 'form_builder_cache', CONCAT(l.type, ':', l.form_id), l.updated, l.data
FROM {form_builder_cache} l
  LEFT OUTER JOIN {form_builder_cache} r ON l.sid=r.sid AND l.type=r.type AND l.form_id=r.form_id AND l.updated<r.updated
WHERE r.sid IS NULL
SQL;
  db_query($sql);
  db_drop_table('form_builder_cache');
}