Question

I want to delete a table in my rails app but i cannot use rollback, because i created this table a long time ago, and i have a LOT of other tables created since that one.

How is supposed to be named a drop table migration file and is there a way to genrate it with rails generate?

Was it helpful?

Solution

Create one more migration to drop the table. The class should have the method

def self.up
  drop_table :table_name
end

Be careful as you will not be able to rollback to get all the data you will lose while dropping the table.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top