function views_update_6000

3.x views.install views_update_6000()
2.x 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 265
Contains install and update functions for Views.

Code

function views_update_6000() {
  if (db_table_exists('views_view')) {
    return;
  }

  // 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('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_schema_initialize($schema, 'views');

  foreach ($schema as $name => $table) {
    db_create_table($name, $table);
  }
}