Skip to content
This repository has been archived by the owner on Feb 27, 2019. It is now read-only.
/ branchinator Public archive

A simple gem to help you manage database per branch

License

Notifications You must be signed in to change notification settings

pawelniewie/branchinator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Branchinator

Gem Version

Database per branch so you can easily switch between database models.

Works with Rails 4.x and 5.x

How to use

bin/rails db:branch

Will create a new database and load it with seed. It will create .branchinator with db name for each env.

bin/rails db:unbranch

Will remove the database and .branchinator

bin/rails db:branch:reset

Shortcut for branch remove + create.

How to install

Put it into:

group :development, :test do
  gem 'branchinator'
end

In you database.yml put:

development:
  <<: *default
  database: <%= Branchinator.database %>
  
test:
  <<: *default
  database: <%= Branchinator.database %>

Update your .gitingore as well:

echo .branchinator >> .gitignore

Additional configuration

By default database name is taken from application name and looks something like:

awesomeproject_branch_environment

If you want you can change the first part and the separator.

In your database.yml put:

branchinator:
  prefix: awesome-project
  separator: _

About

A simple gem to help you manage database per branch

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages