You are here

function views_update_6000 in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 6.3 views.install \views_update_6000()
  2. 7.3 views.install \views_update_6000()

Update a site to Drupal 6! Contains a bit of special code to detect if you've been running a beta version or something.

File

./views.install, line 244
views.install Contains install and update functions for Views.

Code

function views_update_6000() {
  $ret = array();
  if (db_table_exists('views_view')) {
    return $ret;
  }

  // This has the beneficial effect of wiping out any Views 1 cache at the
  // same time; not wiping that cache could easily cause problems with Views 2.
  if (db_table_exists('cache_views')) {
    db_drop_table($ret, 'cache_views');
  }

  // This is mostly the same as drupal_install_schema, but it forces
  // views_schema_6000() rather than the default views_schema().
  // This is important for processing subsequent table updates.
  $schema = views_schema_6000();
  _drupal_initialize_schema('views', $schema);
  foreach ($schema as $name => $table) {
    db_create_table($ret, $name, $table);
  }
  return $ret;
}