diff --git a/core/lib/Drupal/Core/Database/database.api.php b/core/lib/Drupal/Core/Database/database.api.php index 45a5618..2518210 100644 --- a/core/lib/Drupal/Core/Database/database.api.php +++ b/core/lib/Drupal/Core/Database/database.api.php @@ -328,52 +328,53 @@ * bytes of the field 'type': * * @code - * $schema['node'] = array( - * 'description' => 'The base table for nodes.', - * 'fields' => array( - * 'nid' => array('type' => 'serial', 'unsigned' => TRUE, 'not null' => TRUE), - * 'vid' => array('type' => 'int', 'unsigned' => TRUE, 'not null' => TRUE,'default' => 0), - * 'type' => array('type' => 'varchar','length' => 32,'not null' => TRUE, 'default' => ''), - * 'language' => array('type' => 'varchar','length' => 12,'not null' => TRUE,'default' => ''), - * 'title' => array('type' => 'varchar','length' => 255,'not null' => TRUE, 'default' => ''), - * 'uid' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - * 'status' => array('type' => 'int', 'not null' => TRUE, 'default' => 1), - * 'created' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - * 'changed' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - * 'comment' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - * 'promote' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - * 'moderate' => array('type' => 'int', 'not null' => TRUE,'default' => 0), - * 'sticky' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - * 'translate' => array('type' => 'int', 'not null' => TRUE, 'default' => 0), - * ), - * 'indexes' => array( - * 'node_changed' => array('changed'), - * 'node_created' => array('created'), - * 'node_moderate' => array('moderate'), - * 'node_frontpage' => array('promote', 'status', 'sticky', 'created'), - * 'node_status_type' => array('status', 'type', 'nid'), - * 'node_title_type' => array('title', array('type', 4)), - * 'node_type' => array(array('type', 4)), - * 'uid' => array('uid'), - * 'translate' => array('translate'), - * ), - * 'unique keys' => array( - * 'vid' => array('vid'), - * ), - * // For documentation purposes only; foreign keys are not created in the - * // database. - * 'foreign keys' => array( - * 'node_revision' => array( - * 'table' => 'node_field_revision', - * 'columns' => array('vid' => 'vid'), - * ), - * 'node_author' => array( - * 'table' => 'users', - * 'columns' => array('uid' => 'uid'), - * ), - * ), - * 'primary key' => array('nid'), - * ); + * $schema['users_data'] = [ + * 'description' => 'Stores module data as key/value pairs per user.', + * 'fields' => [ + * 'uid' => [ + * 'description' => 'Primary key: {users}.uid for user.', + * 'type' => 'int', + * 'unsigned' => TRUE, + * 'not null' => TRUE, + * 'default' => 0, + * ], + * 'module' => [ + * 'description' => 'The name of the module declaring the variable.', + * 'type' => 'varchar_ascii', + * 'length' => DRUPAL_EXTENSION_NAME_MAX_LENGTH, + * 'not null' => TRUE, + * 'default' => '', + * ], + * 'name' => [ + * 'description' => 'The identifier of the data.', + * 'type' => 'varchar_ascii', + * 'length' => 128, + * 'not null' => TRUE, + * 'default' => '', + * ], + * 'value' => [ + * 'description' => 'The value.', + * 'type' => 'blob', + * 'not null' => FALSE, + * 'size' => 'big', + * ], + * 'serialized' => [ + * 'description' => 'Whether value is serialized.', + * 'type' => 'int', + * 'size' => 'tiny', + * 'unsigned' => TRUE, + * 'default' => 0, + * ], + * ], + * 'primary key' => ['uid', 'module', 'name'], + * 'indexes' => [ + * 'module' => ['module'], + * 'name' => ['name'], + * ], + * 'foreign keys' => [ + * 'uid' => ['users' => 'uid'], + * ], + * ]; * @endcode * * @see drupal_install_schema()