diff options
author | Maxence Lange <maxence@artificial-owl.com> | 2024-07-29 10:14:29 -0100 |
---|---|---|
committer | Maxence Lange <maxence@artificial-owl.com> | 2024-07-29 12:44:52 -0100 |
commit | ad490c963bd88359a714fb2f1786aaf8c00ae17c (patch) | |
tree | 8dddff519102dbb73377fee762c91ff6792a1ad5 /apps/testing/lib | |
parent | 7c1ee524be784bf54d4c09d1310c182593d8b2f2 (diff) | |
download | nextcloud-server-ad490c963bd88359a714fb2f1786aaf8c00ae17c.tar.gz nextcloud-server-ad490c963bd88359a714fb2f1786aaf8c00ae17c.zip |
feat(migration-attributes): tests
Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
Diffstat (limited to 'apps/testing/lib')
-rw-r--r-- | apps/testing/lib/Migration/Version30000Date20240102030405.php | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/apps/testing/lib/Migration/Version30000Date20240102030405.php b/apps/testing/lib/Migration/Version30000Date20240102030405.php new file mode 100644 index 00000000000..bacb187cb37 --- /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('old_table')] +#[CreateTable('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('my_table')] +#[AddColumn('my_table', 'another_field')] +#[AddColumn('other_table', 'last_one', ColumnType::DATE)] +#[AddIndex('my_table')] +#[AddIndex('my_table', IndexType::PRIMARY)] +#[DropColumn('other_table')] +#[DropColumn('other_table', 'old_column', description: 'field is not used anymore and replaced by \'last_one\'')] +#[DropIndex('other_table')] +#[ModifyColumn('other_table')] +#[ModifyColumn('other_table', 'this_field')] +#[ModifyColumn('other_table', 'this_field', ColumnType::BIGINT)] +class Version30000Date20240102030405 extends SimpleMigrationStep { + public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) { + return null; + } +} |