mirror of https://github.com/fspc/BikeShed-1.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
330 B
16 lines
330 B
8 years ago
|
class UserEmailCanBeNull < ActiveRecord::Migration
|
||
|
def up
|
||
|
change_table :users do |t|
|
||
|
t.change :email, :string, default: nil, null: true
|
||
|
end
|
||
|
|
||
|
User.where(email: '').update_all(email: nil)
|
||
|
end
|
||
|
|
||
|
def down
|
||
|
change_table :users do |t|
|
||
|
t.change :email, :string, default: '', null: false
|
||
|
end
|
||
|
end
|
||
|
end
|