Skip to content

Commit

Permalink
Merge pull request #12740 from nextcloud/skalidindi53/12553/Missing-i…
Browse files Browse the repository at this point in the history
…ndex-for-talk_invitations

feat: Added (user,state) index for talk_invitations
  • Loading branch information
nickvergessen authored Jul 17, 2024
2 parents 12cf1bb + 5e90556 commit 0c758f2
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
3 changes: 2 additions & 1 deletion appinfo/info.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
* 🌉 **Sync with other chat solutions** With [Matterbridge](https://github.com/42wim/matterbridge/) being integrated in Talk, you can easily sync a lot of other chat solutions to Nextcloud Talk and vice-versa.
]]></description>

<version>20.0.0-dev.4</version>
<version>20.0.0-dev.5</version>
<licence>agpl</licence>

<author>Daniel Calviño Sánchez</author>
Expand All @@ -31,6 +31,7 @@
<author>Marcel Hibbe</author>
<author>Marcel Müller</author>
<author>Sowjanya Kota</author>
<author>Shankar Kalidindi</author>

<namespace>Talk</namespace>

Expand Down
1 change: 0 additions & 1 deletion lib/Migration/Version18000Date20231024141627.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,6 @@ public function changeSchema(IOutput $output, Closure $schemaClosure, array $opt

$table->addIndex(['local_room_id'], 'talk_fedinv_lri');
$table->addUniqueIndex(['remote_server_url', 'remote_attendee_id'], 'talk_fedinv_remote');

return $schema;
}
return null;
Expand Down
36 changes: 36 additions & 0 deletions lib/Migration/Version20000Date20240716190335.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?php

declare(strict_types=1);

/**
* SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/

namespace OCA\Talk\Migration;

use Closure;
use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

class Version20000Date20240716190335 extends SimpleMigrationStep {
/**
* @param IOutput $output
* @param Closure(): ISchemaWrapper $schemaClosure
* @param array $options
* @return null|ISchemaWrapper
*/
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
/** @var ISchemaWrapper $schema */
$schema = $schemaClosure();

$table = $schema->getTable('talk_invitations');
if (!$table->hasIndex('talk_user_state')) {
$table->addIndex(['user_id', 'state'], 'talk_user_state');
return $schema;
}

return null;
}
}

0 comments on commit 0c758f2

Please sign in to comment.