Andrew Lauer Barinov
Andrew Lauer Barinov

Reputation: 5754

Schema file does not reflect table removal migrations

I removed several tables in my Rails database by running rails generate migration RemoveObjects and then ran rake db:migrate to complete the migration, however I am not seeing the change reflected in my schema.rb file.

What else should I do to remove references to these object from that file?

Upvotes: 1

Views: 1551

Answers (2)

Jenny Lang
Jenny Lang

Reputation: 401

This migration will! You probably made a mistake inside the migration itself.

class DropTables < ActiveRecord::Migration
  def up
    drop_table :table_name
  end

  def down
    raise ActiveRecord::IrreversibleMigration
  end
end

Upvotes: 1

Sebi
Sebi

Reputation: 669

Try this :

rake db:schema:dump

Upvotes: 2

Related Questions