Hi,
Is there a command to drop a specific table in the database and not all of them?
Or a way to update a database table
Thank you.
Hi,
Is there a command to drop a specific table in the database and not all of them?
Or a way to update a database table
Thank you.
Hi Brian,
This can be achieved using migration with following command:-
def self.up
drop_table :table_name
end
Thanks, Anubhaw
Check out the Ruby on Rails Migration Guide. For example, to drop a table in a migration:
class DropProducts < ActiveRecord::Migration
def self.up
drop_table :products
end
def self.down
raise ActiveRecord::IrreversibleMigration
end
end