My schema has a messages table that I can't drop with a migration. When I try to drop the table I get PG::Error: ERROR: relation "messages" does not exist
. How can this be if the schema.rb is the authoritative source for your database schema?
Asked
Active
Viewed 81 times
0
-
1If you drop a table manually (not using migrations) the schema.rb file does not get magically updated. – Mischa Mar 11 '13 at 12:35
-
2along with @mischa said it might be out of sync, you can `bundle exec rake db:schema:dump` to regenerate it. – Doon Mar 11 '13 at 12:36
-
regenerated the schema and the tables were not present. – LightBox Mar 11 '13 at 12:40
1 Answers
1
Migrations don't work that way. They are just a series of scripts that get executed in order to get from version A to version B. Rails determines which version is current by looking at the schema_migrations table.
To solve Your specific problem, either edit the migration file, or create a dummy 'messages' table that the migration can drop.

maniek
- 7,087
- 2
- 20
- 43