Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,17 @@
1. Install go (on arch: `pacman -S go`)
2. In the root directory of the repo, run `podman compose up -d`
3. Obtain [golang migrate](https://github.com/golang-migrate/migrate). You may need to download the CLI directly from a release
4. In `backend`, run `migrate -source file://$(pwd)/migrations -database postgres://postgres:test@localhost:5432/postgres?sslmode=disable up`
4. In `backend`, run `migrate -source file://$(pwd)/migrations -database postgres://postgres:test@localhost:5432/postgres?sslmode=disable up`, on windows run `migrate -path ./migrations -database postgres://postgres:test@localhost:5432/postgres?sslmode=disable up`
5. In `backend`, run `go run .`

### Adding new dependencies

`go mod tidy`

### Formatting

`gofmt -w -s .`

### Creating new DB migrations
Create a new file with an incremented prefix number, a human readable string, and ending with `.up.sql`, with a corresponding `.down.sql` that has the same number prefix to revert your change. Apply these with golang-migrate

Create a new file with an incremented prefix number, a human readable string, and ending with `.up.sql`, with a corresponding `.down.sql` that has the same number prefix to revert your change. Apply these with golang-migrate