提问人:Banshidhari 提问时间:11/17/2023 最后编辑:Banshidhari 更新时间:11/17/2023 访问量:33
Drupal 10 升级后,出现“用户 ID 字段需要更新”的问题。
After Drupal 10 upgrade , having an issue "The User ID field needs to be updated."
问:
我确实尝试了命令drush entity-updates并得到如下错误:
The following updates are pending:
user entity type :
The User ID field needs to be updated.
Do you wish to run all pending updates? (yes/no) [yes]:
> yes
In SqlContentEntityStorageSchema.php line 1843:
The SQL storage cannot change the schema for an existing field (uid in user entity) with data.
然后我发现有几篇文章提到要检查模式是否正确,然后我还使用以下行代码与我的旧网站进行检查,并且两者都是相同的:
echo '<pre>';
print_r(\Drupal::keyValue('entity.storage_schema.sql')->get('user.entity_schema_data'));
print_r(\Drupal::keyValue('entity.storage_schema.sql')->get('user.field_schema_data.uid'));
输出
Array
(
[users] => Array
(
[primary key] => Array
(
[0] => uid
)
)
[users_field_data] => Array
(
[primary key] => Array
(
[0] => uid
[1] => langcode
)
[indexes] => Array
(
[user__id__default_langcode__langcode] => Array
(
[0] => uid
[1] => default_langcode
[2] => langcode
)
)
[unique keys] => Array
(
[user__name] => Array
(
[0] => name
[1] => langcode
)
)
)
)
Array
(
[users] => Array
(
[fields] => Array
(
[uid] => Array
(
[type] => int
[unsigned] => 1
[size] => normal
[not null] => 1
)
)
)
[users_field_data] => Array
(
[fields] => Array
(
[uid] => Array
(
[type] => int
[unsigned] => 1
[size] => normal
[not null] => 1
)
)
)
)
大多数文章都说,如果我运行命令drush entity-updates,那么问题可能会得到解决,不幸的是没有希望。我要提前感谢您的帮助。
答: 暂无答案
评论