Skip to content
Snippets Groups Projects
Commit cc13fcc3 authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

always validate schema version

parent eddc1706
No related branches found
No related tags found
No related merge requests found
......@@ -17,8 +17,6 @@ class WebMigrateController extends StudipController
parent::before_filter($action, $args);
DBSchemaVersion::validateSchemaVersion();
$this->target = Request::int('target');
$this->branch = Request::get('branch', '0');
$this->version = new DBSchemaVersion('studip', $this->branch);
......
......@@ -53,8 +53,6 @@ if (isset($_SERVER['argv'])) {
}
}
DBSchemaVersion::validateSchemaVersion();
$version = new DBSchemaVersion($domain, $branch);
$migrator = new Migrator($path, $version, $verbose);
......
......@@ -45,6 +45,7 @@ class DBSchemaVersion implements SchemaVersion
$this->domain = $domain;
$this->branch = $branch;
$this->versions = [0];
$this->validateSchemaVersion();
$this->initSchemaInfo();
}
......@@ -158,7 +159,7 @@ class DBSchemaVersion implements SchemaVersion
/**
* Validate correct structure of schema_version table.
*/
public static function validateSchemaVersion()
private function validateSchemaVersion()
{
$db = DBManager::get();
$result = $db->query("SHOW TABLES LIKE 'schema_versions'");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment