1
0

SimpleMigrationStep.php 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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. abstract class SimpleMigrationStep implements 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. return '';
  22. }
  23. /**
  24. * Human-readable description of the migration step
  25. *
  26. * @return string
  27. * @since 14.0.0
  28. */
  29. public function description(): string {
  30. return '';
  31. }
  32. /**
  33. * @param IOutput $output
  34. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  35. * @psalm-param Closure():ISchemaWrapper $schemaClosure
  36. * @param array $options
  37. * @since 13.0.0
  38. */
  39. public function preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
  40. }
  41. /**
  42. * @param IOutput $output
  43. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  44. * @psalm-param Closure():ISchemaWrapper $schemaClosure
  45. * @param array $options
  46. * @return null|ISchemaWrapper
  47. * @since 13.0.0
  48. */
  49. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  50. return null;
  51. }
  52. /**
  53. * @param IOutput $output
  54. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  55. * @psalm-param Closure():ISchemaWrapper $schemaClosure
  56. * @param array $options
  57. * @since 13.0.0
  58. */
  59. public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
  60. }
  61. }