diff options
author | Joas Schilling <coding@schilljs.com> | 2017-06-01 16:56:34 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2017-07-05 13:01:19 +0200 |
commit | 15eec7b83c6198a124c2720e8ecc988605428f54 (patch) | |
tree | 62f47bb629b621b883efb17c02194972ba20a71f /lib/public | |
parent | efa52ec1113eeccbd3935a8c96ea23c47ca190ab (diff) | |
download | nextcloud-server-15eec7b83c6198a124c2720e8ecc988605428f54.tar.gz nextcloud-server-15eec7b83c6198a124c2720e8ecc988605428f54.zip |
Start migrations
Fixme:
- Install and update of apps
- No revert on live systems (debug only)
- Service adjustment to our interface
- Loading via autoloader
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/public')
-rw-r--r-- | lib/public/IDBConnection.php | 17 | ||||
-rw-r--r-- | lib/public/Migration/IMigrationStep.php | 49 |
2 files changed, 66 insertions, 0 deletions
diff --git a/lib/public/IDBConnection.php b/lib/public/IDBConnection.php index efd65d55f7e..56cf50c5fb3 100644 --- a/lib/public/IDBConnection.php +++ b/lib/public/IDBConnection.php @@ -34,6 +34,7 @@ // use OCP namespace for all classes that are considered public. // This means that they should be used by apps instead of the internal ownCloud classes namespace OCP; +use Doctrine\DBAL\Schema\Schema; use OCP\DB\QueryBuilder\IQueryBuilder; /** @@ -259,4 +260,20 @@ interface IDBConnection { * @since 11.0.0 */ public function supports4ByteText(); + + /** + * Create the schema of the connected database + * + * @return Schema + * @since 13.0.0 + */ + public function createSchema(); + + /** + * Migrate the database to the given schema + * + * @param Schema $toSchema + * @since 13.0.0 + */ + public function migrateToSchema(Schema $toSchema); } diff --git a/lib/public/Migration/IMigrationStep.php b/lib/public/Migration/IMigrationStep.php new file mode 100644 index 00000000000..3f95eed7598 --- /dev/null +++ b/lib/public/Migration/IMigrationStep.php @@ -0,0 +1,49 @@ +<?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 + */ +interface IMigrationStep { + + /** + * @param IOutput $output + * @since 13.0.0 + */ + public function preSchemaChange(IOutput $output); + + /** + * @param Schema $schema + * @param array $options + * @since 13.0.0 + */ + public function changeSchema(Schema $schema, array $options); + + /** + * @param IOutput $output + * @since 13.0.0 + */ + public function postSchemaChange(IOutput $output); +} |