Entity type:
{field_config_instance}.entity_type = 32 chars
{field_data_* and field_revision_data_*}.entity_type = 128 chars
{file_usage}.type = 64 chars
{rdf_mapping}.type = 128 chars

Bundle:
{field_config_instance}.bundle = 128 chars
{field_data_* and field_revision_data_*}.bundle = 128 chars
{rdf_mapping}.bundle = 128 chars

We are at least consistent with bundle at 128 chars. But WTF is going on with entity type length? Is it 32 characters maximum? 64?? 128???

I say we have to go with our shortest possible value which is 32. Let's be consistent in core and set an example for contrib, which is basically picking one of these values at random when creating an entity_type field in hook_schema().

Comments

mlncn’s picture

i'll add my vote to the 128 plurality... and i'd like that in blue, please.

pillarsdotnet’s picture

128 -- Increasing a limit doesn't break anything; reducing it does.

EDIT: Changing my vote in response to #3.

32 should be enough characters for anyone.

;-)

chx’s picture

Actually allowing only 32 won't break anything as it needs to fit already and let's not go overboard, each char takes three bytes in an index and you only have 1000 of those.

Michelle’s picture

If storage isn't a big issue, my vote is for more. You just never know what odd stuff contrib will come up with. I've run into length limits on other things before and gotten annoyed at them. If you start throwing module names and such into your naming scheme, it could get long.

Michelle

Dave Reid’s picture

Title: Maximum length of entity type is inconsistent » Standardize entity type is a maximum of 32 characters (not 64 or 128)

Storage is actually an issue - we're running into this already with contrib. The problem is that with a longer value, entity_type is *very* commonly used in primary keys and indexes (which for cross-db compatability must have <1000 bytes). If entity_type = 128, then we are already at 384 bytes or 38% of the available key length. Add a field like bundle (128 chars / 384 bytes) or field_name (32 / 96 bytes), and it fills up fast. I think it makes sense to keep entity types fairly short (and the same length as field names). Once we have a length standardized, we can increase it as needed in the future.

andypost’s picture

chx’s picture

Status: Active » Closed (won't fix)

Add an index length and carry on.

xjm’s picture

Status: Closed (won't fix) » Closed (duplicate)
RoSk0’s picture

xjm’s picture

Issue tags: +Naming things is hard