diff --git a/core/lib/Drupal/Core/Database/database.api.php b/core/lib/Drupal/Core/Database/database.api.php index 7d653847dd..daea588579 100644 --- a/core/lib/Drupal/Core/Database/database.api.php +++ b/core/lib/Drupal/Core/Database/database.api.php @@ -321,62 +321,61 @@ * of the named column. * * As an example, here is a SUBSET of the schema definition for - * Drupal's 'node' table. It show four fields (nid, vid, type, and - * title), the primary key on field 'nid', a unique key named 'vid' on - * field 'vid', and two indexes, one named 'nid' on field 'nid' and - * one named 'node_title_type' on the field 'title' and the first four - * bytes of the field 'type': + * Drupal's 'users_data' table. It show four fields (uid, module, name, value, + * and serialized), the primary key on fields ('uid', 'module', and 'name'), + * two indexes, one named 'module' on field 'module' and one named 'name' on + * the field 'name': * * @code * $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'], - * ], + * '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'], + * ], * // For documentation purposes only; foreign keys are not created in the * // database. - * 'foreign keys' => [ - * 'uid' => ['users' => 'uid'], - * ], - * ]; + * 'foreign keys' => [ + * 'uid' => ['users' => 'uid'], + * ], + * ]; * @endcode * * @see drupal_install_schema()