Commit 7ea406b2 authored by Carsten  Rose's avatar Carsten Rose
Browse files

Merge branch 'CreatedTableSettingsDuringUpdate' into 'develop'

Fixes #12475 During QFQ update take care that all system tables exist.

See merge request !339
parents b29da985 b1a46b51
Pipeline #5188 passed with stages
in 4 minutes and 1 second
......@@ -81,7 +81,7 @@ QFQ content record
QFQ Form
--------
* Mandatory SIP parameter have to be mentioned in Form.requiredNew and/or Form.requiredEdit.
* Mandatory SIP parameter should to be mentioned in Form.requiredNew and/or Form.requiredEdit.
* If the title of a FormElement isn't descriptive enough, use tooltip, note or extraButtonInfo to explain to a user.
* Every Form should show a descriptive title to identify the task and current record. E.g. Not 'Person' but 'Person: John Doe'.
* Often the length of a pill title if not sufficient, use a tooltip to give a more descriptive hint.
......@@ -156,8 +156,6 @@ class DatabaseUpdate {
$versionInfo[QFQ_VERSION_KEY_FUNCTION_VERSION] = $new;
}
$this->dbUpdateStatements($old, $new);
if (FEATURE_FORM_FILE_SYNC) {
if ($this->db->existTable('Form')) {
// If Form table exists, import all form files so everything is up to date.
......@@ -165,11 +163,11 @@ class DatabaseUpdate {
// create Form table and export all system forms
$this->db->playSqlFile(__DIR__ . '/../../Sql/formEditor.sql');
FormAsFIle::exportAllForms($this->db);
FormAsFile::exportAllForms($this->db);
} else {
// If not, then create Form table and export all system forms
$this->db->playSqlFile(__DIR__ . '/../../Sql/formEditor.sql');
FormAsFIle::exportAllForms($this->db);
FormAsFile::exportAllForms($this->db);
// import form files which existed before the new installation
FormAsFile::importAllForms($this->db, true);
......@@ -178,6 +176,10 @@ class DatabaseUpdate {
$this->db->playSqlFile(__DIR__ . '/../../Sql/formEditor.sql');
}
// Perform dbUpdate only after formEditor.sql has been played:
// in case a new system table has been added between old and new and there is an dbUpdate on the new system table now.
$this->dbUpdateStatements($old, $new);
FormAsFile::importSystemForms($this->db);
Logger::logMessage(date('Y.m.d H:i:s ') . ": Updated from QFQ version '$old' to '$new'", Path::absoluteQfqLogFile());
......@@ -195,7 +197,7 @@ class DatabaseUpdate {
if (version_compare($old, '19.9.0') === -1) {
$this->updateSpecialColumns();
if (FEATURE_FORM_FILE_SYNC) {
FormAsFIle::exportAllForms($this->db);
FormAsFile::exportAllForms($this->db);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment