Migration to 2.0 raises warning regarding an invalid database schema
-
Hi,
The plugin was updated two weeks ago from 1.1.20 to 2.0. One of the breaking changes is that the
PluginVersion
option moved fromwp_option
towp_sitemeta
. The migration code is run at the initialization of the plugin. It first checks forPluginVersion
and if unset, it runs the whole migration process, which first creates thewp_gdbc_attempts
table, then renames it towp_gdbc_attempts_old
, then tries to move the (non-existing) data fromwp_gdbc_attempts_old
towp_gdbc_attempts
. Columns inwp_gdbc_attempts_old
are expected to be in the old format which cause the migration code to fail, raising the following warning:WordPress database error Unknown column 'IsIpBlocked' in 'where clause' for query SELECT DISTINCT ClientIp FROM wp_gdbc_attempts_old WHERE IsIpBlocked <> 0 AND IsDeleted = 0 made by include('phar:///usr/local/bin/wp/php/boot-phar.php'), include('phar:///usr/local/bin/wp/php/wp-cli.php'), WP_CLI\Runner->start, WP_CLI\Runner->load_wordpress, require('phar:///usr/local/bin/wp/php/wp-settings-cli.php'), do_action('plugins_loaded'), call_user_func_array, GoodByeCaptcha::getInstance, GoodByeCaptcha->__construct, GdbcUpdatesController::updateToCurrentVersion, GdbcUpdatesController::migrateTableDataFromV1
WordPress database error Unknown column 'CountryId' in 'field list' for query
SELECT Id, UNIX_TIMESTAMP(CreatedDate) AS CreatedDate, ModuleId, SectionId, ClientIp, CountryId, ReasonId
FROM wp_gdbc_attempts_old WHERE IsDeleted = 0 AND CreatedDate BETWEEN '2015-11-17 16:09:35' AND '2015-12-17 16:09:35' order by CreatedDate DESC LIMIT 500;
made by include('phar:///usr/local/bin/wp/php/boot-phar.php'), include('phar:///usr/local/bin/wp/php/wp-cli.php'), WP_CLI\Runner->start, WP_CLI\Runner->load_wordpress, require('phar:///usr/local/bin/wp/php/wp-settings-cli.php'), do_action('plugins_loaded'), call_user_func_array, GoodByeCaptcha::getInstance, GoodByeCaptcha->__construct, GdbcUpdatesController::updateToCurrentVersion, GdbcUpdatesController::migrateTableDataFromV1I think the problem is that the migration code should create the
wp_gdbc_attempts
after it renames the pre-existing table. All of this is inengine/GdbcUpdatesController.php
.
- The topic ‘Migration to 2.0 raises warning regarding an invalid database schema’ is closed to new replies.