mix belay.migrate (Belay v2.0.0)

Copy Markdown View Source

Create or update Belay's tables (idempotent):

mix belay.migrate --url postgres://localhost/my_app

The URL may also come from the DATABASE_URL or BELAY_URL environment variables. Pass --create to create the database first if it does not exist yet.

Migrations take a transaction-scoped advisory lock, so several nodes may run this concurrently during a deploy. This is the same work Belay.Storage.Postgres.migrate!/1 does — use whichever fits your release process.