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.

41 lines
1.0 KiB

  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2024 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\DB\Types;
  11. use OCP\Migration\IOutput;
  12. use OCP\Migration\SimpleMigrationStep;
  13. /**
  14. * Add a column to track the last read marker update so conversations marked
  15. * as (un)read on other devices are properly updated with the "lazy" update.
  16. */
  17. class Version19000Date20240416104656 extends SimpleMigrationStep {
  18. /**
  19. * @param IOutput $output
  20. * @param Closure(): ISchemaWrapper $schemaClosure
  21. * @param array $options
  22. * @return null|ISchemaWrapper
  23. */
  24. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
  25. /** @var ISchemaWrapper $schema */
  26. $schema = $schemaClosure();
  27. $table = $schema->getTable('talk_attendees');
  28. $table->addColumn('last_attendee_activity', Types::BIGINT, [
  29. 'default' => 0,
  30. 'unsigned' => true,
  31. ]);
  32. return $schema;
  33. }
  34. }