Commit 4c607397 authored by Jan Provaznik's avatar Jan Provaznik

Add version migration support to rails 4

When switching to rails 5, we added migration version to all migration
classes. This patch makes it possible to run versioned migrations
also with rails 4
parent 2e3dab38
......@@ -26,6 +26,9 @@ module Gitlab
# setting disabled
require_dependency Rails.root.join('lib/mysql_zero_date')
# This can be removed when we drop support for rails 4
require_dependency Rails.root.join('lib/rails4_migration_version')
# Settings in config/environments/* take precedence over those specified here.
# Application configuration should go into files in config/initializers
# -- all .rb files in that directory are automatically loaded.
......
# rubocop:disable Naming/FileName
# frozen_string_literal: true
# When switching to rails 5, we added migration version to all migration
# classes. This patch makes it possible to run versioned migrations
# also with rails 4
unless Gitlab.rails5?
module ActiveRecord
class Migration
def self.[](version)
Migration
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment