SimpleMigrationStep.php 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
  5. *
  6. * @author Christoph Wurst <christoph@winzerhof-wurst.at>
  7. * @author Joas Schilling <coding@schilljs.com>
  8. * @author Robin Appelman <robin@icewind.nl>
  9. * @author Roeland Jago Douma <roeland@famdouma.nl>
  10. *
  11. * @license GNU AGPL version 3 or any later version
  12. *
  13. * This program is free software: you can redistribute it and/or modify
  14. * it under the terms of the GNU Affero General Public License as
  15. * published by the Free Software Foundation, either version 3 of the
  16. * License, or (at your option) any later version.
  17. *
  18. * This program is distributed in the hope that it will be useful,
  19. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  20. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  21. * GNU Affero General Public License for more details.
  22. *
  23. * You should have received a copy of the GNU Affero General Public License
  24. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  25. *
  26. */
  27. namespace OCP\Migration;
  28. use Closure;
  29. use OCP\DB\ISchemaWrapper;
  30. /**
  31. * @since 13.0.0
  32. */
  33. abstract class SimpleMigrationStep implements IMigrationStep {
  34. /**
  35. * Human-readable name of the migration step
  36. *
  37. * @return string
  38. * @since 14.0.0
  39. */
  40. public function name(): string {
  41. return '';
  42. }
  43. /**
  44. * Human-readable description of the migration step
  45. *
  46. * @return string
  47. * @since 14.0.0
  48. */
  49. public function description(): string {
  50. return '';
  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 preSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
  60. }
  61. /**
  62. * @param IOutput $output
  63. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  64. * @psalm-param Closure():ISchemaWrapper $schemaClosure
  65. * @param array $options
  66. * @return null|ISchemaWrapper
  67. * @since 13.0.0
  68. */
  69. public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
  70. return null;
  71. }
  72. /**
  73. * @param IOutput $output
  74. * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
  75. * @psalm-param Closure():ISchemaWrapper $schemaClosure
  76. * @param array $options
  77. * @since 13.0.0
  78. */
  79. public function postSchemaChange(IOutput $output, \Closure $schemaClosure, array $options) {
  80. }
  81. }