-
-
Notifications
You must be signed in to change notification settings - Fork 224
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
BUGFIX: Fix projection database schema #4847
Conversation
This is a follow-up to #4730 fixing the database schema for binary columns. Without this fix, calling `ProjectionInterface::setUp()` will drop and re-add a lot of columns! Furthermore, this adds a length limit to the `origindimensionspacepointhash` column of the `AssetUsageRepository` (follow-up to #4088) to prevent the index from getting recreated on each set up
This is a draft because it depends on #4845 |
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.
LGTM. Thank you!
ae20335
to
e9d2bdf
Compare
Those are extracted to #4847
Those are extracted to #4847
@@ -73,8 +73,7 @@ private function databaseSchema(): Schema | |||
->addIndex(['originalassetid']) | |||
->addIndex(['contentstreamid']) | |||
->addIndex(['nodeaggregateid']) | |||
->addIndex(['origindimensionspacepointhash']); | |||
; | |||
->addIndex(['origindimensionspacepointhash'], options: ['lengths' => [768]]); |
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.
wait why do we need that much length here?
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.
It's just what the db applied if it was not specified.
I was surprised that the hash column was changed to TEXT
that is basically unbound.. Maybe we can limit the max length in our PHP VOs already to a sensible value. Then we could reduce column and index sizes, too
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.
Good that we talked about it then :) Apparently an oversight on my side, see
https://github.com/neos/neos-development-collection/pull/4847/files/73e4d80eae3d584422c09c0ab5837e81050faf9f#diff-9139cc843ef200a3a9ed44f6f009526aecf42bb03934f02722e2d93e0fb2cc47R66
both ODSP and the hash column use the columnForDimensionSpacePoint
spec, which is clearly wrong for the hash, sorry!
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.
Added a commit to fix it
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.
So with your fix @kitsunet dc6c9e1 should bastis be reverted?
Also ci fails now:
PDOException: SQLSTATE[HY000]: General error: 1089 Incorrect prefix key; the used key part isn't a string, the used length is longer than the key part, or the storage engine doesn't support unique prefix keys in /home/runner/work/neos-development-collection/neos-development-collection/neos-development-distribution/Packages/Libraries/doctrine/dbal/lib/Doctrine/DBAL/Driver/PDOConnection.php:55
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.
right, yeah, it must
Much betterer I think |
Adjusted the description above and will merge this ;) |
This is a follow-up to #4730 fixing the database schema for binary columns.
Without this fix, calling
ProjectionInterface::setUp()
will drop and re-add a lot of columns!Furthermore, this fixes the
origindimensionspacepointhash
column of theAssetUsageRepository
to correctly use theDbalSchemaFactory::columnForDimensionSpacePointHash
. Previously it usedTEXT
without a length wich lead to the index from being recreated every setup.