Examples:
def change
change_table :users do |t|
t.remove :name
end
end
def change
change_table :users do |t|
t.remove :name, type: :string
end
end
def change
create_table :users do |t|
t.string :name
end
end
def change
drop_table :users
end
def change
drop_table :users do |t|
t.string :name
end
end
def change
change_column_default(:suppliers, :qualification, 'new')
end
def change
change_column_default(:posts, :state, from: nil, to: "draft")
end
def change
remove_column(:suppliers, :qualification)
end
def change
remove_column(:suppliers, :qualification, :string)
end
def change
remove_foreign_key :accounts, column: :owner_id
end
def change
remove_foreign_key :accounts, :branches
end
def change
remove_foreign_key :accounts, to_table: :branches
end
def change
change_table :users do |t|
t.remove :name
t.change_default :authorized, 1
t.change :price, :string
end
end
def change
change_table :users do |t|
t.string :name
end
end
def change
remove_columns :users, :name, :email
end
def change
reversible do |dir|
dir.up do
remove_columns :users, :name, :email
end
dir.down do
add_column :users, :name, :string
add_column :users, :email, :string
end
end
end
def change
remove_columns :users, :name, :email, type: :string
end
def change
remove_index :users, name: :index_users_on_email
end
def change
remove_index :users, :email
end
def change
remove_index :users, column: :email
end