0

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?

Mischa
  • 42,876
  • 8
  • 99
  • 111
LightBox
  • 3,395
  • 4
  • 25
  • 38

1 Answers1

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