1
0
mirror of https://github.com/meineerde/redmine.git synced 2025-12-19 15:01:14 +00:00

Plugin migration confuses two plugins with similar names (#18685).

git-svn-id: http://svn.redmine.org/redmine/trunk@13768 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2014-12-20 07:27:53 +00:00
parent 30175bf85e
commit c53eb532c2

View File

@ -478,7 +478,7 @@ module Redmine #:nodoc:
# Delete migrations that don't match .. to_i will work because the number comes first # Delete migrations that don't match .. to_i will work because the number comes first
::ActiveRecord::Base.connection.select_values( ::ActiveRecord::Base.connection.select_values(
"SELECT version FROM #{schema_migrations_table_name}" "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
end end
@ -486,7 +486,7 @@ module Redmine #:nodoc:
sm_table = self.class.schema_migrations_table_name sm_table = self.class.schema_migrations_table_name
::ActiveRecord::Base.connection.select_values( ::ActiveRecord::Base.connection.select_values(
"SELECT version FROM #{sm_table}" "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 end
def record_version_state_after_migrating(version) def record_version_state_after_migrating(version)