Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我的架构有一个无法通过迁移删除的消息表。当我尝试放下桌子时,我得到了PG::Error: ERROR: relation "messages" does not exist. 如果 schema.rb 是您的数据库架构的权威来源,这怎么可能?
PG::Error: ERROR: relation "messages" does not exist
迁移不是这样工作的。它们只是为了从版本 A 到版本 B 而执行的一系列脚本。Rails 通过查看 schema_migrations 表来确定哪个版本是最新的。
要解决您的特定问题,请编辑迁移文件,或创建迁移可以删除的虚拟“消息”表。