Skip to content

Commit

Permalink
fix: don’t run migration if no db version
Browse files Browse the repository at this point in the history
  • Loading branch information
florianbrinkmann committed Oct 18, 2023
1 parent 7a1e0ed commit fbe140e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Handlers/PluginUpdate.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,14 @@ private static function maybe_update_database() {
// Prevent further update triggers during the same request that run before the DB version is updated.
self::$db_update_triggered = true;

$version_from_db = get_option( 'antispambee_db_version', 0 );
$version_from_db = get_option( 'antispambee_db_version', null );

update_option( 'antispambee_db_version', self::get_plugin_version() );

if ( $version_from_db === null ) {
return;
}

if ( $version_from_db < 1.01 ) {
global $wpdb;

Expand Down

0 comments on commit fbe140e

Please sign in to comment.