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

Issues 1888 & 1886: fix broken islandora_core_feature_update_8001 #850

Merged
merged 2 commits into from
Sep 28, 2021
Merged

Issues 1888 & 1886: fix broken islandora_core_feature_update_8001 #850

merged 2 commits into from
Sep 28, 2021

Conversation

seth-shaw-unlv
Copy link

@seth-shaw-unlv seth-shaw-unlv commented Sep 17, 2021

GitHub Issue: Islandora/documentation#1888 & Islandora/documentation#1886

What does this Pull Request do?

I mistakenly added the progress marker to the range's limit parameter when copying values back from a temporary table into the updated file size table. 🤦‍♂️ This broke the migration for any site with more than 1,000 media.

This PR removes that erroneous addition so the limit stays constant, like it supposed to.

Also fixes the undefined $progress variable.

What's new?

Fixes a broken update hook.

How should this be tested?

  • Take an islandora ^8.x-1.0 site (or dev pre-March 2021) with more than 1000 media.
  • Backup your database.
  • composer require islandora/islandora:^2
  • drush updb -y and watch it go boom with a message similar to:
>  [error]  SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1004-1004-0-0-en' for key 'PRIMARY': 
INSERT INTO {media_revision__field_file_size} SELECT o.*
> FROM
> {media_revision__field_file_size_o} o
> ORDER BY o.entity_id ASC, o.revision_id ASC, o.delta ASC
> LIMIT 1500 OFFSET 1000; Array
> (
> )
>  
>  [error]  Update failed: islandora_core_feature_update_8001 
  • Restore your backed-up database
  • Apply the PR
  • drush updb -y again and this time it should complete successfully.

Interested parties

@Islandora/8-x-committers, especially @kayakr

@seth-shaw-unlv seth-shaw-unlv marked this pull request as draft September 17, 2021 17:34
@seth-shaw-unlv seth-shaw-unlv marked this pull request as ready for review September 17, 2021 18:25
@seth-shaw-unlv seth-shaw-unlv changed the title Issue 1888: fix broken islandora_core_feature_update_8001 Issues 1888 & 1886: fix broken islandora_core_feature_update_8001 Sep 17, 2021
@elizoller elizoller self-assigned this Sep 22, 2021
Copy link
Member

@elizoller elizoller left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Success!!

>  [notice] Update started: islandora_core_feature_update_8001
>  [notice] Length of media.field_file_size updated to an unsigned big int
>  [notice] Update completed: islandora_core_feature_update_8001

@elizoller elizoller merged commit 588760b into Islandora:8.x-1.x Sep 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants