Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan-Hendrik Willms
Stud.IP
Commits
6f7e5de6
Commit
6f7e5de6
authored
3 years ago
by
Elmar Ludwig
Browse files
Options
Downloads
Patches
Plain Diff
pretend that old migrations (< 259) are on branch "1"
parent
cc13fcc3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
db/migrations/1.259_migrations_reloaded.php
+3
-0
3 additions, 0 deletions
db/migrations/1.259_migrations_reloaded.php
lib/migrations/DBSchemaVersion.php
+4
-1
4 additions, 1 deletion
lib/migrations/DBSchemaVersion.php
with
7 additions
and
1 deletion
db/migrations/1.259_migrations_reloaded.php
+
3
−
0
View file @
6f7e5de6
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
lib/migrations/DBSchemaVersion.php
+
4
−
1
View file @
6f7e5de6
...
...
@@ -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
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment