]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fixed migration step for user_ldap
authorCôme Chilliet <come.chilliet@nextcloud.com>
Thu, 4 Nov 2021 11:27:44 +0000 (12:27 +0100)
committerCôme Chilliet <come.chilliet@nextcloud.com>
Mon, 13 Dec 2021 08:39:12 +0000 (09:39 +0100)
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
apps/user_ldap/composer/composer/autoload_classmap.php
apps/user_ldap/composer/composer/autoload_static.php
apps/user_ldap/lib/Migration/Version1130Date20211102154716.php

index 208c221f3627714b16b12201b4e53284efa12740..d670dab1ef77386b73d72a0b8a709bd59b099966 100644 (file)
@@ -62,6 +62,7 @@ return array(
     'OCA\\User_LDAP\\Migration\\UnsetDefaultProvider' => $baseDir . '/../lib/Migration/UnsetDefaultProvider.php',
     'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => $baseDir . '/../lib/Migration/Version1010Date20200630192842.php',
     'OCA\\User_LDAP\\Migration\\Version1120Date20210917155206' => $baseDir . '/../lib/Migration/Version1120Date20210917155206.php',
+    'OCA\\User_LDAP\\Migration\\Version1130Date20211102154716' => $baseDir . '/../lib/Migration/Version1130Date20211102154716.php',
     'OCA\\User_LDAP\\Notification\\Notifier' => $baseDir . '/../lib/Notification/Notifier.php',
     'OCA\\User_LDAP\\PagedResults\\IAdapter' => $baseDir . '/../lib/PagedResults/IAdapter.php',
     'OCA\\User_LDAP\\PagedResults\\Php73' => $baseDir . '/../lib/PagedResults/Php73.php',
index 260a45fd67dd97d86cbaf01361701c1cd5a287c5..0dd682ffa7dd58425f24843227970e6250864354 100644 (file)
@@ -77,6 +77,7 @@ class ComposerStaticInitUser_LDAP
         'OCA\\User_LDAP\\Migration\\UnsetDefaultProvider' => __DIR__ . '/..' . '/../lib/Migration/UnsetDefaultProvider.php',
         'OCA\\User_LDAP\\Migration\\Version1010Date20200630192842' => __DIR__ . '/..' . '/../lib/Migration/Version1010Date20200630192842.php',
         'OCA\\User_LDAP\\Migration\\Version1120Date20210917155206' => __DIR__ . '/..' . '/../lib/Migration/Version1120Date20210917155206.php',
+        'OCA\\User_LDAP\\Migration\\Version1130Date20211102154716' => __DIR__ . '/..' . '/../lib/Migration/Version1130Date20211102154716.php',
         'OCA\\User_LDAP\\Notification\\Notifier' => __DIR__ . '/..' . '/../lib/Notification/Notifier.php',
         'OCA\\User_LDAP\\PagedResults\\IAdapter' => __DIR__ . '/..' . '/../lib/PagedResults/IAdapter.php',
         'OCA\\User_LDAP\\PagedResults\\Php73' => __DIR__ . '/..' . '/../lib/PagedResults/Php73.php',
index dbf53cf66b50cb4c584f9bbfc9d1d1dab1b4d48d..198a79ef09516c8e0f58d228439f02b37e07b597 100644 (file)
@@ -43,8 +43,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
                $changeSchema = false;
                foreach (['ldap_user_mapping', 'ldap_group_mapping'] as $tableName) {
                        $table = $schema->getTable($tableName);
-                       $column = $table->getColumn('ldap_dn_hash');
-                       if (!$column) {
+                       if (!$table->hasColumn('ldap_dn_hash')) {
                                $table->addColumn('ldap_dn_hash', Types::STRING, [
                                        'notnull' => true,
                                        'length' => 64,
@@ -76,6 +75,7 @@ class Version1130Date20211102154716 extends SimpleMigrationStep {
                                        $changeSchema = true;
                                }
                                if ($table->getPrimaryKeyColumns() !== ['owncloud_name']) {
+                                       $table->dropPrimaryKey();
                                        $table->setPrimaryKey(['owncloud_name']);
                                        $changeSchema = true;
                                }