To remove a database column, you must create a migration:
script/rails g migration RemoveColumns
Then, in the class method self.up, remove the columns:
def self.up remove_column :table_name, :column_name end
You can also add them back to the self.down class method:
def self.down add_column :table_name, :column_name, :type end
Rails Guide for this in more detail.
Jason stewart Oct 16 2018-10-16 12:31
source share