-
-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
feature: introduce flyway as per #1059 #1828
feature: introduce flyway as per #1059 #1828
Conversation
Codecov Report
@@ Coverage Diff @@
## master #1828 +/- ##
============================================
- Coverage 48.33% 48.31% -0.02%
+ Complexity 1915 1913 -2
============================================
Files 394 394
Lines 11680 11680
Branches 1225 1225
============================================
- Hits 5645 5643 -2
Misses 5589 5589
- Partials 446 448 +2
Continue to review full report at Codecov.
|
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.
Looks good! However I think the flyway.locations
values should be corrected, as it doesn't work in my local environment.
Besides, we should also keep those legacy scripts/sql/delta
sql files, since they are useful for old versions of apollo.
@nobodyiam thanks for reviewing, I have committed changes as requested. |
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.
LGTM
Hi @nobodyiam I open this PR as per #1059 , and here is what would change in the future when we update database schemas and how users upgrade it:
mvn -N -Pconfigdb flyway:migrate
andmvn -N -Pportaldb flyway:migrate
to initialize(or upgrade if needed) the database schemaApolloConfigDB
andApolloPortalDB
respectively.If we want to modify the schema, say
ApolloConfigDB
, add a new sql script file with versions on it, likeV1.1.0__make_awesome_modification.sql
under the directoryscripts/db/migration/configdb/
, e.g.scripts/db/migration/configdb/V1.1.0__make_awesome_modification.sql
Users pull the new files and re-run
mvn -N -Pconfigdb flyway:migrate
andmvn -N -Pportaldb flyway:migrate
, all changes will be reflected on the database.If any further changes should be done, please let me know.
Regards.