百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

capistrano-db-tasks

> 编程语言
开源

为同步远程和本地数据库添加 capistrano 任务

371 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

为同步远程和本地数据库添加 capistrano 任务

CapistranoDbTasks |

Add database AND assets tasks to capistrano to a Rails project. It only works with capistrano 3. Older versions until 0.3 works with capistrano 2.

Currently

  • It only supports mysql and postgresql (both side remote and local)
  • Synchronize assets remote to local and local to remote

Commands mysql, mysqldump (or pg_dump, psql), bzip2 and unbzip2 (or gzip) must be in your PATH

Feel free to fork and to add more database support or new tasks.

Install

Add it as a gem:

ruby
gem "capistrano-db-tasks", require: false

Add to config/deploy.rb:

…

Add to .gitignore

yaml
/db/*.sql

How to install bzip2 on Windows

Available tasks

…

Example

Replace your local database with the production database

This use case allows you to have the same data on your machine as your production. You then can reproduce or test things before to apply to your production.

bash
cap db:pull
cap production db:pull # if you are using capistrano-ext to have multistages

Replace your local database using a dump file stored on your machine

In case you have a dump file on your machine (you used db:pull and kept some files) and you want to replay one of them, you can use the db:local:load:

cap development db:local:load DUMP_FILE=db/myapp_production_2018-01-10-150434.sql

(You have to create a config/deploy/development.rb file containing set :stage, :development at least in order to get this working)

Contributors

  • tilsammans (http://github.com/tilsammansee)
  • bigfive (http://github.com/bigfive)
  • jakemauer (http://github.com/jakemauer)
  • tjoneseng (http://github.com/tjoneseng)
  • numbata (http://github.com/numbata)
  • rafaelsales (http://github.com/rafaelsales)
  • rdeshpande (http://github.com/rdeshpande)

TODO

  • May be change project's name as it's not only database tasks now :)
  • Add tests

Copyright (c) 2009 [Sébastien Gruhier - XILINUS], released under the MIT license

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Ruby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言