Version1018Date20210312100735.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2016 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCA\DAV\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. class Version1018Date20210312100735 extends SimpleMigrationStep {
  14. /**
  15. * @param IOutput $output
  16. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  17. * @param array $options
  18. * @return ISchemaWrapper
  19. */
  20. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
  21. /** @var ISchemaWrapper $schema */
  22. $schema = $schemaClosure();
  23. $calendarsTable = $schema->getTable('calendars');
  24. $calendarsTable->addColumn('deleted_at', Types::INTEGER, [
  25. 'notnull' => false,
  26. 'length' => 4,
  27. 'unsigned' => true,
  28. ]);
  29. $calendarsTable->addIndex([
  30. 'principaluri',
  31. 'deleted_at',
  32. ], 'cals_princ_del_idx');
  33. $calendarObjectsTable = $schema->getTable('calendarobjects');
  34. $calendarObjectsTable->addColumn('deleted_at', Types::INTEGER, [
  35. 'notnull' => false,
  36. 'length' => 4,
  37. 'unsigned' => true,
  38. ]);
  39. return $schema;
  40. }
  41. }