我最近将我的应用程序升级到了Rails4(从Rails3.2)。
但似乎应用程序找不到更多的mysql表,例如一个名为Accidents的表。
在应用程序中,我发现以下错误:
Mysql2::Error: Table 'gms.accidents' doesn't exist: SHOW FULL FIELDS FROM `accidents`好的,看起来这个表不再存在了,然后(看起来是在开发模式下,重置DB没有问题),我在终端rake db:schema:load中运行,但是:
-- create_table("accidents", {:force=>true})
rake aborted!
Mysql2::Error: Tablespace for table '`gms`.`accidents`' exists. Please DISCARD the tablespace before IMPORT.: CREATE TABLE `accidents`
[...]发生了什么?表不存在,但存在??
为什么应用程序找不到更多的表?
发布于 2013-06-30 22:02:09
一种选择(不是修复,但可能会让你继续前进)。
如果这只是一个开发或本地数据库,请手动删除该数据库并更新schema_migrations表,然后使用rake:db migrate从头开始重新创建。
https://stackoverflow.com/questions/17389813
复制相似问题