README.md: add migration section

This commit is contained in:
Rob Watson 2021-12-04 06:39:29 +01:00
parent 896e524363
commit e9bca62098
1 changed files with 15 additions and 0 deletions

View File

@ -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.