Fix variable name; restructure

This commit is contained in:
Jeremy Dormitzer 2018-09-19 13:46:40 -04:00
parent f0b424e4a6
commit 1d4be66856
No known key found for this signature in database
GPG Key ID: 04F17C0F5A32C320

View File

@ -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 );
}