PluginProbe
Search Atlas SEO – OTTO AI SEO Automation for WordPress / trunk
Search Atlas SEO – OTTO AI SEO Automation for WordPress vtrunk
2.7.0 2.6.26 2.6.25 2.6.24 2.6.23 2.6.22 2.6.21 2.6.20 2.6.19 2.6.18 2.6.17 2.6.16 2.6.15 2.6.14 2.6.13 2.6.12 2.6.11 2.6.10 2.6.9 2.6.8 2.6.7 2.6.6 2.6.5 2.6.4 2.6.3 All 139 releases
← All changes | database/class-db-migrations.php +31 -6 2.6.26trunk View file →
@@ -170,9 +170,31 @@
170 170
171 171 dbDelta($table_sql);
172 172 }
173 173
174 - // Create Sync History Table
174 + // Create Headless Refresh History Table
175 + require_once dirname(__FILE__, 2) . '/headless-refresh-history/class-metasync-headless-refresh-history-database.php';
176 + $tableNameHeadlessRefreshHistory = esc_sql($wpdb->prefix . Metasync_Headless_Refresh_History::$table_name);
177 + if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s ", $tableNameHeadlessRefreshHistory)) != $tableNameHeadlessRefreshHistory) {
178 + $table_sql = "CREATE TABLE {$tableNameHeadlessRefreshHistory} (
179 + id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
180 + object_type VARCHAR(20) NOT NULL DEFAULT '',
181 + object_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
182 + url_hash CHAR(64) NOT NULL DEFAULT '',
183 + outcome VARCHAR(32) NOT NULL DEFAULT '',
184 + reason VARCHAR(64) NOT NULL DEFAULT '',
185 + duration_ms INT UNSIGNED NOT NULL DEFAULT 0,
186 + object_count SMALLINT UNSIGNED NOT NULL DEFAULT 0,
187 + created_at DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
188 + PRIMARY KEY (id),
189 + KEY idx_created_at (created_at),
190 + KEY idx_object (object_type, object_id, created_at),
191 + KEY idx_outcome (outcome, created_at)
192 + ) $collate;";
193 + dbDelta($table_sql);
194 + }
195 +
196 + // Create Sync History Table
175 197 require_once dirname(__FILE__, 2) . '/sync-history/class-metasync-sync-history-database.php';
176 198 $tableNameSyncHistory = esc_sql($wpdb->prefix . Metasync_Sync_History_Database::$table_name);
177 199
178 200 if ($wpdb->get_var($wpdb->prepare("SHOW TABLES LIKE %s ", $tableNameSyncHistory)) != $tableNameSyncHistory) {
@@ -268,13 +290,16 @@
268 290 /* drop wp_metasync_redirections table */
269 291 // $sql = "DROP TABLE IF EXISTS `$tableNameRedirection` ";
270 292 // $wpdb->query($sql);
271 293
272 - require_once dirname(__FILE__, 2) . '/heartbeat-error-monitor/class-metasync-heartbeat-error-monitor-database.php';
273 - $tableNameHeartBeatErrorMonitor = esc_sql($wpdb->prefix . Metasync_HeartBeat_Error_Monitor_Database::$table_name);
274 - /* drop wp_metasync_redirections table */
275 - $sql = "DROP TABLE IF EXISTS `$tableNameHeartBeatErrorMonitor` ";
276 - $wpdb->query($sql);
294 + // Data tables are preserved on deactivation so a deactivate/reactivate cycle
295 + // does not silently destroy logged data (e.g. heartbeat error history).
296 + // Removal belongs to uninstall, not deactivation.
297 + // require_once dirname(__FILE__, 2) . '/heartbeat-error-monitor/class-metasync-heartbeat-error-monitor-database.php';
298 + // $tableNameHeartBeatErrorMonitor = esc_sql($wpdb->prefix . Metasync_HeartBeat_Error_Monitor_Database::$table_name);
299 + /* drop wp_metasync_heartbeat_error_logs table */
300 + // $sql = "DROP TABLE IF EXISTS `$tableNameHeartBeatErrorMonitor` ";
301 + // $wpdb->query($sql);
277 302 }
278 303
279 304 /**
280 305 * Run version-specific migrations