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

BUG cleanupVersionedOrphans fails if table case needs fixing #139

Closed
1 task done
tractorcow opened this issue Apr 3, 2018 · 1 comment
Closed
1 task done

BUG cleanupVersionedOrphans fails if table case needs fixing #139

tractorcow opened this issue Apr 3, 2018 · 1 comment

Comments

@tractorcow
Copy link
Contributor

tractorcow commented Apr 3, 2018

Affected Version

4.x (all)

Description

When migrating from a database with a SiteTree_versions table, the ORM will rename this to SiteTree_Versions. however, Versioned::cleanupVersionedOrphans() will attempt to run queries on this table, prior to the rename, but it does this using the incorrect case.

On case-sensitive db / filesystems, this will result in a database exception prior to the table getting renamed.

Steps to Reproduce

Install 3.x and dev/build
Update to 4.x and dev/build

Possible solutions

  • Run cleanupVersionedOrphans() after table rename
  • Make cleanupVersionedOrphans act in a case-sensitive fashion (raw queries use real case of table, not desired case).

PRs:

@tractorcow
Copy link
Contributor Author

cc @mateusz thanks for reporting this issue.

tractorcow pushed a commit to open-sausages/silverstripe-versioned that referenced this issue Apr 4, 2018
BUG Fix cleanupVersionedOrphans breaking on table case change
BUG Use single query for deleting orphans for better performance on huge datasets
Fixes silverstripe#139
Fixes silverstripe/silverstripe-framework#7944
tractorcow pushed a commit to open-sausages/silverstripe-versioned that referenced this issue Apr 6, 2018
BUG Fix cleanupVersionedOrphans breaking on table case change
Fixes silverstripe#139
Fixes silverstripe/silverstripe-framework#7944
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants