summaryrefslogtreecommitdiffstats
path: root/apps/user_ldap/lib/Migration
diff options
context:
space:
mode:
Diffstat (limited to 'apps/user_ldap/lib/Migration')
-rw-r--r--apps/user_ldap/lib/Migration/Version1130Date20211102154716.php4
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php b/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php
index dbf53cf66b5..198a79ef095 100644
--- a/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php
+++ b/apps/user_ldap/lib/Migration/Version1130Date20211102154716.php
@@ -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;
}