-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Don't create cards_abiduri it if already exists #31221
Conversation
3abd033
to
f2a0614
Compare
foreach ($table->getIndexes() as $index) { | ||
if ($index->getColumns() === ['addressbookid', 'uri']) { | ||
$table->renameIndex('addressbookid_uri_index', 'cards_abiduri'); | ||
} | ||
} |
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.
@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.
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.
Oups, @juliushaertl
/rebase |
Signed-off-by: Louis Chemineau <louis@chmn.me>
f2a0614
to
970fb7c
Compare
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.
👍
/backport to stable23 |
During migration from ownCloud, the
cards_abiduri
index is created but theaddressbookid_uri_index
index 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_abiduri
index if it already exists and that theaddressbookid_uri_index
index is properly deleted.Handy script to test the migration. Use it from a nextcloud root directory containing the migration.