Skip to content

Commit

Permalink
fix migration for compatible with redmine_2fa plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
arturtr committed Sep 23, 2016
1 parent 7d597a8 commit 54def94
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions db/migrate/002_add_mobile_phone_to_users.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
class AddMobilePhoneToUsers < ActiveRecord::Migration
def up
add_column :users, :mobile_phone, :string
unless column_exists? :users, :mobile_phone
add_column :users, :mobile_phone, :string
end

end

def down
remove_column :users, :mobile_phone
unless Redmine::Plugin.installed?(:redmine_2fa)
remove_column :users, :mobile_phone
end
end
end

0 comments on commit 54def94

Please sign in to comment.