Version1031Date20240610134258.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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\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 Version1031Date20240610134258 extends SimpleMigrationStep {
  14. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
  15. /** @var ISchemaWrapper $schema */
  16. $schema = $schemaClosure();
  17. $tableDavAbsence = $schema->getTable('dav_absence');
  18. if (!$tableDavAbsence->hasColumn('replacement_user_id')) {
  19. $tableDavAbsence->addColumn('replacement_user_id', Types::STRING, [
  20. 'notnull' => false,
  21. 'default' => '',
  22. 'length' => 64,
  23. ]);
  24. }
  25. if (!$tableDavAbsence->hasColumn('replacement_user_display_name')) {
  26. $tableDavAbsence->addColumn('replacement_user_display_name', Types::STRING, [
  27. 'notnull' => false,
  28. 'default' => '',
  29. 'length' => 64,
  30. ]);
  31. }
  32. return $schema;
  33. }
  34. }