"update" is enough
This commit is contained in:
parent
cf56de1e77
commit
2d7cd2daf4
2
boot.php
2
boot.php
|
@ -702,7 +702,7 @@ function update_db(App $a)
|
||||||
|
|
||||||
// run new update routine
|
// run new update routine
|
||||||
// it update the structure in one call
|
// it update the structure in one call
|
||||||
$retval = DBStructure::updateStructure(false, true);
|
$retval = DBStructure::update(false, true);
|
||||||
if ($retval) {
|
if ($retval) {
|
||||||
DBStructure::updateFail(
|
DBStructure::updateFail(
|
||||||
DB_UPDATE_VERSION,
|
DB_UPDATE_VERSION,
|
||||||
|
|
|
@ -722,7 +722,7 @@ function admin_page_summary(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Config::get('system', 'dbupdate', DB_UPDATE_NOT_CHECKED) == DB_UPDATE_NOT_CHECKED) {
|
if (Config::get('system', 'dbupdate', DB_UPDATE_NOT_CHECKED) == DB_UPDATE_NOT_CHECKED) {
|
||||||
DBStructure::updateStructure(false, true);
|
DBStructure::update(false, true);
|
||||||
}
|
}
|
||||||
if (Config::get('system', 'dbupdate') == DB_UPDATE_FAILED) {
|
if (Config::get('system', 'dbupdate') == DB_UPDATE_FAILED) {
|
||||||
$showwarning = true;
|
$showwarning = true;
|
||||||
|
@ -1385,7 +1385,7 @@ function admin_page_dbsync(App $a)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (($a->argc > 2) && (intval($a->argv[2]) || ($a->argv[2] === 'check'))) {
|
if (($a->argc > 2) && (intval($a->argv[2]) || ($a->argv[2] === 'check'))) {
|
||||||
$retval = DBStructure::updateStructure(false, true);
|
$retval = DBStructure::update(false, true);
|
||||||
if (!$retval) {
|
if (!$retval) {
|
||||||
$o .= sprintf(t("Database structure update %s was successfully applied."), DB_UPDATE_VERSION) . "<br />";
|
$o .= sprintf(t("Database structure update %s was successfully applied."), DB_UPDATE_VERSION) . "<br />";
|
||||||
Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, 'success');
|
Config::set('database', 'dbupdate_' . DB_UPDATE_VERSION, 'success');
|
||||||
|
|
|
@ -536,7 +536,7 @@ function load_database_rem($v, $i) {
|
||||||
}
|
}
|
||||||
|
|
||||||
function load_database() {
|
function load_database() {
|
||||||
$errors = DBStructure::updateStructure(false, true);
|
$errors = DBStructure::update(false, true);
|
||||||
|
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,10 +21,10 @@ unset($db_host, $db_user, $db_pass, $db_data);
|
||||||
if ($_SERVER["argc"] == 2) {
|
if ($_SERVER["argc"] == 2) {
|
||||||
switch ($_SERVER["argv"][1]) {
|
switch ($_SERVER["argv"][1]) {
|
||||||
case "dryrun":
|
case "dryrun":
|
||||||
DBStructure::updateStructure(true, false);
|
DBStructure::update(true, false);
|
||||||
return;
|
return;
|
||||||
case "update":
|
case "update":
|
||||||
DBStructure::updateStructure(true, true);
|
DBStructure::update(true, true);
|
||||||
|
|
||||||
$build = Config::get('system','build');
|
$build = Config::get('system','build');
|
||||||
if (!x($build)) {
|
if (!x($build)) {
|
||||||
|
|
|
@ -182,7 +182,7 @@ class DBStructure {
|
||||||
return t('Errors encountered performing database changes: ').$message.EOL;
|
return t('Errors encountered performing database changes: ').$message.EOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function updateStructure($verbose, $action, $tables = null, $definition = null) {
|
public static function update($verbose, $action, $tables = null, $definition = null) {
|
||||||
if ($action) {
|
if ($action) {
|
||||||
Config::set('system', 'maintenance', 1);
|
Config::set('system', 'maintenance', 1);
|
||||||
Config::set('system', 'maintenance_reason', sprintf(t(': Database update'), DBM::date().' '.date('e')));
|
Config::set('system', 'maintenance_reason', sprintf(t(': Database update'), DBM::date().' '.date('e')));
|
||||||
|
|
Loading…
Reference in New Issue
Block a user