From 7a089438fa138934b5dab7bdd575a74a1dfd03c0 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Wed, 19 Jun 2019 23:35:56 -0700 Subject: 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 --- changelogs/unreleased/check-min-schema-migrate.yml | 5 +++++ doc/update/upgrading_from_source.md | 2 +- lib/gitlab/database.rb | 4 ++++ lib/tasks/gitlab/db.rake | 4 ++++ spec/tasks/gitlab/db_rake_spec.rb | 7 +++++++ 5 files changed, 21 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/check-min-schema-migrate.yml diff --git a/changelogs/unreleased/check-min-schema-migrate.yml b/changelogs/unreleased/check-min-schema-migrate.yml new file mode 100644 index 00000000000..7c954d31b12 --- /dev/null +++ b/changelogs/unreleased/check-min-schema-migrate.yml @@ -0,0 +1,5 @@ +--- +title: Added a min schema version check to gitlab:db:configure +merge_request: +author: +type: added diff --git a/doc/update/upgrading_from_source.md b/doc/update/upgrading_from_source.md index 023dc7d6de3..e454f4b2c0d 100644 --- a/doc/update/upgrading_from_source.md +++ b/doc/update/upgrading_from_source.md @@ -324,7 +324,7 @@ sudo -u git -H bundle install --deployment --without development test mysql aws sudo -u git -H bundle clean # Run database migrations -sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production +sudo -u git -H bundle exec rake gitlab:db:configure RAILS_ENV=production # Compile GetText PO files diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb index e4d4779ba9a..5e5b79b8e99 100644 --- a/lib/gitlab/database.rb +++ b/lib/gitlab/database.rb @@ -11,6 +11,10 @@ module Gitlab # https://dev.mysql.com/doc/refman/5.7/en/datetime.html MAX_TIMESTAMP_VALUE = Time.at((1 << 31) - 1).freeze + # Minimum schema version from which migrations are be supported + # Migrations before this version may have been removed + MIN_SCHEMA_VERSION = 20190506135400 + def self.config ActiveRecord::Base.configurations[Rails.env] end 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 diff --git a/spec/tasks/gitlab/db_rake_spec.rb b/spec/tasks/gitlab/db_rake_spec.rb index 5818892d56a..f61c03e5cf0 100644 --- a/spec/tasks/gitlab/db_rake_spec.rb +++ b/spec/tasks/gitlab/db_rake_spec.rb @@ -16,6 +16,7 @@ describe 'gitlab:db namespace rake task' do allow(Rake::Task['db:migrate']).to receive(:invoke).and_return(true) allow(Rake::Task['db:schema:load']).to receive(:invoke).and_return(true) allow(Rake::Task['db:seed_fu']).to receive(:invoke).and_return(true) + allow(ActiveRecord::Migrator).to receive(:current_version).and_return(Gitlab::Database::MIN_SCHEMA_VERSION) end describe 'configure' do @@ -27,6 +28,12 @@ describe 'gitlab:db namespace rake task' do expect { run_rake_task('gitlab:db:configure') }.not_to raise_error end + it 'raises an when schema has been loaded, but version is too old to migrate' do + allow(ActiveRecord::Base.connection).to receive(:tables).and_return(%w[table1 table2]) + allow(ActiveRecord::Migrator).to receive(:current_version).and_return(25) + expect { run_rake_task('gitlab:db:configure') }.to raise_error(RuntimeErrorm, /current database version is too old to be migrated/) + end + it 'invokes db:shema:load and db:seed_fu when schema is not loaded' do allow(ActiveRecord::Base.connection).to receive(:tables).and_return([]) expect(Rake::Task['db:schema:load']).to receive(:invoke) -- cgit v1.2.1 From f4e15535198da1d5a655b6abe0afafac47219ab5 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Thu, 20 Jun 2019 07:56:46 -0700 Subject: Move min schema version check to db:migrate Rather than have it checked only as part of gitlab:db:configure, we will instead have it as a pre-req for every db:migrate command --- changelogs/unreleased/check-min-schema-migrate.yml | 2 +- lib/gitlab/database.rb | 1 + lib/tasks/gitlab/db.rake | 4 ---- lib/tasks/migrate/schema_check.rake | 11 +++++++++ spec/tasks/gitlab/db_rake_spec.rb | 2 +- spec/tasks/migrate/schema_check_rake_spec.rb | 27 ++++++++++++++++++++++ 6 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 lib/tasks/migrate/schema_check.rake create mode 100644 spec/tasks/migrate/schema_check_rake_spec.rb diff --git a/changelogs/unreleased/check-min-schema-migrate.yml b/changelogs/unreleased/check-min-schema-migrate.yml index 7c954d31b12..68833733bb8 100644 --- a/changelogs/unreleased/check-min-schema-migrate.yml +++ b/changelogs/unreleased/check-min-schema-migrate.yml @@ -1,5 +1,5 @@ --- title: Added a min schema version check to gitlab:db:configure -merge_request: +merge_request: 29882 author: type: added diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb index 5e5b79b8e99..2fd9250b3c2 100644 --- a/lib/gitlab/database.rb +++ b/lib/gitlab/database.rb @@ -14,6 +14,7 @@ module Gitlab # Minimum schema version from which migrations are be supported # Migrations before this version may have been removed MIN_SCHEMA_VERSION = 20190506135400 + MIN_SCHEMA_GITLAB_VERSION = '11.11.0' def self.config ActiveRecord::Base.configurations[Rails.env] diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index 3a371de5bb7..4e7a8adbef6 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -53,10 +53,6 @@ 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 diff --git a/lib/tasks/migrate/schema_check.rake b/lib/tasks/migrate/schema_check.rake new file mode 100644 index 00000000000..1f2ed2f439c --- /dev/null +++ b/lib/tasks/migrate/schema_check.rake @@ -0,0 +1,11 @@ +desc 'Configures the database by running migrate, or by loading the schema and seeding if needed' +task schema_version_check: :environment do + if ActiveRecord::Migrator.current_version < Gitlab::Database::MIN_SCHEMA_VERSION + raise "Your current database version is too old to be migrated. " \ + "You should upgrade to GitLab #{Gitlab::Database::MIN_SCHEMA_GITLAB_VERSION} before moving to this version. " \ + "Please see https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations" + end +end + +# Ensure the check is a pre-requisite when running db:migrate +Rake::Task["db:migrate"].enhance [:schema_version_check] diff --git a/spec/tasks/gitlab/db_rake_spec.rb b/spec/tasks/gitlab/db_rake_spec.rb index f61c03e5cf0..82ebbf9f225 100644 --- a/spec/tasks/gitlab/db_rake_spec.rb +++ b/spec/tasks/gitlab/db_rake_spec.rb @@ -31,7 +31,7 @@ describe 'gitlab:db namespace rake task' do it 'raises an when schema has been loaded, but version is too old to migrate' do allow(ActiveRecord::Base.connection).to receive(:tables).and_return(%w[table1 table2]) allow(ActiveRecord::Migrator).to receive(:current_version).and_return(25) - expect { run_rake_task('gitlab:db:configure') }.to raise_error(RuntimeErrorm, /current database version is too old to be migrated/) + expect { run_rake_task('gitlab:db:configure') }.to raise_error(RuntimeError, /current database version is too old to be migrated/) end it 'invokes db:shema:load and db:seed_fu when schema is not loaded' do diff --git a/spec/tasks/migrate/schema_check_rake_spec.rb b/spec/tasks/migrate/schema_check_rake_spec.rb new file mode 100644 index 00000000000..50aa95488c6 --- /dev/null +++ b/spec/tasks/migrate/schema_check_rake_spec.rb @@ -0,0 +1,27 @@ +require 'spec_helper' +require 'rake' + +describe 'schema_version_check rake task' do + before :all do + Rake.application.rake_require 'active_record/railties/databases' + + # empty task as env is already loaded + Rake::Task.define_task :environment + end + + before do + # Stub out db tasks + allow(ActiveRecord::Tasks::DatabaseTasks).to receive(:migrate).and_return(true) + allow(ActiveRecord::Migrator).to receive(:current_version).and_return(Gitlab::Database::MIN_SCHEMA_VERSION) + end + + it 'raises an error when schema version is too old to migrate' do + allow(ActiveRecord::Migrator).to receive(:current_version).and_return(25) + expect { run_rake_task('db:migrate') }.to raise_error(RuntimeError, /current database version is too old to be migrated/) + end + + def run_rake_task(task_name) + Rake::Task[task_name].reenable + Rake.application.invoke_task task_name + end +end -- cgit v1.2.1 From f4232d848eebcdc709ccec9c2004753accb3f3b5 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Thu, 20 Jun 2019 08:29:09 -0700 Subject: Fix db:migrate for fresh installs --- lib/tasks/migrate/schema_check.rake | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/tasks/migrate/schema_check.rake b/lib/tasks/migrate/schema_check.rake index 1f2ed2f439c..e8505e576a4 100644 --- a/lib/tasks/migrate/schema_check.rake +++ b/lib/tasks/migrate/schema_check.rake @@ -1,6 +1,11 @@ desc 'Configures the database by running migrate, or by loading the schema and seeding if needed' task schema_version_check: :environment do - if ActiveRecord::Migrator.current_version < Gitlab::Database::MIN_SCHEMA_VERSION + schema_version = ActiveRecord::Migrator.current_version + + # Ensure migrations are being run from a supported schema version + # A schema verison of 0 is a fresh db, and should be safe to run migrations + # But a database with existing migrations less than our min version is not + if schema_version > 0 && schema_version < Gitlab::Database::MIN_SCHEMA_VERSION raise "Your current database version is too old to be migrated. " \ "You should upgrade to GitLab #{Gitlab::Database::MIN_SCHEMA_GITLAB_VERSION} before moving to this version. " \ "Please see https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations" -- cgit v1.2.1 From e448124fab59ce562fac5db9d9919d24ac95fba7 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Thu, 20 Jun 2019 08:50:46 -0700 Subject: Add an flag for skipping the schema version check If you chose to use the rollback migration feature on your current version for example, you should still have a way to migrate, being that you are still on a supported migration path. --- .gitlab/ci/rails.gitlab-ci.yml | 2 +- changelogs/unreleased/check-min-schema-migrate.yml | 2 +- lib/tasks/migrate/schema_check.rake | 2 ++ spec/tasks/gitlab/db_rake_spec.rb | 7 ------- spec/tasks/migrate/schema_check_rake_spec.rb | 21 +++++++++++++++++++++ 5 files changed, 25 insertions(+), 9 deletions(-) diff --git a/.gitlab/ci/rails.gitlab-ci.yml b/.gitlab/ci/rails.gitlab-ci.yml index 529a0de696b..2cd40f84ec7 100644 --- a/.gitlab/ci/rails.gitlab-ci.yml +++ b/.gitlab/ci/rails.gitlab-ci.yml @@ -244,7 +244,7 @@ migration:path-pg: extends: .dedicated-no-docs-and-no-qa-pull-cache-job script: - bundle exec rake db:migrate VERSION=20170523121229 - - bundle exec rake db:migrate + - bundle exec rake db:migrate SKIP_SCHEMA_VERSION_CHECK=true dependencies: - setup-test-env diff --git a/changelogs/unreleased/check-min-schema-migrate.yml b/changelogs/unreleased/check-min-schema-migrate.yml index 68833733bb8..d0f4ae1f5d7 100644 --- a/changelogs/unreleased/check-min-schema-migrate.yml +++ b/changelogs/unreleased/check-min-schema-migrate.yml @@ -1,5 +1,5 @@ --- -title: Added a min schema version check to gitlab:db:configure +title: Added a min schema version check to db:migrate merge_request: 29882 author: type: added diff --git a/lib/tasks/migrate/schema_check.rake b/lib/tasks/migrate/schema_check.rake index e8505e576a4..d78599a3759 100644 --- a/lib/tasks/migrate/schema_check.rake +++ b/lib/tasks/migrate/schema_check.rake @@ -1,5 +1,7 @@ desc 'Configures the database by running migrate, or by loading the schema and seeding if needed' task schema_version_check: :environment do + next if ENV['SKIP_SCHEMA_VERSION_CHECK'] + schema_version = ActiveRecord::Migrator.current_version # Ensure migrations are being run from a supported schema version diff --git a/spec/tasks/gitlab/db_rake_spec.rb b/spec/tasks/gitlab/db_rake_spec.rb index 82ebbf9f225..5818892d56a 100644 --- a/spec/tasks/gitlab/db_rake_spec.rb +++ b/spec/tasks/gitlab/db_rake_spec.rb @@ -16,7 +16,6 @@ describe 'gitlab:db namespace rake task' do allow(Rake::Task['db:migrate']).to receive(:invoke).and_return(true) allow(Rake::Task['db:schema:load']).to receive(:invoke).and_return(true) allow(Rake::Task['db:seed_fu']).to receive(:invoke).and_return(true) - allow(ActiveRecord::Migrator).to receive(:current_version).and_return(Gitlab::Database::MIN_SCHEMA_VERSION) end describe 'configure' do @@ -28,12 +27,6 @@ describe 'gitlab:db namespace rake task' do expect { run_rake_task('gitlab:db:configure') }.not_to raise_error end - it 'raises an when schema has been loaded, but version is too old to migrate' do - allow(ActiveRecord::Base.connection).to receive(:tables).and_return(%w[table1 table2]) - allow(ActiveRecord::Migrator).to receive(:current_version).and_return(25) - expect { run_rake_task('gitlab:db:configure') }.to raise_error(RuntimeError, /current database version is too old to be migrated/) - end - it 'invokes db:shema:load and db:seed_fu when schema is not loaded' do allow(ActiveRecord::Base.connection).to receive(:tables).and_return([]) expect(Rake::Task['db:schema:load']).to receive(:invoke) diff --git a/spec/tasks/migrate/schema_check_rake_spec.rb b/spec/tasks/migrate/schema_check_rake_spec.rb index 50aa95488c6..6e308bc603c 100644 --- a/spec/tasks/migrate/schema_check_rake_spec.rb +++ b/spec/tasks/migrate/schema_check_rake_spec.rb @@ -2,8 +2,11 @@ require 'spec_helper' require 'rake' describe 'schema_version_check rake task' do + include StubENV + before :all do Rake.application.rake_require 'active_record/railties/databases' + Rake.application.rake_require 'tasks/migrate/schema_check' # empty task as env is already loaded Rake::Task.define_task :environment @@ -13,6 +16,13 @@ describe 'schema_version_check rake task' do # Stub out db tasks allow(ActiveRecord::Tasks::DatabaseTasks).to receive(:migrate).and_return(true) allow(ActiveRecord::Migrator).to receive(:current_version).and_return(Gitlab::Database::MIN_SCHEMA_VERSION) + + # Ensure our check can re-run each time + Rake::Task[:schema_version_check].reenable + end + + it 'allows migrations on databases meeting the min schema version requirement' do + expect { run_rake_task('db:migrate') }.not_to raise_error end it 'raises an error when schema version is too old to migrate' do @@ -20,6 +30,17 @@ describe 'schema_version_check rake task' do expect { run_rake_task('db:migrate') }.to raise_error(RuntimeError, /current database version is too old to be migrated/) end + it 'skips running validation when passed the skip env variable' do + stub_env('SKIP_SCHEMA_VERSION_CHECK', 'true') + allow(ActiveRecord::Migrator).to receive(:current_version).and_return(25) + expect { run_rake_task('db:migrate') }.not_to raise_error + end + + it 'allows migrations on fresh databases' do + allow(ActiveRecord::Migrator).to receive(:current_version).and_return(0) + expect { run_rake_task('db:migrate') }.not_to raise_error + end + def run_rake_task(task_name) Rake::Task[task_name].reenable Rake.application.invoke_task task_name -- cgit v1.2.1 From e1befc9b3f4d24dc1d4f5108658725af5244ac67 Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Thu, 20 Jun 2019 09:42:25 -0700 Subject: Drop the source upgrade change We no longer need to point people away from using db:migrate --- doc/update/upgrading_from_source.md | 2 +- lib/tasks/migrate/schema_check.rake | 2 ++ spec/tasks/gitlab/uploads/check_rake_spec.rb | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/doc/update/upgrading_from_source.md b/doc/update/upgrading_from_source.md index e454f4b2c0d..023dc7d6de3 100644 --- a/doc/update/upgrading_from_source.md +++ b/doc/update/upgrading_from_source.md @@ -324,7 +324,7 @@ sudo -u git -H bundle install --deployment --without development test mysql aws sudo -u git -H bundle clean # Run database migrations -sudo -u git -H bundle exec rake gitlab:db:configure RAILS_ENV=production +sudo -u git -H bundle exec rake db:migrate RAILS_ENV=production # Compile GetText PO files diff --git a/lib/tasks/migrate/schema_check.rake b/lib/tasks/migrate/schema_check.rake index d78599a3759..ea4131d8bc2 100644 --- a/lib/tasks/migrate/schema_check.rake +++ b/lib/tasks/migrate/schema_check.rake @@ -1,3 +1,5 @@ +# frozen_string_literal: true + desc 'Configures the database by running migrate, or by loading the schema and seeding if needed' task schema_version_check: :environment do next if ENV['SKIP_SCHEMA_VERSION_CHECK'] diff --git a/spec/tasks/gitlab/uploads/check_rake_spec.rb b/spec/tasks/gitlab/uploads/check_rake_spec.rb index 5d597c66133..91f0cedb246 100644 --- a/spec/tasks/gitlab/uploads/check_rake_spec.rb +++ b/spec/tasks/gitlab/uploads/check_rake_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'rake_helper' describe 'gitlab:uploads rake tasks' do -- cgit v1.2.1 From e793f96c2b684fb8e224eef509bcc7cb8b8d94af Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Thu, 20 Jun 2019 10:02:42 -0700 Subject: Add the frozen literal to the correct file --- spec/tasks/gitlab/uploads/check_rake_spec.rb | 2 -- spec/tasks/migrate/schema_check_rake_spec.rb | 2 ++ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/tasks/gitlab/uploads/check_rake_spec.rb b/spec/tasks/gitlab/uploads/check_rake_spec.rb index 91f0cedb246..5d597c66133 100644 --- a/spec/tasks/gitlab/uploads/check_rake_spec.rb +++ b/spec/tasks/gitlab/uploads/check_rake_spec.rb @@ -1,5 +1,3 @@ -# frozen_string_literal: true - require 'rake_helper' describe 'gitlab:uploads rake tasks' do diff --git a/spec/tasks/migrate/schema_check_rake_spec.rb b/spec/tasks/migrate/schema_check_rake_spec.rb index 6e308bc603c..a7277ab497e 100644 --- a/spec/tasks/migrate/schema_check_rake_spec.rb +++ b/spec/tasks/migrate/schema_check_rake_spec.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'spec_helper' require 'rake' -- cgit v1.2.1 From de93bf1fbbd091075ef7ebafb2ab9dabc2e6563c Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Tue, 25 Jun 2019 10:28:18 -0700 Subject: Update comments and docs around min schema version Fixed some spelling Dropped rake task description for a prefix only task Added note on skipping the check to the postgres debugging dev doc --- doc/development/database_debugging.md | 18 ++++++++++++++++++ lib/gitlab/database.rb | 2 +- lib/tasks/migrate/schema_check.rake | 2 +- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/doc/development/database_debugging.md b/doc/development/database_debugging.md index 68d33a9d8e0..de2c5b43411 100644 --- a/doc/development/database_debugging.md +++ b/doc/development/database_debugging.md @@ -85,3 +85,21 @@ eric 37709 0.0 0.0 2518640 7524 s006 S Wed11AM 0:00.79 s $ kill 87304 $ kill 37709 ``` + +### db:migrate `database version is too old to be migrated` error + +Users receive this error when `db:migrate` detects that the current schema version +is older than the `MIN_SCHEMA_VERSION` defined in the `Gitlab::Database` library +module. + +Over time we cleanup/combine old migrations in the codebase, so it is not always +possible to migrate GitLab from every previous version. + +In some cases you may want to bypass this check. For example, if you were on a version +of GitLab schema later than the `MIN_SCHEMA_VERSION`, and then rolled back the +to an older migration, from before. In this case, in order to migrate forward again, +you should set the `SKIP_SCHEMA_VERSION_CHECK` environment variable. + +```sh +bundle exec rake db:migrate SKIP_SCHEMA_VERSION_CHECK=true +``` diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb index 2fd9250b3c2..7bb4a2c67bf 100644 --- a/lib/gitlab/database.rb +++ b/lib/gitlab/database.rb @@ -11,7 +11,7 @@ module Gitlab # https://dev.mysql.com/doc/refman/5.7/en/datetime.html MAX_TIMESTAMP_VALUE = Time.at((1 << 31) - 1).freeze - # Minimum schema version from which migrations are be supported + # Minimum schema version from which migrations are supported # Migrations before this version may have been removed MIN_SCHEMA_VERSION = 20190506135400 MIN_SCHEMA_GITLAB_VERSION = '11.11.0' diff --git a/lib/tasks/migrate/schema_check.rake b/lib/tasks/migrate/schema_check.rake index ea4131d8bc2..76f1f23c7bd 100644 --- a/lib/tasks/migrate/schema_check.rake +++ b/lib/tasks/migrate/schema_check.rake @@ -1,6 +1,6 @@ # frozen_string_literal: true -desc 'Configures the database by running migrate, or by loading the schema and seeding if needed' +# Configures the database by running migrate, or by loading the schema and seeding if needed task schema_version_check: :environment do next if ENV['SKIP_SCHEMA_VERSION_CHECK'] -- cgit v1.2.1 From af28465556c71428f865d1062bbb3931d7d9daff Mon Sep 17 00:00:00 2001 From: DJ Mountney Date: Fri, 28 Jun 2019 16:28:45 +0000 Subject: Fix extra newline left by conflict resolution --- lib/gitlab/database.rb | 1 - 1 file changed, 1 deletion(-) diff --git a/lib/gitlab/database.rb b/lib/gitlab/database.rb index a9aa0bb36f2..34c1e6ad8ca 100644 --- a/lib/gitlab/database.rb +++ b/lib/gitlab/database.rb @@ -22,7 +22,6 @@ module Gitlab docstring "Time spent in database transactions, in seconds" end - def self.config ActiveRecord::Base.configurations[Rails.env] end -- cgit v1.2.1