You are here

function views_install in Views (for Drupal 7) 6.2

Same name and namespace in other branches
  1. 8.3 views.install \views_install()
  2. 5 views.install \views_install()
  3. 6.3 views.install \views_install()
  4. 7.3 views.install \views_install()

Implementation of hook_install().

File

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

Code

function views_install() {
  if ($GLOBALS['db_type'] == 'pgsql') {
    db_query('CREATE OR REPLACE FUNCTION first(anyelement, anyelement) RETURNS anyelement AS \'SELECT COALESCE($1, $2);\' LANGUAGE \'sql\';');
    db_query("DROP AGGREGATE IF EXISTS first(anyelement)");
    db_query("CREATE AGGREGATE first(sfunc = first, basetype = anyelement, stype = anyelement);");
  }
  drupal_install_schema('views');
  db_query("UPDATE {system} SET weight = 10 WHERE name = 'views'");
}