class ChangeUsersToAllowNull < ActiveRecord::Migration[6.0]
  def up
    change_table :Users, bulk: true do |t|
      t.change :Address1, :string, null: true, limit: 64
      t.change :Address2, :string, null: true, limit: 64
      t.change :City, :string, null: true, limit: 32
      t.change :State, :string, null: true, limit: 32
      t.change :Zip, :string, null: true, limit: 10
      t.change :HomeAddress1, :string, null: true, limit: 64
      t.change :HomeAddress2, :string, null: true, limit: 64
      t.change :HomeCity, :string, null: true, limit: 32
      t.change :HomeState, :string, null: true, limit: 32
      t.change :HomeZip, :string, null: true, limit: 10
    end
  end

  def down
    change_table :Users, bulk: true do |t|
      t.change :Address1, :string, null: false, default: '', limit: 64
      t.change :Address2, :string, null: false, default: '', limit: 64
      t.change :City, :string, null: false, default: '', limit: 32
      t.change :State, :string, null: false, default: '', limit: 32
      t.change :Zip, :string, null: false, default: '', limit: 10
      t.change :HomeAddress1, :string, null: false, default: '', limit: 24
      t.change :HomeAddress2, :string, null: false, default: '', limit: 24
      t.change :HomeCity, :string, null: false, default: '', limit: 24
      t.change :HomeState, :string, null: false, default: '', limit: 24
      t.change :HomeZip, :string, null: false, default: '', limit: 10
    end
  end
end
