Closed nam1962 closed 1 year ago
Migration:
class DropConsumersTable < ActiveRecord::Migration[7.0]
def up
drop_table :consumers
end
def down
create_table :consumers do |t|
t.integer :command_number
t.string :first_name
t.string :last_name
t.string :email
t.string :phone_number
t.timestamps
end
end
end
If we need to recreate the table in the future, we can rollback the migration using the following command:
$ rails db:rollback
This will execute the down method, recreating the consumers table with the specified columns