From e9bca62098cce4da926d878ff8d52e313f72bf87 Mon Sep 17 00:00:00 2001 From: Rob Watson Date: Sat, 4 Dec 2021 06:39:29 +0100 Subject: [PATCH] README.md: add migration section --- README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/README.md b/README.md index 4ffc8ba..edfc138 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,21 @@ cd backend/ sqlc generate ``` +### Migrations + +Database migrations require `golang-migrate`. + +``` +go install -tags 'postgres' github.com/golang-migrate/migrate/v4/cmd/migrate@latest +``` + +Migrations then can be run with: + +``` +cd backend/ +migrate -path sql/migrations -database $DATABASE_URL up +``` + ### Running the app The backend requires configuration via environment variables - see `backend/.env.example`. All variables must be set unless they are marked as optional.