-
Notifications
You must be signed in to change notification settings - Fork 24
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
Improve bal persist migrate
and refactor test cases
#343
Improve bal persist migrate
and refactor test cases
#343
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #343 +/- ##
==========================================
+ Coverage 84.26% 84.73% +0.46%
==========================================
Files 63 62 -1
Lines 5715 5608 -107
Branches 750 734 -16
==========================================
- Hits 4816 4752 -64
+ Misses 676 640 -36
+ Partials 223 216 -7 ☔ View full report in Codecov by Sentry. |
Refactor migration test assertion to ensure the generated sources are correct. Refactor test cases for more clearer intent. This commit is a WIP and more changes will be added.
This commit adds test cases for first time migration, third time migration, and addition of a new table to the model.
This commit adds support to optionality changes in fields, support for composite primary keys and related tests. Optianality changes are not yet fully tested.
This commit improves migration tool to support more scenarios such as composite primary keys. Some of the existing code were also refactored to improve the readability and maintainability. Tests were added to cover the new scenarios.
0ff19c9
to
ca04358
Compare
persist-cli-tests/src/test/java/io/ballerina/persist/tools/utils/GeneratedSourcesTestUtils.java
Outdated
Show resolved
Hide resolved
...-src/output/tool_test_migrate_5/persist/migrations/20240401060508_secondMigration/script.sql
Show resolved
Hide resolved
...-src/output/tool_test_migrate_3/persist/migrations/20240401060627_secondMigration/script.sql
Show resolved
Hide resolved
persist-cli-tests/src/test/resources/test-src/input/tool_test_migrate_13/Ballerina.toml
Outdated
Show resolved
Hide resolved
...st-src/input/tool_test_migrate_15/persist/migrations/20240329105157_firstMigration/model.bal
Outdated
Show resolved
Hide resolved
...t-src/output/tool_test_migrate_15/persist/migrations/20240329105157_firstMigration/model.bal
Outdated
Show resolved
Hide resolved
...src/output/tool_test_migrate_15/persist/migrations/20240401082915_secondMigration/script.sql
Outdated
Show resolved
Hide resolved
persist-cli/src/main/java/io/ballerina/persist/cmd/Migrate.java
Outdated
Show resolved
Hide resolved
Quality Gate passedIssues Measures |
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
Purpose
This PR is a partial fix for the first issue linked below. This also fixes the issue where changes to optional types are not migrated correctly.
Fixes:
Checklist