function views_update_6000

Same name in other branches
  1. 7.x-3.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 245

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;
}