mirror of
https://github.com/fspc/BikeShed-1.git
synced 2025-04-04 05:33:22 -04:00
16 lines
330 B
Ruby
16 lines
330 B
Ruby
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
|