0

I have upgraded recently my app to Rails 4 (from Rails 3.2).

But seems that the app doesn't find anymore some mysql tables, for example a table called Accidents.

In the app I find this error:

Mysql2::Error: Table 'gms.accidents' doesn't exist: SHOW FULL FIELDS FROM `accidents`

Ok, it seems that the table doesn't exists anymore, then (seen that is in dev mode and there is no problem to reset the DB), I run in the terminal rake db:schema:load, but:

-- create_table("accidents", {:force=>true})
rake aborted!
Mysql2::Error: Tablespace for table '`gms`.`accidents`' exists. Please DISCARD the tablespace before IMPORT.: CREATE TABLE `accidents`
[...]

What happened? The table doesn't exists but exists??
Why the app doesn't find anymore some tables?

4

1 回答 1

1

一个选项(不是修复,但可以让您继续前进)。

如果这只是一个开发或本地数据库,请手动删除数据库并更新 schema_migrations 表,然后 rake:db migrate 从头开始​​重新创建。

于 2013-06-30T14:02:08.760 回答