Sqitch is a semi-sane way to manage databases. This module here is all about integrating with the power of Sqitch.
This project has no dependencies :D
You can add this package by adding it to your deps in mix.exs
:
def deps do
[
{:sqitch, "~> 0.1.0", runtime: false, only: [:dev, :test]}
]
end
To alias this guy to your Ecto setup we need to do two things.
-
Tell Sqitch where your sqitch app is located so that we can cd into there and execute commands for you. All options are the same as the
System.cmd/2
function.# config/dev.exs and config/test.exs config :sqitch, :system, into: IO.stream(:stdio, :line), cd: "#{__DIR__}/my_sqitch_app"
-
Now that the sqitch task knows where to look for your sqitch project we can alias it to
ecto.migrate
and make running migrations easier for you.# mix.exs defp aliases do [ "ecto.migrate": "sqitch deploy --target #{Mix.env}", "ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], "ecto.reset": ["ecto.drop", "ecto.setup"] ] end