Right now, the app uses two different libraries to migrate the database and to use as a database client. github.com/golang-migrate is used for migrations, and github.com/go-pg/pg/v9 for a client.
The API should only use one library for both migrations and as a client. Or, at the very least, the API should only make one database connection instead of two.
The improved migration feature should also provide the following functionality:
Only migrate if an existing database isn't present and isn't up to the latest migration
If a database isn't present, it should be possible to migrate up to a specific migration
When migrations are complete, the api should log what migration the database is up to
Right now, the app uses two different libraries to migrate the database and to use as a database client.
github.com/golang-migrate
is used for migrations, andgithub.com/go-pg/pg/v9
for a client.The API should only use one library for both migrations and as a client. Or, at the very least, the API should only make one database connection instead of two.
The improved migration feature should also provide the following functionality: