| @@ -13,9 +13,9 @@ | ||
| 13 | 13 | * Creates, versions, verifies, and repairs the plugin's tables. |
| 14 | 14 | */ |
| 15 | 15 | class Migrator { |
| 16 | 16 | |
| 17 | - const DB_VERSION = '2.0.1'; | |
| 17 | + const DB_VERSION = '2.0.2'; | |
| 18 | 18 | |
| 19 | 19 | /** |
| 20 | 20 | * Install, upgrade, or repair tables. Safe to call on every load. |
| 21 | 21 | * |
| @@ -119,12 +119,14 @@ | ||
| 119 | 119 | origin VARCHAR(30) NOT NULL DEFAULT 'buffer', |
| 120 | 120 | rendered TINYINT(1) NOT NULL DEFAULT 0, |
| 121 | 121 | above_fold TINYINT(1) NOT NULL DEFAULT 0, |
| 122 | 122 | hits BIGINT UNSIGNED NOT NULL DEFAULT 1, |
| 123 | + beacon_misses SMALLINT UNSIGNED NOT NULL DEFAULT 0, | |
| 123 | 124 | last_seen DATETIME DEFAULT NULL, |
| 124 | 125 | PRIMARY KEY (id), |
| 125 | 126 | UNIQUE KEY uq_usage (usage_key), |
| 126 | - KEY idx_family (family) | |
| 127 | + KEY idx_family (family), | |
| 128 | + KEY idx_last_seen (last_seen) | |
| 127 | 129 | ) {$charset};" |
| 128 | 130 | ); |
| 129 | 131 | |
| 130 | 132 | dbDelta( |
| @@ -136,9 +138,10 @@ | ||
| 136 | 138 | preload LONGTEXT DEFAULT NULL, |
| 137 | 139 | unload LONGTEXT DEFAULT NULL, |
| 138 | 140 | updated_at DATETIME DEFAULT NULL, |
| 139 | 141 | PRIMARY KEY (id), |
| 140 | - UNIQUE KEY uq_route (route_key) | |
| 142 | + UNIQUE KEY uq_route (route_key), | |
| 143 | + KEY idx_updated (updated_at) | |
| 141 | 144 | ) {$charset};" |
| 142 | 145 | ); |
| 143 | 146 | |
| 144 | 147 | // dbDelta never DROPs an index that exists in the table but not in the |
| @@ -196,8 +199,9 @@ | ||
| 196 | 199 | && $this->column_exists( 'easyfonts_fonts', 'is_enabled' ) |
| 197 | 200 | && $this->column_exists( 'easyfonts_fonts', 'load_user_set' ) |
| 198 | 201 | && $this->column_exists( 'easyfonts_fonts', 'preload_user_set' ) |
| 199 | 202 | && $this->column_exists( 'easyfonts_usage', 'usage_key' ) |
| 203 | + && $this->column_exists( 'easyfonts_usage', 'beacon_misses' ) | |
| 200 | 204 | && $this->column_exists( 'easyfonts_decisions', 'route_key' ); |
| 201 | 205 | } |
| 202 | 206 | |
| 203 | 207 | /** |