aboutsummaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorStephan Orbaugh <62374139+sorbaugh@users.noreply.github.com>2024-07-30 15:54:56 +0200
committerGitHub <noreply@github.com>2024-07-30 15:54:56 +0200
commit18c0bcb2da2da1e046163e006ba581be165caed8 (patch)
tree38c7b98d59c70543632f6d3b1c53d40eced2df05 /apps
parent0705b6af4a9cf6be0ca691298c01b8d8b5fe6ba2 (diff)
parenta9e1dc668875f4247f6331096248b099afff5ae6 (diff)
downloadnextcloud-server-18c0bcb2da2da1e046163e006ba581be165caed8.tar.gz
nextcloud-server-18c0bcb2da2da1e046163e006ba581be165caed8.zip
Merge pull request #46476 from nextcloud/enh/noid/migration-attributes
Migration Attributes
Diffstat (limited to 'apps')
-rw-r--r--apps/testing/composer/composer/autoload_classmap.php1
-rw-r--r--apps/testing/composer/composer/autoload_static.php1
-rw-r--r--apps/testing/lib/Migration/Version30000Date20240102030405.php41
3 files changed, 43 insertions, 0 deletions
diff --git a/apps/testing/composer/composer/autoload_classmap.php b/apps/testing/composer/composer/autoload_classmap.php
index 079f8877881..6dce2e26361 100644
--- a/apps/testing/composer/composer/autoload_classmap.php
+++ b/apps/testing/composer/composer/autoload_classmap.php
@@ -16,6 +16,7 @@ return array(
'OCA\\Testing\\Listener\\RegisterDeclarativeSettingsListener' => $baseDir . '/../lib/Listener/RegisterDeclarativeSettingsListener.php',
'OCA\\Testing\\Listener\\SetDeclarativeSettingsValueListener' => $baseDir . '/../lib/Listener/SetDeclarativeSettingsValueListener.php',
'OCA\\Testing\\Locking\\FakeDBLockingProvider' => $baseDir . '/../lib/Locking/FakeDBLockingProvider.php',
+ 'OCA\\Testing\\Migration\\Version30000Date20240102030405' => $baseDir . '/../lib/Migration/Version30000Date20240102030405.php',
'OCA\\Testing\\Provider\\FakeText2ImageProvider' => $baseDir . '/../lib/Provider/FakeText2ImageProvider.php',
'OCA\\Testing\\Provider\\FakeTextProcessingProvider' => $baseDir . '/../lib/Provider/FakeTextProcessingProvider.php',
'OCA\\Testing\\Provider\\FakeTextProcessingProviderSync' => $baseDir . '/../lib/Provider/FakeTextProcessingProviderSync.php',
diff --git a/apps/testing/composer/composer/autoload_static.php b/apps/testing/composer/composer/autoload_static.php
index 2332da70da9..3be58e04289 100644
--- a/apps/testing/composer/composer/autoload_static.php
+++ b/apps/testing/composer/composer/autoload_static.php
@@ -31,6 +31,7 @@ class ComposerStaticInitTesting
'OCA\\Testing\\Listener\\RegisterDeclarativeSettingsListener' => __DIR__ . '/..' . '/../lib/Listener/RegisterDeclarativeSettingsListener.php',
'OCA\\Testing\\Listener\\SetDeclarativeSettingsValueListener' => __DIR__ . '/..' . '/../lib/Listener/SetDeclarativeSettingsValueListener.php',
'OCA\\Testing\\Locking\\FakeDBLockingProvider' => __DIR__ . '/..' . '/../lib/Locking/FakeDBLockingProvider.php',
+ 'OCA\\Testing\\Migration\\Version30000Date20240102030405' => __DIR__ . '/..' . '/../lib/Migration/Version30000Date20240102030405.php',
'OCA\\Testing\\Provider\\FakeText2ImageProvider' => __DIR__ . '/..' . '/../lib/Provider/FakeText2ImageProvider.php',
'OCA\\Testing\\Provider\\FakeTextProcessingProvider' => __DIR__ . '/..' . '/../lib/Provider/FakeTextProcessingProvider.php',
'OCA\\Testing\\Provider\\FakeTextProcessingProviderSync' => __DIR__ . '/..' . '/../lib/Provider/FakeTextProcessingProviderSync.php',
diff --git a/apps/testing/lib/Migration/Version30000Date20240102030405.php b/apps/testing/lib/Migration/Version30000Date20240102030405.php
new file mode 100644
index 00000000000..e7b6bdcd618
--- /dev/null
+++ b/apps/testing/lib/Migration/Version30000Date20240102030405.php
@@ -0,0 +1,41 @@
+<?php
+
+declare(strict_types=1);
+/**
+ * SPDX-FileCopyrightText: 2019 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCA\Testing\Migration;
+
+use Closure;
+use OCP\Migration\Attributes\AddColumn;
+use OCP\Migration\Attributes\AddIndex;
+use OCP\Migration\Attributes\ColumnType;
+use OCP\Migration\Attributes\CreateTable;
+use OCP\Migration\Attributes\DropColumn;
+use OCP\Migration\Attributes\DropIndex;
+use OCP\Migration\Attributes\DropTable;
+use OCP\Migration\Attributes\IndexType;
+use OCP\Migration\Attributes\ModifyColumn;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+#[DropTable(table: 'old_table')]
+#[CreateTable(table: 'new_table', description: 'Table is used to store things, but also to get more things', notes: ['this is a notice', 'and another one, if really needed'])]
+#[AddColumn(table: 'my_table')]
+#[AddColumn(table: 'my_table', name: 'another_field')]
+#[AddColumn(table: 'other_table', name: 'last_one', type: ColumnType::DATE)]
+#[AddIndex(table: 'my_table')]
+#[AddIndex(table: 'my_table', type: IndexType::PRIMARY)]
+#[DropColumn(table: 'other_table')]
+#[DropColumn(table: 'other_table', name: 'old_column', description: 'field is not used anymore and replaced by \'last_one\'')]
+#[DropIndex(table: 'other_table')]
+#[ModifyColumn(table: 'other_table')]
+#[ModifyColumn(table: 'other_table', name: 'this_field')]
+#[ModifyColumn(table: 'other_table', name: 'this_field', type: ColumnType::BIGINT)]
+class Version30000Date20240102030405 extends SimpleMigrationStep {
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
+ return null;
+ }
+}