You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
698 B

  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\Talk\Migration;
  8. use Closure;
  9. use OCP\DB\ISchemaWrapper;
  10. use OCP\Migration\IOutput;
  11. use OCP\Migration\SimpleMigrationStep;
  12. class Version8000Date20200402124456 extends SimpleMigrationStep {
  13. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ISchemaWrapper {
  14. /** @var ISchemaWrapper $schema */
  15. $schema = $schemaClosure();
  16. $table = $schema->getTable('talk_participants');
  17. if (!$table->hasIndex('tp_uid')) {
  18. $table->addIndex(['user_id'], 'tp_uid');
  19. }
  20. return $schema;
  21. }
  22. }