From 4c6073974c3889f26c99ebfb578a987e86328d7c Mon Sep 17 00:00:00 2001 From: Jan Provaznik Date: Tue, 13 Nov 2018 09:45:10 +0100 Subject: 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 --- lib/rails4_migration_version.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 lib/rails4_migration_version.rb (limited to 'lib') diff --git a/lib/rails4_migration_version.rb b/lib/rails4_migration_version.rb new file mode 100644 index 00000000000..ae48734dfad --- /dev/null +++ b/lib/rails4_migration_version.rb @@ -0,0 +1,16 @@ +# 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 -- cgit v1.2.1