Patch #19233 ยป 0001-irreversible-to-reversible-remove-users-mail.patch
| db/migrate/20150113213922_remove_users_mail.rb | ||
|---|---|---|
| 4 | 4 |
end |
| 5 | 5 | |
| 6 | 6 |
def self.down |
| 7 |
raise IrreversibleMigration |
|
| 7 |
add_column :users, :mail, :string, limit: 60, default: '', null: false |
|
| 8 | ||
| 9 |
EmailAddress.all.each do |a| |
|
| 10 |
a.user.update_attribute :mail, a.address |
|
| 11 |
end |
|
| 8 | 12 |
end |
| 9 | 13 |
end |