aboutsummaryrefslogtreecommitdiffstats
path: root/lib/public/Migration
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2017-06-02 13:54:09 +0200
committerMorris Jobke <hey@morrisjobke.de>2017-07-05 13:01:19 +0200
commit194ef1a1715038c2193cee65a74372f07bc4eee6 (patch)
tree3e9f6120c64f85614cf926c2a7bd6286aaef3b88 /lib/public/Migration
parent183b1dbde3b5586e3bae0073f6f9c40414e7c6a6 (diff)
downloadnextcloud-server-194ef1a1715038c2193cee65a74372f07bc4eee6.tar.gz
nextcloud-server-194ef1a1715038c2193cee65a74372f07bc4eee6.zip
Adjust the code to use our interface and abstract
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/public/Migration')
-rw-r--r--lib/public/Migration/IMigrationStep.php5
-rw-r--r--lib/public/Migration/SimpleMigrationStep.php54
2 files changed, 57 insertions, 2 deletions
diff --git a/lib/public/Migration/IMigrationStep.php b/lib/public/Migration/IMigrationStep.php
index 3f95eed7598..aeb35bc8390 100644
--- a/lib/public/Migration/IMigrationStep.php
+++ b/lib/public/Migration/IMigrationStep.php
@@ -35,11 +35,12 @@ interface IMigrationStep {
public function preSchemaChange(IOutput $output);
/**
- * @param Schema $schema
+ * @param \Closure $schema The `\Closure` returns a `Schema`
* @param array $options
+ * @return null|Schema
* @since 13.0.0
*/
- public function changeSchema(Schema $schema, array $options);
+ public function changeSchema(\Closure $schema, array $options);
/**
* @param IOutput $output
diff --git a/lib/public/Migration/SimpleMigrationStep.php b/lib/public/Migration/SimpleMigrationStep.php
new file mode 100644
index 00000000000..681bd5c6b52
--- /dev/null
+++ b/lib/public/Migration/SimpleMigrationStep.php
@@ -0,0 +1,54 @@
+<?php
+/**
+ * @copyright Copyright (c) 2017 Joas Schilling <coding@schilljs.com>
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+
+namespace OCP\Migration;
+
+use Doctrine\DBAL\Schema\Schema;
+
+/**
+ * @since 13.0.0
+ */
+abstract class SimpleMigrationStep implements IMigrationStep {
+
+ /**
+ * @param IOutput $output
+ * @since 13.0.0
+ */
+ public function preSchemaChange(IOutput $output) {
+ }
+
+ /**
+ * @param \Closure $schema
+ * @param array $options
+ * @return null|Schema
+ * @since 13.0.0
+ */
+ public function changeSchema(\Closure $schema, array $options) {
+ return null;
+ }
+
+ /**
+ * @param IOutput $output
+ * @since 13.0.0
+ */
+ public function postSchemaChange(IOutput $output) {
+ }
+}