]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add an index for directory_uuid as well
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 18 Nov 2021 09:40:55 +0000 (10:40 +0100)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 13 Dec 2021 08:40:08 +0000 (09:40 +0100)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/user_ldap/lib/Migration/Version1010Date20200630192842.php
apps/user_ldap/lib/Migration/Version1130Date20211102154716.php

index 8263cbae157cf72ba1b14a2e548a374bc0e8b92f..939db69a6abf4325c28d482dee9922972690ff8f 100644 (file)
@@ -66,6 +66,7 @@ class Version1010Date20200630192842 extends SimpleMigrationStep {
                        ]);
                        $table->setPrimaryKey(['owncloud_name']);
                        $table->addUniqueIndex(['ldap_dn_hash'], 'ldap_user_dn_hashes');
+                       $table->addUniqueIndex(['directory_uuid'], 'ldap_user_directory_uuid');
                }
 
                if (!$schema->hasTable('ldap_group_mapping')) {
@@ -91,6 +92,7 @@ class Version1010Date20200630192842 extends SimpleMigrationStep {
                        ]);
                        $table->setPrimaryKey(['owncloud_name']);
                        $table->addUniqueIndex(['ldap_dn_hash'], 'ldap_group_dn_hashes');
+                       $table->addUniqueIndex(['directory_uuid'], 'ldap_group_directory_uuid');
                }
 
                if (!$schema->hasTable('ldap_group_members')) {
index 829e0d5a58c960abde3e6f06fded6cfbb8bf6187..144efad0eadcd6b214ef688e46915352d2d11b09 100644 (file)
@@ -64,6 +64,10 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
                                        $table->addUniqueIndex(['ldap_dn_hash'], 'ldap_user_dn_hashes');
                                        $changeSchema = true;
                                }
+                               if (!$table->hasIndex('ldap_user_directory_uuid')) {
+                                       $table->addUniqueIndex(['directory_uuid'], 'ldap_user_directory_uuid');
+                                       $changeSchema = true;
+                               }
                        } else {
                                if ($table->hasIndex('owncloud_name_groups')) {
                                        $table->dropIndex('owncloud_name_groups');
@@ -73,6 +77,10 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
                                        $table->addUniqueIndex(['ldap_dn_hash'], 'ldap_group_dn_hashes');
                                        $changeSchema = true;
                                }
+                               if (!$table->hasIndex('ldap_group_directory_uuid')) {
+                                       $table->addUniqueIndex(['directory_uuid'], 'ldap_group_directory_uuid');
+                                       $changeSchema = true;
+                               }
                                if (!$table->hasPrimaryKey() || ($table->getPrimaryKeyColumns() !== ['owncloud_name'])) {
                                        $table->dropPrimaryKey();
                                        $table->setPrimaryKey(['owncloud_name']);