-
Notifications
You must be signed in to change notification settings - Fork 118
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add database migrations #224
Conversation
Codecov Report
@@ Coverage Diff @@
## main #224 +/- ##
==========================================
+ Coverage 23.91% 23.97% +0.05%
==========================================
Files 19 19
Lines 2383 2440 +57
==========================================
+ Hits 570 585 +15
- Misses 1732 1774 +42
Partials 81 81
Flags with carried forward coverage won't be shown. Click here to find out more.
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
That's great! Should this PR also remove |
8d83136
to
467e65a
Compare
there's still some code in database relying on |
the table where the migration status is saved also needs the prefix! currently it's saving into "gorp_migrations", but should be "PREFIX_migrations" |
migrate "github.com/rubenv/sql-migrate" | ||
) | ||
|
||
func GetInitDatabase() *migrate.Migration { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why have a function here at all, instead of just var Migration001InitDatabase = migrate.Migration{...
?
20ea43c
to
ee2e230
Compare
ee2e230
to
c34eab2
Compare
Co-authored-by: Chris Hager <[email protected]>
thank you very much! |
π Summary
Adding database migrations as go files for dynamic table names. Tested with local docker Postgres db.
β± Motivation and Context
Resolves Issue #203
π References
To run:
which automates the migration process. It is placed under the
tool
command for now but happy to move it out to a new command e.g../boost-relay migrate
.β I have run these commands
make lint
make test-race
go mod tidy
CONTRIBUTING.md