表不存在:SHOW KEYS

Sil*_*all 2 mysql ruby-on-rails

运行db:migrate时出现此错误

Mysql2::Error: Table 'sample_app_development.microposts' doesn't exist: SHOW KEYS FROM 
`microposts
Run Code Online (Sandbox Code Playgroud)

这是我的迁移

class CreateMicroposts < ActiveRecord::Migration
      def change
        create_table :microposts do |t|
          t.string :content
          t.integer :user_id

          t.timestamps

          add_index :microposts, [:user_id, :created_at]    

        end
      end
    end
Run Code Online (Sandbox Code Playgroud)

我尝试重新启动mysql并删除并重新创建数据库.

jdo*_*doe 8

add_index移出你create_table的街区.