update_109

Versions
4.6
update_109()

Code

database/updates.inc, line 1887

<?php
function update_109() {
  $ret = array();
  // This is to fix the PostreSQL locales_source table.
  if ($GLOBALS['db_type'] == 'pgsql') {
    $ret[] = update_sql("ALTER TABLE {locales_source} RENAME location TO old_location");
    $ret[] = update_sql("ALTER TABLE {locales_source} ADD COLUMN location text");
    db_query("UPDATE {locales_source} SET location = old_location");
    $ret[] = update_sql("ALTER TABLE {locales_source} ALTER COLUMN location SET NOT NULL");
    $ret[] = update_sql("ALTER TABLE {locales_source} ALTER COLUMN location SET DEFAULT ''");
    $ret[] = update_sql("ALTER TABLE {locales_target} DROP CONSTRAINT {locales_target}_locale_key ");
    $ret[] = update_sql("ALTER TABLE {locales_target} DROP CONSTRAINT {locales_target}_plid_key ");
    $ret[] = update_sql("ALTER TABLE {locales_target} DROP CONSTRAINT {locales_target}_plural_key ");
  }
  return $ret;
}
?>
Login or register to post comments
 
 

All source code and documentation on this site is released under the terms of the GNU General Public License, version 2 and later. Drupal is a registered trademark of Dries Buytaert.