aboutsummaryrefslogtreecommitdiffstats
path: root/core/Migrations/Version14000Date20180129121024.php
blob: 6da5f2602e89928aff4e39e6f1879a953c5d645b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?php
/**
 * SPDX-FileCopyrightText: 2018 Nextcloud GmbH and Nextcloud contributors
 * SPDX-License-Identifier: AGPL-3.0-or-later
 */
namespace OC\Core\Migrations;

use OCP\DB\ISchemaWrapper;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;

/**
 * Delete the admin|personal sections and settings tables
 */
class Version14000Date20180129121024 extends SimpleMigrationStep {
	public function name(): string {
		return 'Drop obsolete settings tables';
	}

	public function description(): string {
		return 'Drops the following obsolete tables: "admin_sections", "admin_settings", "personal_sections" and "personal_settings"';
	}

	/**
	 * @param IOutput $output
	 * @param \Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
	 * @param array $options
	 * @return null|ISchemaWrapper
	 * @since 13.0.0
	 */
	public function changeSchema(IOutput $output, \Closure $schemaClosure, array $options) {
		/** @var ISchemaWrapper $schema */
		$schema = $schemaClosure();

		$schema->dropTable('admin_sections');
		$schema->dropTable('admin_settings');
		$schema->dropTable('personal_sections');
		$schema->dropTable('personal_settings');

		return $schema;
	}
}