Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
API page: https://api.drupal.org/api/drupal/core%21modules%21user%21user.install/f...
The description given for the uid field in the user_data table is the following.
'description' => 'Primary key: {users}.uid for user.'
It is not the primary key, since that is the following.
'primary key' => ['uid', 'module', 'name']
It should be described similarly to how nid is described for the node_access table. (See https://api.drupal.org/api/drupal/core%21modules%21node%21node.install/f....)
'description' => 'The {node}.nid this record affects.'
Comment | File | Size | Author |
---|---|---|---|
#4 | change-table-field-description-2886740-4.patch | 548 bytes | apaderno |
#2 | change-table-field-description-2886740-2.patch | 548 bytes | apaderno |
Comments
Comment #2
apadernoComment #4
apadernoI am not sure it is correct to use Documentation as component, since this is a change in code, even it is a literal string.
Comment #7
benjifisher@kiamlaluno:
It looks as though the patches in #2 and #4 are identical. Is that on purpose? You do not need to re-upload the patch just because you are changing the issue metadata.
I am not sure that is a lot clearer.
I guess the intention of the the original version is that this is the primary key of the
{users}
table, not that it is the primary key of the{users_data}
table.As you point out, your proposed description is consistent with the corresponding description in the
{node_access}
table. I guess that is a good enough reason, so I will mark this issue RTBC.I am adding #2883260: Replace the schema example with one actually used from a module as a related issue. The current patch on that issue uses the
{users_data}
table as the source of the example indatabase.api.php
. If either of these issues is accepted, then the other should be updated to keep the two consistent.Comment #8
apaderno@benjifisher I added the patch for the new Drupal version.
'Primary key: {users}.uid for user.'
is confusing because it makes think that is the primary key for the table being described, which is not true. I took the descriptions for the {node_access} table as example; I thought they described better the table and the fields.Comment #9
catchCommitted 7ecfaf4 and pushed to 8.7.x. Thanks!