Don't create cards_abiduri it if already exists#31221
Merged
Conversation
tcitworld
reviewed
Feb 17, 2022
3abd033 to
f2a0614
Compare
artonge
commented
Feb 17, 2022
Comment on lines
+230
to
270
| foreach ($table->getIndexes() as $index) { | ||
| if ($index->getColumns() === ['addressbookid', 'uri']) { | ||
| $table->renameIndex('addressbookid_uri_index', 'cards_abiduri'); | ||
| } | ||
| } |
Contributor
Author
There was a problem hiding this comment.
@julius, looks like you wrote the code.
Can you tell me why we use a foreach instead of renaming the index directly? I feel like I am missing something.
Contributor
Author
|
/rebase |
Signed-off-by: Louis Chemineau <louis@chmn.me>
f2a0614 to
970fb7c
Compare
Merged
come-nc
approved these changes
Mar 24, 2022
Contributor
Author
|
/backport to stable23 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
During migration from ownCloud, the
cards_abiduriindex is created but theaddressbookid_uri_indexindex is not deleted. This leads to an error in this code path.This PR make sure that we do not try to create the
cards_abiduriindex if it already exists and that theaddressbookid_uri_indexindex is properly deleted.Handy script to test the migration. Use it from a nextcloud root directory containing the migration.