IMigrationStep.php 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
  5. * SPDX-License-Identifier: AGPL-3.0-or-later
  6. */
  7. namespace OCP\Migration;
  8. use Closure;
  9. use OCP\DB\ISchemaWrapper;
  10. /**
  11. * @since 13.0.0
  12. */
  13. interface IMigrationStep {
  14. /**
  15. * Human-readable name of the migration step
  16. *
  17. * @return string
  18. * @since 14.0.0
  19. */
  20. public function name(): string;
  21. /**
  22. * Human-readable description of the migration step
  23. *
  24. * @return string
  25. * @since 14.0.0
  26. */
  27. public function description(): string;
  28. /**
  29. * @param IOutput $output
  30. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  31. * @psalm-param Closure():ISchemaWrapper $schemaClosure
  32. * @param array $options
  33. * @since 13.0.0
  34. */
  35. public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options);
  36. /**
  37. * @param IOutput $output
  38. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  39. * @psalm-param Closure():ISchemaWrapper $schemaClosure
  40. * @param array $options
  41. * @return null|ISchemaWrapper
  42. * @since 13.0.0
  43. */
  44. public function changeSchema(IOutput $output, Closure $schemaClosure, array $options);
  45. /**
  46. * @param IOutput $output
  47. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  48. * @psalm-param Closure():ISchemaWrapper $schemaClosure
  49. * @param array $options
  50. * @since 13.0.0
  51. */
  52. public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options);
  53. }