一、rails 2.3
相关文档:
https://guides.rubyonrails.org/v2.3/
https://guides.rubyonrails.org/v2.3/migrations.html
创建模型:
ruby script/generate model Product name:string description:text
创建独立迁移:
ruby script/generate migration AddPartNumberToProducts
运行迁移:
rake db:migrate VERSION=20080906120000
回滚:
rake db:rollback STEP=3
# db:migrate:redo任务是执行回滚然后再次迁移回来的快捷方式
rake db:migrate:redo STEP=3
特定迁移:
rake db:migrate:up VERSION=20080906120000
评论区