diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-12-20 07:27:53 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2014-12-20 07:27:53 +0000 |
commit | c53eb532c2545fd26a72e5d6ac2883d410584cc7 (patch) | |
tree | 15dffbe1c6ba19286ccba92973302c6a2acacd2f /lib/redmine/plugin.rb | |
parent | 30175bf85e4d064abcae5ec971bdb9782e7543ac (diff) | |
download | redmine-c53eb532c2545fd26a72e5d6ac2883d410584cc7.tar.gz redmine-c53eb532c2545fd26a72e5d6ac2883d410584cc7.zip |
Plugin migration confuses two plugins with similar names (#18685).
git-svn-id: http://svn.redmine.org/redmine/trunk@13768 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'lib/redmine/plugin.rb')
-rw-r--r-- | lib/redmine/plugin.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/redmine/plugin.rb b/lib/redmine/plugin.rb index 0b0712072..769eaefc2 100644 --- a/lib/redmine/plugin.rb +++ b/lib/redmine/plugin.rb @@ -478,7 +478,7 @@ module Redmine #:nodoc: # Delete migrations that don't match .. to_i will work because the number comes first ::ActiveRecord::Base.connection.select_values( "SELECT version FROM #{schema_migrations_table_name}" - ).delete_if{ |v| v.match(/-#{plugin.id}/) == nil }.map(&:to_i).max || 0 + ).delete_if{ |v| v.match(/-#{plugin.id}$/) == nil }.map(&:to_i).max || 0 end end @@ -486,7 +486,7 @@ module Redmine #:nodoc: sm_table = self.class.schema_migrations_table_name ::ActiveRecord::Base.connection.select_values( "SELECT version FROM #{sm_table}" - ).delete_if{ |v| v.match(/-#{current_plugin.id}/) == nil }.map(&:to_i).sort + ).delete_if{ |v| v.match(/-#{current_plugin.id}$/) == nil }.map(&:to_i).sort end def record_version_state_after_migrating(version) |