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

pretend that old migrations (< 259) are on branch "1"

parent cc13fcc3
No related branches found
No related tags found
No related merge requests found
......@@ -17,6 +17,9 @@ class MigrationsReloaded extends Migration
DROP PRIMARY KEY,
ADD PRIMARY KEY (domain, branch)";
$db->exec($sql);
$sql = "UPDATE schema_version SET branch = '1' WHERE domain = 'studip'";
$db->exec($sql);
}
public function down()
......
......@@ -157,7 +157,8 @@ class DBSchemaVersion implements SchemaVersion
}
/**
* Validate correct structure of schema_version table.
* Validate correct structure of schema_version table. This
* will upgrade the schema from 4.4 style to 5.1 if necessary.
*/
private function validateSchemaVersion()
{
......@@ -170,10 +171,12 @@ class DBSchemaVersion implements SchemaVersion
20201002, 20201103, 202011031, 20210317
];
// drop backported migrations
$query = "DELETE FROM schema_versions
WHERE domain = 'studip' AND version in (?)";
$db->execute($query, [$backported_migrations]);
// drop migrations with irregular numbers
$query = "DELETE FROM schema_versions
WHERE domain = 'studip' AND LENGTH(version) > 8";
$db->exec($query);
......
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