diff options
author | DJ Mountney <david@twkie.net> | 2019-06-19 23:35:56 -0700 |
---|---|---|
committer | DJ Mountney <david@twkie.net> | 2019-06-25 10:44:40 -0700 |
commit | 7a089438fa138934b5dab7bdd575a74a1dfd03c0 (patch) | |
tree | 70adb17a83b29ad3901f3a5b86a7ee7f8a37e383 /lib/tasks | |
parent | 4d1e2ec45e993c8d9ebf3d379b5d1f20d3684658 (diff) | |
download | gitlab-ce-7a089438fa138934b5dab7bdd575a74a1dfd03c0.tar.gz |
Check supported version when migrating
Set the mininum supported migration version to be the schema version as
of 11.11.0, and errors you if that is not detected during
gitlab:db:configure
Diffstat (limited to 'lib/tasks')
-rw-r--r-- | lib/tasks/gitlab/db.rake | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index 4e7a8adbef6..3a371de5bb7 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -53,6 +53,10 @@ namespace :gitlab do # Check if we have existing db tables # The schema_migrations table will still exist if drop_tables was called if ActiveRecord::Base.connection.tables.count > 1 + if ActiveRecord::Migrator.current_version < Gitlab::Database::MIN_SCHEMA_VERSION + raise "Your current database version is too old to be migrated. Please see https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations" + end + Rake::Task['db:migrate'].invoke else # Add post-migrate paths to ensure we mark all migrations as up |