• Resolved sc0ttius

    (@sc0ttius)


    We recently updated our ewww image optimizer plugin a few months ago. Since then, we’ve noticed errors in the database when images were being processed.

    WordPress database error Unknown column 'updated' in 'field list' for query INSERT INTO 'wp_ewwwio_images'

    Upon looking at the table, the updated, updates, and trace columns are not there. I looked through the plugin and I can find only a create statement concerning this table. If the database schema was changed from an older version, why was there not a clear upgrade path to the new schema by using alter table?

    Is there any way to avoid doing this database change manually, perhaps something I’m missing concerning altering this table?

    https://wordpress.org/plugins/ewww-image-optimizer/

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author nosilver4u

    (@nosilver4u)

    The way database upgrades work is not quite like that. The plugin only needs to know how the database should be created, and then it hands that off to the dbDelta() function, which compares the current table structure to that in the create statement, and makes the changes appropriately.

    In the case of EWWW, you can force an upgrade at any time by removing the ewww_image_optimizer_version from the wp_options table (or by changing it to a smaller number like 2.3). When you refresh the WP admin, watch your error logs to see if an error occurs during the “upgrade”. Also, you may want to turn on debugging in your wp-config.php file which should display the error on the page too.

    Thread Starter sc0ttius

    (@sc0ttius)

    We just manually added the columns in the database. I’m not sure why it didn’t do the update when the plugin was upgraded, though.

    Thread Starter sc0ttius

    (@sc0ttius)

    Thanks for the quick reply. I confirmed the method you mentioned in our test environment and it matches how we manually created it.

    Plugin Author nosilver4u

    (@nosilver4u)

    sounds good, keep an eye out for db alter errors on future upgrades in case the schema doesn’t perfectly match, but sounds like you probably got it right 🙂

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Old database schema causing errors after upgrade’ is closed to new replies.