Title: Old database schema causing errors after upgrade
Last modified: September 1, 2016

---

# Old database schema causing errors after upgrade

 *  Resolved [sc0ttius](https://wordpress.org/support/users/sc0ttius/)
 * (@sc0ttius)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/old-database-schema-causing-errors-after-upgrade/)
 * 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/](https://wordpress.org/plugins/ewww-image-optimizer/)

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

 *  Plugin Author [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/old-database-schema-causing-errors-after-upgrade/#post-7648515)
 * 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](https://wordpress.org/support/users/sc0ttius/)
 * (@sc0ttius)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/old-database-schema-causing-errors-after-upgrade/#post-7648532)
 * 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](https://wordpress.org/support/users/sc0ttius/)
 * (@sc0ttius)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/old-database-schema-causing-errors-after-upgrade/#post-7648537)
 * 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 [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * (@nosilver4u)
 * [9 years, 10 months ago](https://wordpress.org/support/topic/old-database-schema-causing-errors-after-upgrade/#post-7648538)
 * 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.

 * ![](https://ps.w.org/ewww-image-optimizer/assets/icon-256x256.png?rev=1582276)
 * [EWWW Image Optimizer](https://wordpress.org/plugins/ewww-image-optimizer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/ewww-image-optimizer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/ewww-image-optimizer/)
 * [Active Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/ewww-image-optimizer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/ewww-image-optimizer/reviews/)

## Tags

 * [database](https://wordpress.org/support/topic-tag/database/)

 * 4 replies
 * 2 participants
 * Last reply from: [Shane Bishop](https://wordpress.org/support/users/nosilver4u/)
 * Last activity: [9 years, 10 months ago](https://wordpress.org/support/topic/old-database-schema-causing-errors-after-upgrade/#post-7648538)
 * Status: resolved