diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-04-21 02:50:22 +0300 |
commit | 9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch) | |
tree | 70467ae3692a0e35e5ea56bcb803eb512a10bedb /lib/tasks/gitlab/db.rake | |
parent | 4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff) |
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'lib/tasks/gitlab/db.rake')
-rw-r--r-- | lib/tasks/gitlab/db.rake | 19 |
1 files changed, 2 insertions, 17 deletions
diff --git a/lib/tasks/gitlab/db.rake b/lib/tasks/gitlab/db.rake index 541a4fc62af..3baf4e7b7c6 100644 --- a/lib/tasks/gitlab/db.rake +++ b/lib/tasks/gitlab/db.rake @@ -80,22 +80,6 @@ namespace :gitlab do end end - desc 'GitLab | DB | Checks if migrations require downtime or not' - task :downtime_check, [:ref] => :environment do |_, args| - abort 'You must specify a Git reference to compare with' unless args[:ref] - - require 'shellwords' - - ref = Shellwords.escape(args[:ref]) - - migrations = `git diff #{ref}.. --diff-filter=A --name-only -- db/migrate`.lines - .map { |file| Rails.root.join(file.strip).to_s } - .select { |file| File.file?(file) } - .select { |file| /\A[0-9]+.*\.rb\z/ =~ File.basename(file) } - - Gitlab::DowntimeCheck.new.check_and_print(migrations) - end - desc 'GitLab | DB | Sets up EE specific database functionality' if Gitlab.ee? @@ -237,7 +221,8 @@ namespace :gitlab do result_file = args[:result_file] || raise("Please specify result_file argument") raise "File exists already, won't overwrite: #{result_file}" if File.exist?(result_file) - verbose_was, ActiveRecord::Migration.verbose = ActiveRecord::Migration.verbose, true + verbose_was = ActiveRecord::Migration.verbose + ActiveRecord::Migration.verbose = true ctx = ActiveRecord::Base.connection.migration_context existing_versions = ctx.get_all_versions.to_set |