Skip to content
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: correct index syncing #18262

Merged
merged 3 commits into from
Oct 6, 2022
Merged

Conversation

ankush
Copy link
Member

@ankush ankush commented Sep 30, 2022

The implementation of syncing unique and non-unique index depended on
index names which used to be different before because of that there's
tendency to incorrectly identify index.

This PR adds a separate util for checking if a column has index without
relying on naming convention. It just goes and checks if there's any
index with that column in it, hence far more reliable.

Caused by #15680

PS: This also fixes issue where columns having search + unique index were not dropped automatically.

@github-actions github-actions bot added the add-test-cases Add test case to validate fix or enhancement label Sep 30, 2022
@codecov
Copy link

codecov bot commented Sep 30, 2022

Codecov Report

Merging #18262 (1d8f58c) into develop (d597acb) will decrease coverage by 0.16%.
The diff coverage is 64.70%.

❗ Current head 1d8f58c differs from pull request most recent head da561c2. Consider uploading reports for the commit da561c2 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #18262      +/-   ##
===========================================
- Coverage    62.68%   62.51%   -0.17%     
===========================================
  Files          746      744       -2     
  Lines        67327    67717     +390     
  Branches      5965     5962       -3     
===========================================
+ Hits         42206    42336     +130     
- Misses       21630    21852     +222     
- Partials      3491     3529      +38     
Flag Coverage Δ
server-mariadb 66.86% <94.73%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

The implementation of syncing unique and non-unique index depended on
index names which used to be different before because of that there's
tendency to incorrectly identify index.

This PR adds a separate util for checking if a column has index without
relying on naming convention. It just goes and checks if there's any
index with that column in it, hence far more reliable.
@ankush ankush marked this pull request as ready for review October 6, 2022 05:53
@ankush ankush requested a review from a team as a code owner October 6, 2022 05:53
@ankush ankush requested review from phot0n and removed request for a team October 6, 2022 05:53
@ankush ankush added backport version-14-hotfix backport to version 14 and removed add-test-cases Add test case to validate fix or enhancement labels Oct 6, 2022
@ankush ankush merged commit 6ed3ce5 into frappe:develop Oct 6, 2022
1 check passed
@ankush ankush deleted the indexing_validation branch October 6, 2022 06:08
ankush added a commit that referenced this pull request Oct 6, 2022
…-18262

fix: correct index syncing (backport #18262)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 21, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants