Problem/Motivation
Currently UUID module adds an information about database field for core entities. The uuid
and revision uuid
fields - are SQL indexes but schema API does not know about this because these fields were not added to indexes
property of a schema.
This improvement can help, for instance, in this case: I want to delete all indexes from users
table to perform a heavy SQL operation. Programmatically I'm able to obtain all indexes from primary key
, unique keys
and indexes
properties of schema definition of the users
table but the uuid
index will be missed there.
Proposed resolution
Update logic of uuid_schema_alter()
function and populate indexes in schema.
Remaining tasks
None.
User interface changes
None.
API changes
None.
Data model changes
None.
Comment | File | Size | Author |
---|---|---|---|
#8 | interdiff-2763369-6-8.txt | 3.19 KB | BR0kEN |
#8 | uuid-schema-api-indexes-2763369-8.patch | 3.37 KB | BR0kEN |
Comments
Comment #2
BR0kENComment #3
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commented@BR0kEN thanks for the patch. I have committed some fixes for the tests that will conflict with your patch. I found a few issues while reviewing it.
This is difficult to read. Please define the array before iterating over it.
Please also assign this array to a variable first.
This is only checking the schemas for core entities. The test description should reflect this.
Another array to assign to a variable first.
How about this?
Please assign array to a variable.
Shouldn't this be
assertIdentical()
?Comment #4
BR0kENWhy do you think that array, directly passed to
foreach
, is not readable?Comment #5
BR0kENI'm pretty sure that we do not need to fail here because, if on this stage something went wrong then problem is deeper than definitions of schemas. Are you have any thoughts/concerns regarding this?
Comment #6
BR0kENtestSchemas
method ofUUIDAPITestCase
class.assertTrue
byassertIdentical
intestSchemas
method ofUUIDAPITestCase
class.Comment #7
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedAs noted the parent issue will result in the need for a reroll. I have have committed #2763727: Optimizations and fixes for tests.
My comment in point 5 was a suggestion for changing the comment to a single line comment.
The arrays really mess with the flow of the code. It really impacts on the ability to quickly look at the code and understand what's happening. The arrays need to be fixed.
Comment #8
BR0kENCreated a reroll with fixes for array definitions.
Comment #10
BR0kENComment #11
BR0kENComment #12
BR0kENComment #13
BR0kEN@skwashd, let's have this committed!
Comment #14
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Dave Hall Consulting commentedLooks good. I'll try to get this committed and a new release out the door this week. I've been busy with other work recently.
Comment #16
skwashd CreditAttribution: skwashd at Dave Hall Consulting for Pfizer, Inc. commentedThanks for the patch. I've committed it. I'll be preparing a new release this week.