mirror of
https://github.com/nextcloud/server.git
synced 2026-02-26 19:40:37 -05:00
Add an index for directory_uuid as well
Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
parent
fbed00bab4
commit
9e33d51c44
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']);
|
||||
|
|
|
|||
Loading…
Reference in a new issue