method
drop_table
drop_table(table_name, **options)
public
Drops a table from the database.
- :force
-
Set to :cascade to drop dependent objects as well. Defaults to false.
- :if_exists
-
Set to true to only drop the table if it exists. Defaults to false.
Although this command ignores most options and the block if one is given, it can be helpful to provide these in a migration’s change method so it can be reverted. In that case, options and the block will be used by #create_table.
Register or
log in
to add new notes.
ivanoats -
April 8, 2009
2 thanks
use create table :force => true
if you want to drop a table before creating one in a migration, use the :force => true option of the create_table method