Mismatched entity and/or field definitions

Created on 2 August 2024, 4 months ago

Hello Josh,

since a few versions I'm getting the following error in Status report page:

Entity/field definitions
Mismatched entity and/or field definitions. The following changes were detected in the entity type and field definitions.
Bookable Calendar Opening: The Date field needs to be updated.

The error seems just cosmetic, as booking openings works fine - and I'm using it extensively - but nevertheless I would like to fix it. This is table structure for bookable_calendar_opening__date:

DESCRIBE `bookable_calendar_opening__date`; 
+------------------+------------------+------+-----+---------+-------+
| Field            | Type             | Null | Key | Default | Extra |
+------------------+------------------+------+-----+---------+-------+
| bundle           | varchar(128)     | NO   | MUL |         |       |
| deleted          | tinyint(4)       | NO   | PRI | 0       |       |
| entity_id        | int(10) unsigned | NO   | PRI | NULL    |       |
| revision_id      | int(10) unsigned | NO   | MUL | NULL    |       |
| langcode         | varchar(32)      | NO   | PRI |         |       |
| delta            | int(10) unsigned | NO   | PRI | NULL    |       |
| date_value       | bigint(20)       | YES  | MUL | NULL    |       |
| date_end_value   | bigint(20)       | YES  | MUL | NULL    |       |
| date_duration    | int(11)          | YES  |     | NULL    |       |
| date_rrule       | int(11)          | YES  | MUL | NULL    |       |
| date_rrule_index | int(11)          | YES  | MUL | NULL    |       |
| date_timezone    | varchar(32)      | YES  |     | NULL    |       |
+------------------+------------------+------+-----+---------+-------+
12 rows in set (0,001 sec)

Anything wrong here?

💬 Support request
Status

Active

Version

2.2

Component

Code

Created by

🇮🇹Italy ggamba Milano

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @ggamba
  • 🇸🇪Sweden Alsén

    Hi, after deleting all instances in database and running the following in a hook_update():

    $manager = \Drupal::entityDefinitionUpdateManager();
    $field = $manager->getFieldStorageDefinition('date', 'bookable_calendar_opening')
    $manager->updateFieldStorageDefinition($field);
    

    The table looks like this:

    DESCRIBE `bookable_calendar_opening__date`; 
    +------------------+------------------+------+-----+---------+-------+
    | Field            | Type             | Null | Key | Default | Extra |
    +------------------+------------------+------+-----+---------+-------+
    | bundle           | varchar(128)     | NO   | MUL |         |       |
    | deleted          | tinyint(4)       | NO   | PRI | 0       |       |
    | entity_id        | int(10) unsigned | NO   | PRI | NULL    |       |
    | revision_id      | int(10) unsigned | NO   | MUL | NULL    |       |
    | langcode         | varchar(32)      | NO   | PRI |         |       |
    | delta            | int(10) unsigned | NO   | PRI | NULL    |       |
    | date_value       | int(11)          | NO   | MUL | NULL    |       |
    | date_end_value   | int(11)          | NO   | MUL | NULL    |       |
    | date_duration    | mediumint(9)     | YES  |     | NULL    |       |
    | date_rrule       | int(11)          | YES  | MUL | NULL    |       |
    | date_rrule_index | int(11)          | YES  | MUL | NULL    |       |
    | date_timezone    | varchar(32)      | YES  |     | NULL    |       |
    +------------------+------------------+------+-----+---------+-------+
    12 rows in set (0.021 sec)
    
Production build 0.71.5 2024