Broken definitions after updating from beta 2 to beta 5

Created on 26 October 2024, 3 months ago

Problem

Broken field definitions with data in database.

Steps to reproduce

Have a node with a time field.
Update from 1.0.0 beta 2 to beta 5.

🐛 Bug report
Status

Active

Version

1.0

Component

Code

Created by

🇩🇪Germany mee_sha

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

Comments & Activities

  • Issue created by @mee_sha
  • 🇩🇪Germany jox

    I ran into this as well.

    What's happening is that field_time_value in the database (MySQL/MariaDB in my case) changed from type VARCHAR(8) to TIME.

    What worked for me was:

    1. Dump (backup) the affected tables.
    2. Truncate (empty) those tables.
    3. Update the entity definitions.
    4. Restore the tables.

    Restoring the VARCHAR values into the TIME field worked without any issues.

    For example:

    $ composer require drupal/devel_entity_updates
    
    $ drush en devel_entity_updates
    
    $ mysqldump --no-create-info MY_DATABASE node__field_time node_revision__field_time >time_field_table_data.sql
    
    $ echo "TRUNCATE TABLE node__field_time; TRUNCATE TABLE node_revision__field_time;" | mysql MY_DATABASE
    
    $ drush entup
    
    $ mysql MY_DATABASE < backup/time_field_table_data.sql
    
Production build 0.71.5 2024