]> source.dussan.org Git - nextcloud-server.git/commitdiff
Add the columns and alter the index in Version1010Date20200630192842
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 18 Nov 2021 09:25:19 +0000 (10:25 +0100)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 13 Dec 2021 08:39:45 +0000 (09:39 +0100)
This is to ensure new installations do not need to go through migration
 history.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/user_ldap/lib/Migration/Version1010Date20200630192842.php

index e2c78ed59f89e64131b69cf62ee2876a344edf98..8263cbae157cf72ba1b14a2e548a374bc0e8b92f 100644 (file)
@@ -60,8 +60,12 @@ class Version1010Date20200630192842 extends SimpleMigrationStep {
                                'length' => 255,
                                'default' => '',
                        ]);
+                       $table->addColumn('ldap_dn_hash', Types::STRING, [
+                               'notnull' => false,
+                               'length' => 64,
+                       ]);
                        $table->setPrimaryKey(['owncloud_name']);
-                       $table->addUniqueIndex(['ldap_dn'], 'ldap_dn_users');
+                       $table->addUniqueIndex(['ldap_dn_hash'], 'ldap_user_dn_hashes');
                }
 
                if (!$schema->hasTable('ldap_group_mapping')) {
@@ -81,8 +85,12 @@ class Version1010Date20200630192842 extends SimpleMigrationStep {
                                'length' => 255,
                                'default' => '',
                        ]);
-                       $table->setPrimaryKey(['ldap_dn']);
-                       $table->addUniqueIndex(['owncloud_name'], 'owncloud_name_groups');
+                       $table->addColumn('ldap_dn_hash', Types::STRING, [
+                               'notnull' => false,
+                               'length' => 64,
+                       ]);
+                       $table->setPrimaryKey(['owncloud_name']);
+                       $table->addUniqueIndex(['ldap_dn_hash'], 'ldap_group_dn_hashes');
                }
 
                if (!$schema->hasTable('ldap_group_members')) {