update_fix_watchdog_115
./update.php, строка 237
- Версии
- 5
update_fix_watchdog_115()
System update 115 changes the watchdog table, which breaks the update script's ability to use logging. This changes the table appropriately.
This code, including the 'update_watchdog_115_fixed'
variable, may be removed
when update 115 is removed. It is part of the Drupal 4.5 to 4.7 migration.
Код
<?php
function update_fix_watchdog_115() {
if (drupal_get_installed_schema_version('system') < 115 && !variable_get('update_watchdog_115_fixed', FALSE)) {
if ($GLOBALS['db_type'] == 'mysql') {
$ret[] = update_sql("ALTER TABLE {watchdog} ADD severity tinyint(3) unsigned NOT NULL default '0'");
}
else if ($GLOBALS['db_type'] == 'pgsql') {
$ret[] = update_sql('ALTER TABLE {watchdog} ADD severity smallint');
$ret[] = update_sql('UPDATE {watchdog} SET severity = 0');
$ret[] = update_sql('ALTER TABLE {watchdog} ALTER COLUMN severity SET NOT NULL');
$ret[] = update_sql('ALTER TABLE {watchdog} ALTER COLUMN severity SET DEFAULT 0');
}
variable_set('update_watchdog_115_fixed', TRUE);
}
}
?>
Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии