View source
<?php
function key_value_schema() {
$schema['key_value_sorted'] = [
'description' => 'Key-value list storage table.',
'fields' => [
'collection' => [
'description' => 'A named collection of key and value pairs.',
'type' => 'varchar',
'length' => 128,
'not null' => TRUE,
'default' => '',
],
'name' => [
'description' => 'The index or score key for the value.',
'type' => 'int',
'not null' => TRUE,
'default' => 0,
'size' => 'big',
],
'value' => [
'description' => 'The value.',
'type' => 'blob',
'not null' => TRUE,
'size' => 'big',
],
],
'indexes' => [
'collection_name' => [
'collection',
'name',
],
'name' => [
'name',
],
],
];
return $schema;
}