`
刘朝雪
  • 浏览: 81030 次
  • 来自: 河北
社区版块
存档分类
最新评论

rake db:回滚/迁移

    博客分类:
  • ruby
 
阅读更多

 

rake db:migrate

命令作用:将所有未实施的迁移任务都实施到目标数据库上。

 

rake db:migrate VERSION=20080906120000

命令作用:撤销迁移任务到指定版本

迁移版本信息可以在所创建库(如elvuel_deployment数据库)下schema_info表中查看到相关记录信息。

 

rake db:migrate VERSION=0

命令作用:将数据库返回到最初状态(即,只有schema_migrations表,其他表都删除)

 

rake db:migrateVERBOSE=false  

命令作用:屏蔽migration的输出  

 

rake db:rollback

命令作用:回滚到最近的一次migration执行的状态  

 

rake db:rollback STEP=3  

命令作用:回滚最近的3次的迁移任务

 

rake db:migrate:redo

命令作用:重做迁移

 

rake db:migrate:redo STEP=3

重新执行前三次 migration

 

分享到:
评论

相关推荐

    stay-connected:连接指标

    连接指标 这是一个跟踪指标的小应用程序。 它使用 Rails + Postgres 并从 ...rake db:create rake db:migrate 从 Twilio 加载数据 foreman run import_calls 检查! foreman run rails s 打开浏览器并转到localh

    ruby创建blog

    6.rake db:migrate //数据迁移 7.Rails console //控制台 2.4.1 :004 > Post => Post (call 'Post.connection' to establish a connection) 2.4.1 :005 > Post.all Post Load (2.2ms) SELECT "posts".* FROM ...

    capistrano-rails-db:Capistrano v3的Rails迁移任务(db

    在终端中运行cap -T deploy:db以获取迁移任务的完整列表: cap deploy:db:abort_if_pending_migrations # Run rake db:abort_if_pending_migrations cap deploy:db:create # Run rake db:create cap deploy:db:...

    Fantastic4:精彩的活动视觉投票应用程序

    会员 陈玉玺倪燕英张耀仁朱千云 关键跟踪器链接开发备忘录常见的 rake 命令rake db:migrate VERSION=20080906120000 运行所需的迁移,直到达到指定的版本rake db:rollback 回滚上次迁移rake db:setup 创建数据库,...

    server_bench:ruby、erlang、elixir 等的台架测试

    服务器_工作台导轨工具为开发设置 rake db:createrake db:migraterake db:seedrails scurl ...3000/api/groupscurl http://localhost:3000/api/groups/1丹药器为开发设置 mix deps.getmix deps.compilemix compileiex -...

    rswag-example:演示如何使用rswag-api,rswag-specs

    设置cp .env.example .envrails db:create db:migraterails server设置Docker docker-compose builddocker-compose updocker-compose run web rake db:create db:migrateopen http://localhost:3000/使用docker ...

    mentoring.io:一个在线社区,指导者可以在其中共享技能并为新开发人员提供指导

    bundle exec rake db:create bundle exec rake db:migrate 启用Github身份验证 在https://github.com/settings/applications/new上创建一个应用程序,其中以http://localhost:3000作为Homepage URL并以...

    mind-app:App desenvolvido no Labs da Digital Innovation OneApp ESPECIALISTA

    rake db:create rake db:migrate rails server 达多斯银行-BD Baixe e instale o PGAdmin: https://www.pgadmin.org/download/ Acesse a interface do postgres: http://127.0.0.1:51669/browser/ 解决方案 Devise...

    PleaseDontDie:用于管理与宠物和植物有关的活动的Web应用程序的存储库

    bin/rake db:create bin/rake db:migrate bin/rake db:seed bin/rails s 完成这些步骤后,Rails服务器应已运行。 保持服务器处于活动状态,然后访问页面(通过端口3000本地)[http://本地主机:3000]。 执照 此...

    post-it:与 Sida Zhou 和 Krish 创建的小组项目

    辛纳特拉Lighthouse Labs 的 Skeleton 由 Sida 修改入门bundle install rake db:drop; rake db:create; rake db:migrate; rake db:seed; shotgun -p 3000 -o 0.0.0.0 在浏览器中访问http://localhost:3000/ ========...

    beat-box:我的步进音序器和Song-Builder应用程序的初始回购

    rake db:create && rake db:migrate && rake db:seed npm install && npm start bundle install && bundle exec rails s http://localhost:3000/ 当前待办事项: 更改音量以显示旋钮 用户保留的定序器模式 多页序列...

    pairing-matrix

    配对矩阵 入门 ...bin/rake db:create bin/rake db:migrate bin/rake db:seed rails s 转到 运行测试 rspec 看板 华夫饼干板: : 赫鲁库 希格斯玻色子 为了推送到heroku,我必须从终端运行rake ass

    restful-rails-development:取自西尔维娅·普格里西(Silvia Puglisi)的同名书

    $ rake db:migrate $ rails s 为了用测试数据(重新)填充表,请运行以下命令: $ rake db:migrate:reset $ rake db:seed 如果一切都按计划进行,我们应该收到JSON字符串: $ curl ...

    api-petal-md

    rake db:migrate rake db:setup rails server API GET localhost:3000 /宠物小精灵 神奇宝贝百科全书 GET localhost:3000 / pokemons / {id} renvoie lepokémonàl'idspécifié GET localhost:3000 / ...

    garage-example:车库的示例博客应用程序

    bundle exec rake db:create db:migrate RAILS_ENV=test bundle exec rake db:create db:migrate bundle exec rspec # All tests should be passed. # Play with local development server. bundle exec rails ...

    tzyz:滕州一中校友会

    开始吧初始化数据库: rake db:migrate:reset && rake db:setup (或bundle exec rake db:migrate:reset && rake db:setup ) 我们将用于缓存,会话和sidekiq。 请安装并在文件中配置redis的配置( config/secrets....

    gistub:内部共享代码段

    git clone git://github.com/seratch/gistub.git -b mastercd gistubbin/bundle installbin/rake db:migratebin/rails s 通过网络浏览器访问http://localhost:3000/ 。现场演示 首页: Ace的丰富编辑器:配置环境...

    podfilter:Podfilter.de Rails应用

    rake db:migrate db:test:prepare bundle exec rspec rake db:seed foreman start # navigate to http://localhost:5000 # sidekiq background worker is also started 如果要在Development中使用omniauth登录,则...

    Midterm-Family-Vault

    bundle exec rake db:drop && bundle exec rake db:create && bundle exec rake db:migrate && bundle exec rake db:seed 运行shotgun -p 3000 -o localhost启动服务器 在浏览器中访问http://localhost:3000/ ...

    kiris:Phate Radio是有关动漫,游戏和流行音乐的实验性互联网广播

    入门如果尚未安装,请在命令提示符处安装Bundler and Rails: $ gem install bundle --no-document $ gem install rails --no-document...测试 $ bundle exec rake db:test:prepare $ bundle exec rake test笔译我们

Global site tag (gtag.js) - Google Analytics