]> source.dussan.org Git - redmine.git/commitdiff
Fix "ArgumentError: wrong number of arguments (given 1, expected 2) on Redmine::Plugi...
authorGo MAEDA <maeda@farend.jp>
Thu, 1 Apr 2021 15:02:47 +0000 (15:02 +0000)
committerGo MAEDA <maeda@farend.jp>
Thu, 1 Apr 2021 15:02:47 +0000 (15:02 +0000)
Patch by Pavel Rosický.

git-svn-id: http://svn.redmine.org/redmine/trunk@20888 e93f8b46-1217-0410-a6f0-8f06a7374b81

lib/redmine/plugin.rb

index 0f20a199350abe1a99d0b5efe8f20721c12b4bdd..48d04dcac1a43fbba5936f079b15ec11c6c9f18f 100644 (file)
@@ -539,7 +539,7 @@ module Redmine
           else
             migrations
           end
-        Migrator.new(:up, selected_migrations, target_version).migrate
+        Migrator.new(:up, selected_migrations, schema_migration, target_version).migrate
       end
 
       def down(target_version = nil)
@@ -549,15 +549,15 @@ module Redmine
           else
             migrations
           end
-        Migrator.new(:down, selected_migrations, target_version).migrate
+        Migrator.new(:down, selected_migrations, schema_migration, target_version).migrate
       end
 
       def run(direction, target_version)
-        Migrator.new(direction, migrations, target_version).run
+        Migrator.new(direction, migrations, schema_migration, target_version).run
       end
 
       def open
-        Migrator.new(:up, migrations, nil)
+        Migrator.new(:up, migrations, schema_migration)
       end
     end
 
@@ -571,7 +571,7 @@ module Redmine
           self.current_plugin = plugin
           return if current_version(plugin) == version
 
-          MigrationContext.new(plugin.migration_directory).migrate(version)
+          MigrationContext.new(plugin.migration_directory, ::ActiveRecord::Base.connection.schema_migration).migrate(version)
         end
 
         def get_all_versions(plugin = current_plugin)