Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add an index for directory_uuid as well
Signed-off-by: Côme Chilliet <[email protected]>
  • Loading branch information
come-nc committed Dec 14, 2021
commit a51e366b0a94be295466d5cc325d1625d0fd845c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
]);
$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')) {
Expand All @@ -91,6 +92,7 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
]);
$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')) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,10 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
$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');
Expand All @@ -73,6 +77,10 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt
$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']);
Expand Down