From 1d4be66856a02b4e6d83a3cc9fe44e07e8736f38 Mon Sep 17 00:00:00 2001 From: Jeremy Dormitzer Date: Wed, 19 Sep 2018 13:46:40 -0400 Subject: [PATCH] Fix variable name; restructure --- inc/db.php | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/inc/db.php b/inc/db.php index d0a95aa..2e54f4c 100644 --- a/inc/db.php +++ b/inc/db.php @@ -9,13 +9,14 @@ It's okay to add new queries to this function, but don't ever delete queries. */ function run_migrations() { $previous_version = get_option( 'pterotype_previously_migrated_version' ); - if ( !$previously_migrated_version ) { + if ( !$previous_version ) { $previous_version = '0.0.0'; } - if ( version_compare( $previous_version, PTEROTYPE_VERSION, '<' ) ) { - if ( version_compare( $previous_version, '0.0.1', '<' ) ) { - migration_0_0_1(); - } + if ( version_compare( $previous_version, PTEROTYPE_VERSION, '>=' ) ) { + return; + } + if ( version_compare( $previous_version, '0.0.1', '<' ) ) { + migration_0_0_1(); } update_option( 'pterotype_previously_migrated_version', PTEROTYPE_VERSION ); }