某次创建 category之后直接迁移数据库了。导致之后写在xxx_creat_category的文件没有用。
试了一下删表的方法。
$ rails destory model category
$ rails g model category
如果现在rake db:migrate会告诉你category已存在。
在xxx_creat_category里面creat_table之前添加:drop_table :categories
并且改好这个文件。之后
$ rake db:migrate
试了一下删表的方法。
$ rails destory model category
$ rails g model category
如果现在rake db:migrate会告诉你category已存在。
在xxx_creat_category里面creat_table之前添加:drop_table :categories
并且改好这个文件。之后
$ rake db:migrate