-
Notifications
You must be signed in to change notification settings - Fork 409
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
Fix index creation on nested fields #2637
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #2637 +/- ##
==========================================
- Coverage 26.96% 26.95% -0.02%
==========================================
Files 432 432
Lines 21958 21965 +7
==========================================
- Hits 5922 5920 -2
- Misses 15431 15441 +10
+ Partials 605 604 -1
... and 2 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. |
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.
The change itself looks reasonable!
We need to write tests to ensure that everything works correctly.
We have tests for indexes in internal/handlers/pg/pgdb/indexes_test.go
. One option would be to extend TestCreateIndexIfNotExists
test to cover nested fields too. A similar approach to the current one - create an index for a nested field and compare created index definition with expected one.
And also we can add one test case in TestDropIndexes
to ensure that it's possible to drop indexes for nested fields.
Do you any help with it?
added the test |
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.
Great job defining test cases!
Let's introduce table tests for TestCreateIndexIfNotExists
.
Also, could you change the title of the PR, please? The title should start with a verb, shouldn't include the issue number, and should match the change that is made.
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.
Great, now we have table tests!
I left a couple of relatively minor comments, but overall looks good to me!
Head branch was pushed to by a user without write access
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.
Great work, just one tiny comment!
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 to me! Thanks for the contribution.
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
Description
Closes #2606.
Readiness checklist
task all
, and it passed.@FerretDB/core
), Labels, Project and project's Sprint fields.