Add an index for directory_uuid as well

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
pull/30261/head
Côme Chilliet 2021-11-18 10:40:55 +07:00
parent 41e365aa3b
commit 44fe945d39
No known key found for this signature in database
GPG Key ID: A3E2F658B28C760A
2 changed files with 10 additions and 0 deletions

@ -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')) {

@ -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']);