Title: Table creation SQL upper cases incompatible with dbDelta
Last modified: April 19, 2023

---

# Table creation SQL upper cases incompatible with dbDelta

 *  Resolved [leesalami](https://wordpress.org/support/users/leesalami/)
 * (@leesalami)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/table-creation-sql-upper-cases-incompatible-with-dbdelta/)
 * On every page request the plugin checks the database columns and tries to update
   them because of differences in upper and lower cases.
 * For example “tec_occurrences” is defined as:
 *     ```wp-block-code
       CREATE TABLE {$table_name} (
       occurrence_id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
       event_id BIGINT(20) UNSIGNED NOT NULL,
       post_id BIGINT(20) UNSIGNED NOT NULL,
       start_date VARCHAR(19) NOT NULL,
       start_date_utc VARCHAR(19) NOT NULL,
       end_date VARCHAR(19) NOT NULL,
       end_date_utc VARCHAR(19) NOT NULL,
       duration MEDIUMINT(30) DEFAULT 7200,
       hash VARCHAR(40) NOT NULL,
       updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
       PRIMARY KEY (occurrence_id)
       ) {$charset_collate};
       ```
   
 * As you can see upper cases for BIGINT, UNSIGNED, VARCHAR etc. are being used.
 * The dbDelta function though uses lower cases and is case sensitive. Differences
   are found on every request resulting in a lot of unnecessary ALTER TABLE statements.
 * dbDelta then returns something like “Changed type of wp_tec_events.event_id from
   bigint(20) unsigned to BIGINT(20) UNSIGNED”.

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

 *  Plugin Support [Darian](https://wordpress.org/support/users/d0153/)
 * (@d0153)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/table-creation-sql-upper-cases-incompatible-with-dbdelta/#post-16676849)
 * Hi [@leesalami](https://wordpress.org/support/users/leesalami/)
 * Thanks for sharing this information. Allow me to share this with the team, and
   I’ll get back to you once I know more.
 * In the meantime, could you provide the version of the following? This will help
   me understand how your system is set up.
    - PHP
    - WordPress
    - The Events Calendar
    - Theme
 *  Plugin Support [Darian](https://wordpress.org/support/users/d0153/)
 * (@d0153)
 * [3 years, 1 month ago](https://wordpress.org/support/topic/table-creation-sql-upper-cases-incompatible-with-dbdelta/#post-16720717)
 * Hi [@leesalami](https://wordpress.org/support/users/leesalami/)
 * Thanks for patiently waiting. As of now, we have created an internal ticket that
   will handle this particular issue.
 * While we don’t have an ETA for the fix, you’ll get notified on this thread once
   there is an update/fix.
 * If you do have other concerns or issues you need help with, please create another
   support topic as indicated in the [WordPress.org](http://WordPress.org) support
   guidelines.
 * —
   Internal Bug Ticket Reference: TEC-4797
 *  [Gladys](https://wordpress.org/support/users/greventscalendar/)
 * (@greventscalendar)
 * [3 years ago](https://wordpress.org/support/topic/table-creation-sql-upper-cases-incompatible-with-dbdelta/#post-16823037)
 * Hi [@jondaley](https://wordpress.org/support/users/jondaley/), 
    With our latest
   release of [**The Events Calendar 6.1.0**](https://theeventscalendar.com/release-notes/the-events-calendar/the-events-calendar-6-1-0/),
   we have resolved multiple SQL issues which may also fix the table creation issue.
 * We recommend that you update The Events Calendar to the latest released versions
   and let us know if the problem goes away.
    As always, we suggest testing updates
   on a staging site first and having a recent backup ready, but it should all be
   smooth sailing. If you implemented any workarounds, you can remove them after
   updating the plugins. Have a great day,Events Calendar Support Team
    -  This reply was modified 3 years ago by [Gladys](https://wordpress.org/support/users/greventscalendar/).
 *  Thread Starter [leesalami](https://wordpress.org/support/users/leesalami/)
 * (@leesalami)
 * [3 years ago](https://wordpress.org/support/topic/table-creation-sql-upper-cases-incompatible-with-dbdelta/#post-16823181)
 * Awesome, thanks!
 *  Plugin Support [Darian](https://wordpress.org/support/users/d0153/)
 * (@d0153)
 * [3 years ago](https://wordpress.org/support/topic/table-creation-sql-upper-cases-incompatible-with-dbdelta/#post-16830708)
 * Hi [@leesalami](https://wordpress.org/support/users/leesalami/)
 * If you have some time to review, that would be amazing!
 * [https://wordpress.org/support/plugin/the-events-calendar/reviews/](https://wordpress.org/support/plugin/the-events-calendar/reviews/)
 * I’d be closing this thread, and please do not hesitate to bump a new thread on
   our way. This is for us to track down topics/issues efficiently and for us to
   follow the[ WordPress Forum Guidelines](https://wordpress.org/support/guidelines/).

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

The topic ‘Table creation SQL upper cases incompatible with dbDelta’ is closed to
new replies.

 * ![](https://ps.w.org/the-events-calendar/assets/icon-256x256.gif?rev=2516440)
 * [The Events Calendar](https://wordpress.org/plugins/the-events-calendar/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/the-events-calendar/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/the-events-calendar/)
 * [Active Topics](https://wordpress.org/support/plugin/the-events-calendar/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/the-events-calendar/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/the-events-calendar/reviews/)

## Tags

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

 * 5 replies
 * 3 participants
 * Last reply from: [Darian](https://wordpress.org/support/users/d0153/)
 * Last activity: [3 years ago](https://wordpress.org/support/topic/table-creation-sql-upper-cases-incompatible-with-dbdelta/#post-16830708)
 * Status: resolved