In short, no. But it’s not particularly complicated. Just add a new version_compare
block each time you revise the database:
$db_version = get_option( 'my_plugin_version' );
if ( version_compare( $db_version, '1.1', '<' ) ) {
// Initial update code added in 1.1
}
if ( version_compare( $db_version, '1.2', '<' ) ) {
// Additional update code added in 1.2
}
if ( version_compare( $db_version, '1.3', '<' ) ) {
// And so forth
}
update_option( 'my_plugin_version', '1.3' );
This accounts for upgrades from any previous version, and only applies updates required to bring the db to the current version.
Related Posts:
- Updating WordPress – the best approach (updating wp core, plugins and db)
- What is the easiest way to implement cascading database upgrade for my plugin?
- Upgrade 4.5.2 to 4.5.3 deleting row in wp_options table
- How do I show data from gravity forms in my template? [closed]
- Delete tables from database when deleting plugin
- Can I upgrade a plugin to a specific version?
- Is it bad practice to create own table for a plugin?
- How to Add an Index to Plugin Database table
- How can I delete orphan keys in WordPress database tables?
- Is there a plugin that will override the “Error establishing a database connection” message? [closed]
- Plugin upgrading: Widget settings
- How to delete all records from or empty a custom database table?
- How to customize a plugin whilst maintaining ability to upgrade
- What are these entries in the database? Looks similar to JSON
- WordPress sharding: which multi-DB plugin to use?
- Creating two database tables via plugin
- How to properly insert data into custom table via plugin
- How does WordPress handle MySQL row lock errors?
- How to make sense of the active_plugins option_value to enable and disable certain plugins from the database?
- How to avoid plugin name conflicts from the upgrade notifier?
- How to check plugin compatibility before upgrading WordPress
- How to empty wordpress custom post Database table
- insert data in database table from plugin with WP3.1
- Simple form that saves to database
- How to run Two WordPress blogs with different themes and with single database and same content
- $wpdb->get_results leaking memory
- A Way to Auto update plugins using cron?
- Plugins or Tutorials for displaying data from SQL-db on WP-page? [closed]
- Insert query inserts 2 entries, should insert 1
- Using Vagrant for customizable WordPress Multi-sites [closed]
- Is it a bad practice to go directly to the mysql database while developing a plugin?
- How do I check what plugins are enabled via the database?
- How to store ACF custom fields data in a custom table
- Can I explicitly specify ENGINE=InnoDB in WordPress?
- How can a Firebase user registration and login be integrated into a WordPress site?
- Bad Request (Invalid Hostname) on working server, database problem
- Plugin Not Working, But Only On GoDaddy Hosted site
- Create custom column in post table in wordpress
- Custom database or Custom Post Types?
- Missing argument 2 for wpdb::prepare() Issue
- Custom database table for plugin not creating on activation
- Hook (upgrader_process_complete) running moment
- How to update widget_text in the wp_options table
- Get the last post ID
- Add agenda items and notifications
- Why users disable the WordPress update?
- How to count number of records found in a database table?
- Should I global $wpdb outside of any of my plugin’s functions scope?
- Upgrading WordPress 4.0 asks for FTP password
- prefix table and plugins
- Taking WordPress table prefixes into account
- Changing BIGINT to INT
- WordPress register_activation_hook table creation not working
- How to add Edit | Delete button on rows?
- I can’t upload a new wordpress theme from a zipped file
- The plugin generated x characters of unexpected output, $wpdb not defined
- how to show database content in wordpress post
- clean wp_options table unused rows
- Ajax with jQuery UI dialog not working
- How to edit/delete single row items in a table on my own menu page
- Storing Email Account Passwords for SMTP Mailing for a WordPress Plugin
- Remove obsolete plugins artifacts from database tables
- Upgrade Private Plugin without Deleting
- Hook before & after plugin / core update
- If I delete plugins via FTP are settings kept in DB?
- greatest() function returns undefined property
- Get total number of comment of the posts written by an author
- WordPress 5 upgrade: until when is it safe to keep project running in 4.x?
- How to write one comment and publish on every post using database or plugin?
- Is the wordpress user-model changed in wpmu?
- Default Plugin Settings Not Writing to Database
- Creating Tables on Network Activation
- Make id column as AUTO INCREMENT on plugin activation
- What kind of data is that?
- Cannot login to ADMIN even after changing password in phpmyadmin
- Unable to create new database table upon plugin activation using dbDelta
- Where to hook my plugin’s action
- How to review WordPress website php version compatibility?
- Embed a Google Sheet as you view it in a separate tab?
- How to determine what is generating large amount of database queries?
- Building an email signup form. Where should the information be saved in the DB?
- Saving Custom Post types and fields to a custom table
- Retrieving a Value from a wp-database
- Need help restoring my WordPress blog
- WP plugins for building a database?
- Where does WordPress store plugin (enabled/disabled) status for multisite?
- Best method to upgrade multisite plugin’s numerous database table
- When to use action hooks and plugins
- Plugin Options Not Saving to Database in WP 4.5
- Doubt using $wpbd->get_col for a single column
- Access WordPress database outside of WordPress
- How to create custom tables in WordPress using my own plugin?
- How to access data in wordpress database externally using php
- Is it possible to create Custom Post plug-in?
- WordPress independent plugin upgrade notification system [duplicate]
- WordPress Settings Lost After Site Migration
- Help With MySQL to WPDB Query Conversion
- WSOD after upgrading to 3.1
- Upgraded to latest version – 3.0.3 and Now I get a “sufficient permissions to access this page” error
- custom user tables supported in SharDB plugin?