Answers for "rails g migration drop table"

5

how to delete a table in rails

rails g migration DropProducts

class DropProducts < ActiveRecord::Migration
  def change
    drop_table :products
  end
end
Posted by: Guest on February-14-2020
0

rails g migration remove default

change_column_default(:users, :email, nil)
Posted by: Guest on August-11-2020

Browse Popular Code Answers by Language