markdown RAKE DB迁移命令

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown RAKE DB迁移命令相关的知识,希望对你有一定的参考价值。

* **db:create** creates the database for the current env
* **db:create:all** creates the databases for all envs
* **db:migrate** runs migrations for the current env that have not run yet
* **db:migrate:up** runs one specific migration
* **db:migrate:down** rolls back one specific migration
* **db:migrate:status** shows current migration status
* **db:rollback** rolls back the last migration
* **db:forward** advances the current schema version to the next one
* **db:seed** (only) runs the db/seed.rb file
* **db:schema:load** loads the schema into the current env's database
* **db:schema:dump** dumps the current env's schema (and seems to create the db as well)
* **db:setup** runs db:schema:load, db:seed
* **db:migrate:redo** runs (db:migrate:down db:migrate:up) or (db:rollback db:migrate) depending on the specified migration

## Run specific migration
* **rake db:migrate:up VERSION=20090408054532**
* **rake db:migrate:down VERSION=20090408054532**

以上是关于markdown RAKE DB迁移命令的主要内容,如果未能解决你的问题,请参考以下文章

rake db:如果没有版本,迁移不能正常工作

使用 rake db:migrate 迁移数据不会改变它

rake db:schema:load 与迁移

markdown rake db:createすると访问被拒绝用户が出る

“heroku 运行 rake db:迁移”问题

是否rake db:schema:dump从迁移或数据库本身重新创建schema.rb?