From 4962086d5de9706e796e21c886a3f27e77e749cc Mon Sep 17 00:00:00 2001 From: ian kopke Date: Sun, 11 May 2025 14:05:36 -0400 Subject: [PATCH] added windows migration command using relative paths --- backend/README.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/backend/README.md b/backend/README.md index 2be1044..fbff759 100644 --- a/backend/README.md +++ b/backend/README.md @@ -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