aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_trashbin/lib/Migration
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_trashbin/lib/Migration')
-rw-r--r--apps/files_trashbin/lib/Migration/Version1010Date20200630192639.php25
-rw-r--r--apps/files_trashbin/lib/Migration/Version1020Date20240403003535.php42
2 files changed, 45 insertions, 22 deletions
diff --git a/apps/files_trashbin/lib/Migration/Version1010Date20200630192639.php b/apps/files_trashbin/lib/Migration/Version1010Date20200630192639.php
index 778bd76c218..3de908e2d78 100644
--- a/apps/files_trashbin/lib/Migration/Version1010Date20200630192639.php
+++ b/apps/files_trashbin/lib/Migration/Version1010Date20200630192639.php
@@ -3,33 +3,14 @@
declare(strict_types=1);
/**
- * @copyright Copyright (c) 2020 Joas Schilling <coding@schilljs.com>
- *
- * @author Christoph Wurst <christoph@winzerhof-wurst.at>
- * @author Joas Schilling <coding@schilljs.com>
- * @author Vincent Petry <vincent@nextcloud.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/>.
- *
+ * SPDX-FileCopyrightText: 2020 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
*/
namespace OCA\Files_Trashbin\Migration;
use Closure;
-use OCP\DB\Types;
use OCP\DB\ISchemaWrapper;
+use OCP\DB\Types;
use OCP\Migration\IOutput;
use OCP\Migration\SimpleMigrationStep;
diff --git a/apps/files_trashbin/lib/Migration/Version1020Date20240403003535.php b/apps/files_trashbin/lib/Migration/Version1020Date20240403003535.php
new file mode 100644
index 00000000000..3e85edf40b6
--- /dev/null
+++ b/apps/files_trashbin/lib/Migration/Version1020Date20240403003535.php
@@ -0,0 +1,42 @@
+<?php
+
+declare(strict_types=1);
+
+/**
+ * SPDX-FileCopyrightText: 2024 Nextcloud GmbH and Nextcloud contributors
+ * SPDX-License-Identifier: AGPL-3.0-or-later
+ */
+
+namespace OCA\Files_Trashbin\Migration;
+
+use Closure;
+use OCP\DB\ISchemaWrapper;
+use OCP\DB\Types;
+use OCP\Migration\Attributes\AddColumn;
+use OCP\Migration\Attributes\ColumnType;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+#[AddColumn(table: 'files_trash', name: 'deleted_by', type: ColumnType::STRING)]
+class Version1020Date20240403003535 extends SimpleMigrationStep {
+
+ /**
+ * @param Closure(): ISchemaWrapper $schemaClosure
+ */
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ if (!$schema->hasTable('files_trash')) {
+ return null;
+ }
+
+ $table = $schema->getTable('files_trash');
+ $table->addColumn('deleted_by', Types::STRING, [
+ 'notnull' => false,
+ 'length' => 64,
+ ]);
+
+ return $schema;
+ }
+}