Title: Database Versioning
Last modified: February 20, 2023

---

# Database Versioning

 *  [mb00](https://wordpress.org/support/users/mb00/)
 * (@mb00)
 * [3 years, 2 months ago](https://wordpress.org/support/topic/database-versioning/)
 * Current version of the plugin executes gravitecnet_abandoned_cart_table() that
   in turn attempts to create a database table on every request. A better approach
   would be to implement a database versioning as described [here](https://codex.wordpress.org/Creating_Tables_with_Plugins#A_Version_Option).
 * In addition to that once the table is created, each subsequent call to the function
   generates a ‘DESCRIBE IF;’ SQL error. It seems that dbDelta() does not handle
   CREATE TABLE IF NOT EXISTS statements well when there is no actual changes to
   be made to the database schema. This issue should be resolved once the database
   versioning is implemented.

The topic ‘Database Versioning’ is closed to new replies.

 * ![](https://ps.w.org/gravitec-net-web-push-notifications/assets/icon-256x256.
   png?rev=2240290)
 * [Gravitec.net - Web Push Notifications](https://wordpress.org/plugins/gravitec-net-web-push-notifications/)
 * [Support Threads](https://wordpress.org/support/plugin/gravitec-net-web-push-notifications/)
 * [Active Topics](https://wordpress.org/support/plugin/gravitec-net-web-push-notifications/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gravitec-net-web-push-notifications/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gravitec-net-web-push-notifications/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [mb00](https://wordpress.org/support/users/mb00/)
 * Last activity: [3 years, 2 months ago](https://wordpress.org/support/topic/database-versioning/)
 * Status: not resolved