aboutsummaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Migration/Version1018Date20210312100735.php
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2021-03-12 11:20:04 +0100
committerChristoph Wurst <christoph@winzerhof-wurst.at>2021-05-31 07:49:19 +0200
commitd6d8e9215c69a9e8d4bfa2035c657b0a037f3a2f (patch)
tree942254503672d6ab3e0b6c8fca0bd4053db352b9 /apps/dav/lib/Migration/Version1018Date20210312100735.php
parent9e596dd0cf455dc1639141c695f89c7d936f4c0c (diff)
downloadnextcloud-server-d6d8e9215c69a9e8d4bfa2035c657b0a037f3a2f.tar.gz
nextcloud-server-d6d8e9215c69a9e8d4bfa2035c657b0a037f3a2f.zip
Add a trashbin for calendars and calendar objects
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'apps/dav/lib/Migration/Version1018Date20210312100735.php')
-rw-r--r--apps/dav/lib/Migration/Version1018Date20210312100735.php45
1 files changed, 45 insertions, 0 deletions
diff --git a/apps/dav/lib/Migration/Version1018Date20210312100735.php b/apps/dav/lib/Migration/Version1018Date20210312100735.php
new file mode 100644
index 00000000000..0bf160fb517
--- /dev/null
+++ b/apps/dav/lib/Migration/Version1018Date20210312100735.php
@@ -0,0 +1,45 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OCA\DAV\Migration;
+
+use Closure;
+use OCP\DB\ISchemaWrapper;
+use OCP\DB\Types;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+class Version1018Date20210312100735 extends SimpleMigrationStep {
+
+ /**
+ * @param IOutput $output
+ * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
+ * @param array $options
+ * @return ISchemaWrapper
+ */
+ public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ $calendarsTable = $schema->getTable('calendars');
+ $calendarsTable->addColumn('deleted_at', Types::INTEGER, [
+ 'notnull' => false,
+ 'length' => 4,
+ 'unsigned' => true,
+ ]);
+ $calendarsTable->addIndex([
+ 'principaluri',
+ 'deleted_at',
+ ], 'cals_princ_del_idx');
+
+ $calendarObjectsTable = $schema->getTable('calendarobjects');
+ $calendarObjectsTable->addColumn('deleted_at', Types::INTEGER, [
+ 'notnull' => false,
+ 'length' => 4,
+ 'unsigned' => true,
+ ]);
+
+ return $schema;
+ }
+}