2017-06-01 10:56:34 -04:00
|
|
|
<?php
|
2020-10-15 04:58:51 -04:00
|
|
|
|
|
|
|
|
declare(strict_types=1);
|
2017-06-01 10:56:34 -04:00
|
|
|
/**
|
2024-05-23 03:26:56 -04:00
|
|
|
* SPDX-FileCopyrightText: 2017 Nextcloud GmbH and Nextcloud contributors
|
|
|
|
|
* SPDX-License-Identifier: AGPL-3.0-or-later
|
2017-06-01 10:56:34 -04:00
|
|
|
*/
|
|
|
|
|
namespace OCP\Migration;
|
|
|
|
|
|
2022-12-06 05:40:10 -05:00
|
|
|
use Closure;
|
2018-01-17 05:35:20 -05:00
|
|
|
use OCP\DB\ISchemaWrapper;
|
2017-06-01 10:56:34 -04:00
|
|
|
|
|
|
|
|
/**
|
2026-02-12 05:25:03 -05:00
|
|
|
* This interface represents a database migration step.
|
|
|
|
|
*
|
|
|
|
|
* To implement a migration step, you must extend \OCP\Migration\SimpleMigrationStep
|
|
|
|
|
*
|
|
|
|
|
* You should additionally add some attributes found in the
|
|
|
|
|
* \OCP\Migration\Attributes namespace to the migration, to describe the change
|
|
|
|
|
* that will be done by the migration step to the admin.
|
|
|
|
|
*
|
2017-06-01 10:56:34 -04:00
|
|
|
* @since 13.0.0
|
|
|
|
|
*/
|
|
|
|
|
interface IMigrationStep {
|
2018-04-12 11:47:40 -04:00
|
|
|
/**
|
2022-12-06 05:40:10 -05:00
|
|
|
* Human-readable name of the migration step
|
2018-04-12 11:47:40 -04:00
|
|
|
*
|
|
|
|
|
* @since 14.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function name(): string;
|
|
|
|
|
|
|
|
|
|
/**
|
2022-12-06 05:40:10 -05:00
|
|
|
* Human-readable description of the migration step
|
2018-04-12 11:47:40 -04:00
|
|
|
*
|
|
|
|
|
* @since 14.0.0
|
|
|
|
|
*/
|
|
|
|
|
public function description(): string;
|
2017-06-01 10:56:34 -04:00
|
|
|
|
|
|
|
|
/**
|
2026-02-12 05:25:03 -05:00
|
|
|
* @param Closure():ISchemaWrapper $schemaClosure
|
|
|
|
|
* @param array{tablePrefix?: string} $options
|
2017-06-01 10:56:34 -04:00
|
|
|
* @since 13.0.0
|
|
|
|
|
*/
|
2022-12-06 05:40:10 -05:00
|
|
|
public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options);
|
2017-06-01 10:56:34 -04:00
|
|
|
|
|
|
|
|
/**
|
2026-02-12 05:25:03 -05:00
|
|
|
* @param Closure():ISchemaWrapper $schemaClosure
|
|
|
|
|
* @param array{tablePrefix?: string} $options
|
2018-01-17 05:35:20 -05:00
|
|
|
* @return null|ISchemaWrapper
|
2017-06-01 10:56:34 -04:00
|
|
|
* @since 13.0.0
|
|
|
|
|
*/
|
2022-12-06 05:40:10 -05:00
|
|
|
public function changeSchema(IOutput $output, Closure $schemaClosure, array $options);
|
2017-06-01 10:56:34 -04:00
|
|
|
|
|
|
|
|
/**
|
2026-02-12 05:25:03 -05:00
|
|
|
* @param Closure():ISchemaWrapper $schemaClosure
|
|
|
|
|
* @param array{tablePrefix?: string} $options
|
2017-06-01 10:56:34 -04:00
|
|
|
* @since 13.0.0
|
|
|
|
|
*/
|
2022-12-06 05:40:10 -05:00
|
|
|
public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options);
|
2017-06-01 10:56:34 -04:00
|
|
|
}
|