In #2664322: key_value table is only used by a core service but it depends on system install we move the definition of two tables out of system_schema(). One of them ends up in the schemaDefinition() method of Drupal\Core\KeyValueStore\DatabaseStorage and the other in the same method of the derived Drupal\Core\KeyValueStore\DatabaseStorageExpirable class.
The original restructuring copied the schema definitions unchanged, but the new structure gives us an opportunity to remove some code duplication and make the UI a little more consistent. Currently, there are some annoying differences in the table descriptions, like using "key-value" or "key/value"; also, one has a code comment explaining why the database field is called "name" rather than "key", while the other explains this in the table description.
I propose replacing the schema definition in DatabaseStorageExpirable::schemaDefinition() with
public function schemaDefinition() {
$schema = parent::schemaDefinition();
$schema['description'] = '...';
$schema['expire'] = [
// ...
];
$schema['indexes'] = [
// ...
];
return $schema;
}
This will enforce consistency for most fields, even fields that we have not added yet.
Comments
Comment #16
smustgrave commentedThank you for creating this issue to improve Drupal.
We are working to decide if this task is still relevant to a currently supported version of Drupal. There hasn't been any discussion here for over 8 years which suggests that this has either been implemented or is no longer relevant. Your thoughts on this will allow a decision to be made.
Since we need more information to move forward with this issue, the status is now Postponed (maintainer needs more info). If we don't receive additional information to help with the issue, it may be closed after three months.
Thanks!
Comment #17
smustgrave commentedChecking system_schema() and it doesn't seem to be duplicate anymore. Am I missing something?