Sequel.migration do
  up do
    alter_table(:<%= table_name %>) do
      primary_key :id
      <%= migration_data %>

      <% attributes.each do |attribute| %>
        <%= attribute.type %> :<%= attribute.name %>
      <% end %>

      # Uncomment below if timestamps were not included in your original model.
      # DateTime :created_at
      # DateTime :updated_at
    end

    alter_table(:<%= table_name %>) do
      add_index :email,                :unique => true
      add_index :reset_password_token, :unique => true
      # add_index :confirmation_token,   :unique => true
      # add_index :unlock_token,         :unique => true
    end
  end

  down do
    # By default, we don't want to make any assumption about how to roll back a migration when your
    # model already existed. Please edit below which fields you would like to remove in this migration.
    raise ActiveRecord::IrreversibleMigration
  end
end

Sequel.migration do
  up do
    change_table(:<%= table_name %>) do
      primary_key :id
      <%= migration_data %>

      <% attributes.each do |attribute| %>
        <%= attribute.type %> :<%= attribute.name %>
      <% end %>

      # Uncomment below if timestamps were not included in your original model.
      # DateTime :created_at
      # DateTime :updated_at
    end

    alter_table(:<%= table_name %>) do
      add_index :email,                :unique => true
      add_index :reset_password_token, :unique => true
      # add_index :confirmation_token,   :unique => true
      # add_index :unlock_token,         :unique => true
    end
  end

  down do
    # By default, we don't want to make any assumption about how to roll back a migration when your
    # model already existed. Please edit below which fields you would like to remove in this migration.
    raise ActiveRecord::IrreversibleMigration
  end
end

Use change_table in existing migration
Use change_table in existing migration
