diff --git a/changelog.txt b/changelog.txt index a8bae309c..287f08727 100644 --- a/changelog.txt +++ b/changelog.txt @@ -7,6 +7,7 @@ * COMPATIBILITY - Easy Digital Downloads Compatibility replaced with [WP-Stateless - Easy Digital Downloads Addon](* COMPATIBILITY - Easy Digital Downloads Compatibility replaced with [WP-Stateless - Easy Digital Downloads Addon](https://wordpress.org/plugins/wp-stateless-easy-digital-downloads-addon/). * COMPATIBILITY - LiteSpeed Cache Compatibility replaced with [WP-Stateless - LiteSpeed Cache Addon](https://wordpress.org/plugins/wp-stateless-litespeed-cache-addon/). * FIX: remove PHP warning on `Status` settings tab. +* FIX: database updates to resolve conflicts with Polylang Pro compatibility. = 4.1.1 = * FIX - cache issues during Data Optimization. diff --git a/changes.md b/changes.md index 81fda0799..392d1adc6 100644 --- a/changes.md +++ b/changes.md @@ -6,7 +6,7 @@ * COMPATIBILITY - Easy Digital Downloads Compatibility replaced with [WP-Stateless - Easy Digital Downloads Addon](https://wordpress.org/plugins/wp-stateless-easy-digital-downloads-addon/). * COMPATIBILITY - LiteSpeed Cache Compatibility replaced with [WP-Stateless - LiteSpeed Cache Addon](https://wordpress.org/plugins/wp-stateless-litespeed-cache-addon/). * FIX: PHP warning on `Status` settings tab. - +* FIX: database updates to resolve conflicts with Polylang Pro compatibility. #### 4.1.1 * FIX - cache issues during Data Optimization. diff --git a/lib/classes/class-db.php b/lib/classes/class-db.php index 30ca24973..98fabdeaf 100644 --- a/lib/classes/class-db.php +++ b/lib/classes/class-db.php @@ -15,7 +15,7 @@ class DB { use Singleton; const DB_VERSION_KEY = 'sm_db_version'; - const DB_VERSION = '1.1'; + const DB_VERSION = '1.2'; const FULL_SIZE = '__full'; /** @@ -173,7 +173,8 @@ public function create_db() { `status` varchar(10) NULL DEFAULT NULL, PRIMARY KEY (`id`), KEY post_id (post_id), - UNIQUE KEY `name` (`name`(191)) + KEY `name` (`name`(191)), + UNIQUE KEY post_id_name (post_id, `name`(150)) ) $charset_collate; CREATE TABLE $this->file_sizes ( diff --git a/lib/classes/class-upgrader.php b/lib/classes/class-upgrader.php index 7f49ba5c7..a5881133c 100644 --- a/lib/classes/class-upgrader.php +++ b/lib/classes/class-upgrader.php @@ -257,6 +257,16 @@ public static function upgrade_db($new_version, $old_version) { Helper::log($e->getMessage()); } } + + if ( !empty($old_version) && version_compare($old_version, '1.2', '<') ) { + try { + // Remove UNIQUE indexes, which will be recreated later using dbDelta as non-unique + $wpdb->query('ALTER TABLE ' . ud_stateless_db()->files . ' DROP INDEX name'); + + } catch (\Throwable $e) { + Helper::log($e->getMessage()); + } + } } } } diff --git a/readme.txt b/readme.txt index 9d2e86e1b..22f4f1cd3 100644 --- a/readme.txt +++ b/readme.txt @@ -141,6 +141,7 @@ Before upgrading to WP-Stateless 3.0, please, make sure you tested it on your de * COMPATIBILITY - Easy Digital Downloads Compatibility replaced with [WP-Stateless - Easy Digital Downloads Addon](* COMPATIBILITY - Easy Digital Downloads Compatibility replaced with [WP-Stateless - Easy Digital Downloads Addon](https://wordpress.org/plugins/wp-stateless-easy-digital-downloads-addon/). * COMPATIBILITY - LiteSpeed Cache Compatibility replaced with [WP-Stateless - LiteSpeed Cache Addon](https://wordpress.org/plugins/wp-stateless-litespeed-cache-addon/). * FIX: remove PHP warning on `Status` settings tab. +* FIX: database updates to resolve conflicts with Polylang Pro compatibility. = 4.1.1 = * FIX - cache issues during Data Optimization. diff --git a/static/views/status-sections/migrations.php b/static/views/status-sections/migrations.php index b8cab4952..e43d1f5f6 100644 --- a/static/views/status-sections/migrations.php +++ b/static/views/status-sections/migrations.php @@ -20,10 +20,6 @@ domain); ?> - -

- -