Closed olivierobert closed 8 months ago
Apologies for the unclear documentation and the delayed response.
I have written two versions of the readme files: one is located within the backend scope, and the other is for the outer scope.
I'm using golang-migrate/migrate to manage the version control of the database schema, as opposed to manually migrating through GORM's Auto Migration feature.
Therefore, you can follow these steps to perform database migration in outer scope same level as docker-compose.yaml
.
cmd
from brew install golang-migrate
.$MIGRATE_POSTGRESQL_URL
as "postgres://postgres:postgres@localhost:5432/nimble?sslmode=disable"
readme.md
in the outer scope)
migrate -database $MIGRATE_POSTGRESQL_URL -path backend/adapters/db/migrations up
Lastly, I attempted to run the migration command from Docker, but it did not work as expected, and I couldn't find the solution in time.
The README is missing this critical piece of information:
Install migrate cmd from
brew install golang-migrate
.[!Note] Since is it a dependency, it needs to be listed as a pre-requisite in the installation instructions.
Once installed, it worked without any issue:
And I can access the application:
Issue
I cannot use the application yet since the DB migrations have not been run yet 😅
The concern is that the README is rather unclear on how to run the migrations:
https://github.com/rtp-atw/nimble-interview/blob/adc3255cb11f2b27182cb909e52f6919396b73db/backend/README.md?plain=1#L13-L18
Where should I run these? Is there any local package that must be installed? I am currently used the Dockerised version of the application.
I also wonder why not using the auto DB migration of Gorm: https://gorm.io/docs/migration.html#Auto-Migration?