After Drupal 10 upgrade , having an issue "The User ID field needs to be updated."

185 views Asked by At

After Drupal 10 upgrade I am having an issue like below screenshot: enter image description here

I did try with the command drush entity-updates and getting the error like below:

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.  
                                                                                                  

Then I found few article where it is mentioned to check whether schemas are right or not then I also check this with my old site by using the below lines code and both are identical:

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'));

Output

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
                        )

                )

        )

)

Most of the articles are saying if I run the command drush entity-updates then problem may get resolve, unfortunately there is no hope. I would like to thank in advance and appreciate for your help.

0

There are 0 answers