1
0

Version0002Date20200902144824.php 1021 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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\UserStatus\Migration;
  8. use OCP\DB\ISchemaWrapper;
  9. use OCP\Migration\IOutput;
  10. use OCP\Migration\SimpleMigrationStep;
  11. /**
  12. * Class Version0001Date20200602134824
  13. *
  14. * @package OCA\UserStatus\Migration
  15. */
  16. class Version0002Date20200902144824 extends SimpleMigrationStep {
  17. /**
  18. * @param IOutput $output
  19. * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  20. * @param array $options
  21. * @return null|ISchemaWrapper
  22. * @since 20.0.0
  23. */
  24. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  25. /** @var ISchemaWrapper $schema */
  26. $schema = $schemaClosure();
  27. $statusTable = $schema->getTable('user_status');
  28. $statusTable->addIndex(['status_timestamp'], 'user_status_tstmp_ix');
  29. $statusTable->addIndex(['is_user_defined', 'status'], 'user_status_iud_ix');
  30. return $schema;
  31. }
  32. }