looshi / mix-checkout

Mix task which runs Ecto migrations when switching branches.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

mix-checkout

Description: Mix task which runs Ecto migrations when switching branches.

Installation: For use in the Phoenix Framework, copy this file to your lib/mix/tasks folder.

Usage: mix checkout branch-name

How it works: Looks in the migrations folder and finds the common ancestor between your current branch and the branch you'd like to checkout. Rolls back the current branch to the common ancestor, then checks out the new branch and migrates forward. If both branches are at the same migration this task will not try to run any rollbacks or migrations.

Why: Useful for projects where the schema changes often and you need to switch back and forth between branches which contain different schemas.

About

Mix task which runs Ecto migrations when switching branches.


Languages

Language:Elixir 100.0%