- πΊπ¦Ukraine pingwin4eg Zaporizhia πΊπ¦
Shouldn't the change record be in the draft status at this stage? I see it's published, but the issue isn't committed yet, so nothing described in it works.
Currently, only a few entity keys are automatically marked as NOT NULL, which is a problem because it gives the impression that entity keys are somehow special and leads to bugs like #2824851: EntityResource::patch() makes an incorrect assumption about entity keys, hence results in incorrect behavior β .
Also, developers have to know about this limitation of entity API and override \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::getSharedTableFieldSchema()
in order to mark fields as NOT NULL.
An additional (major) problem found is that when we are updating the storage definition of an identifier field (e.g. 'id' or 'revision_id'), the primary keys are not updated properly in the SQL schema.
This patch also uncovered a another bug:
- The entity storage schema stores incorrect field schema data for the identifier fields: both the 'id' and 'revision_id' fields are of type int
in their base tables, when they should be serial
instead
Since we can now mark field storages as required ( #2390495: Support marking field storage definitions as required β ) we can also add the NOT NULL database constraint automatically. This will also improve the performance of indexes that are using those required fields.
Pass the new 'primary key' definition when re-adding the identifier field in \Drupal\Core\Entity\Sql\SqlContentEntityStorageSchema::createSharedTableSchema()
.
Fix the field storage schema data for the identifier fields for all entity types.
Review.
Nope.
The 'not_null' parameter of SqlContentEntityStorageSchema::addSharedTableFieldIndex() will become deprecated.
Instead, you should set \Drupal\Core\Field\BaseFieldDefinition::setStorageRequired() on the respective field.
Nope.
Needs work
11.0 π₯
entity system
It affects performance. It is often combined with the Needs profiling tag.
There is consensus among core maintainers that this is a major issue. Only core committers should add this tag.
Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.
A change record needs to be drafted before an issue is committed. Note: Change records used to be called change notifications.
Not all content is available!
It's likely this issue predates Contrib.social: some issue and comment data are missing.
Shouldn't the change record be in the draft status at this stage? I see it's published, but the issue isn't committed yet, so nothing described in it works.