summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib/Migration
diff options
context:
space:
mode:
authorGeorg Ehrke <developer@georgehrke.com>2019-08-09 20:25:21 +0200
committerRoeland Jago Douma <roeland@famdouma.nl>2019-08-15 20:03:51 +0200
commitbcce568c6d892ccacc598c5d5bfa6b24c3284741 (patch)
tree5ecf26f407ac71ef7b97e99a9f3f026c3ec6974e /apps/dav/lib/Migration
parent7c4a8a3bdf6d8c0c12cf7cab93cc465c83c4ec8f (diff)
downloadnextcloud-server-bcce568c6d892ccacc598c5d5bfa6b24c3284741.tar.gz
nextcloud-server-bcce568c6d892ccacc598c5d5bfa6b24c3284741.zip
Support recurring events + repeating alarms
Signed-off-by: Georg Ehrke <developer@georgehrke.com>
Diffstat (limited to 'apps/dav/lib/Migration')
-rw-r--r--apps/dav/lib/Migration/Version1004Date20170825134824.php3
-rw-r--r--apps/dav/lib/Migration/Version1007Date20181005133326.php82
-rw-r--r--apps/dav/lib/Migration/Version1012Date20190808122342.php116
3 files changed, 117 insertions, 84 deletions
diff --git a/apps/dav/lib/Migration/Version1004Date20170825134824.php b/apps/dav/lib/Migration/Version1004Date20170825134824.php
index 26855c2e23e..f3165a0fe3d 100644
--- a/apps/dav/lib/Migration/Version1004Date20170825134824.php
+++ b/apps/dav/lib/Migration/Version1004Date20170825134824.php
@@ -324,8 +324,7 @@ class Version1004Date20170825134824 extends SimpleMigrationStep {
'length' => 1,
]);
$table->addColumn('stripattachments', 'smallint', [
- 'notnull' => false,
- 'length' => 1,
+
]);
$table->addColumn('lastmodified', 'integer', [
'notnull' => false,
diff --git a/apps/dav/lib/Migration/Version1007Date20181005133326.php b/apps/dav/lib/Migration/Version1007Date20181005133326.php
deleted file mode 100644
index 1e4cce950ac..00000000000
--- a/apps/dav/lib/Migration/Version1007Date20181005133326.php
+++ /dev/null
@@ -1,82 +0,0 @@
-<?php
-
-declare(strict_types=1);
-
-namespace OCA\DAV\Migration;
-
-use Closure;
-use OCP\DB\ISchemaWrapper;
-use OCP\Migration\SimpleMigrationStep;
-use OCP\Migration\IOutput;
-use Doctrine\DBAL\Types\Type;
-
-/**
- * Auto-generated migration step: Please modify to your needs!
- */
-class Version1007Date20181005133326 extends SimpleMigrationStep {
-
- /**
- * @param IOutput $output
- * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- * @param array $options
- */
- public function preSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
- }
-
- /**
- * @param IOutput $output
- * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- * @param array $options
- * @return null|ISchemaWrapper
- */
- public function changeSchema(IOutput $output, Closure $schemaClosure, array $options) {
- /** @var ISchemaWrapper $schema */
- $schema = $schemaClosure();
-
- if (!$schema->hasTable('calendar_reminders')) {
- $table = $schema->createTable('calendar_reminders');
-
- $table->addColumn('id', Type::BIGINT, [
- 'autoincrement' => true,
- 'notnull' => true,
- 'length' => 11,
- 'unsigned' => true,
- ]);
- $table->addColumn('uid', Type::STRING, [
- 'notnull' => true,
- 'length' => 255,
- ]);
- $table->addColumn('calendarid', Type::BIGINT, [
- 'notnull' => false,
- 'length' => 11,
- ]);
- $table->addColumn('objecturi', Type::STRING, [
- 'notnull' => true,
- 'length' => 255,
- ]);
- $table->addColumn('type', Type::STRING, [
- 'notnull' => true,
- 'length' => 255,
- ]);
- $table->addColumn('notificationdate', Type::DATETIME, [
- 'notnull' => false,
- ]);
- $table->addColumn('eventstartdate', Type::DATETIME, [
- 'notnull' => false,
- ]);
-
- $table->setPrimaryKey(['id']);
- $table->addIndex(['calendarid'], 'calendar_reminder_calendars');
-
- return $schema;
- }
- }
-
- /**
- * @param IOutput $output
- * @param Closure $schemaClosure The `\Closure` returns a `ISchemaWrapper`
- * @param array $options
- */
- public function postSchemaChange(IOutput $output, Closure $schemaClosure, array $options) {
- }
-}
diff --git a/apps/dav/lib/Migration/Version1012Date20190808122342.php b/apps/dav/lib/Migration/Version1012Date20190808122342.php
new file mode 100644
index 00000000000..4aa768e705d
--- /dev/null
+++ b/apps/dav/lib/Migration/Version1012Date20190808122342.php
@@ -0,0 +1,116 @@
+<?php
+declare(strict_types=1);
+/**
+ * @copyright 2019, Georg Ehrke <oc.list@georgehrke.com>
+ *
+ * @author Georg Ehrke <oc.list@georgehrke.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/>.
+ *
+ */
+namespace OCA\DAV\Migration;
+
+use Doctrine\DBAL\Types\Type;
+use OCP\DB\ISchemaWrapper;
+use OCP\Migration\SimpleMigrationStep;
+use OCP\Migration\IOutput;
+
+/**
+ * Auto-generated migration step: Please modify to your needs!
+ */
+class Version1012Date20190808122342 extends SimpleMigrationStep {
+
+ /**
+ * @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):?ISchemaWrapper {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ if (!$schema->hasTable('calendar_reminders')) {
+ $table = $schema->createTable('calendar_reminders');
+
+ $table->addColumn('id', Type::BIGINT, [
+ 'autoincrement' => true,
+ 'notnull' => true,
+ 'length' => 11,
+ 'unsigned' => true,
+ ]);
+ $table->addColumn('calendar_id', Type::BIGINT, [
+ 'notnull' => true,
+ 'length' => 11,
+ ]);
+ $table->addColumn('object_id', Type::BIGINT, [
+ 'notnull' => true,
+ 'length' => 11,
+ ]);
+ $table->addColumn('is_recurring', Type::SMALLINT, [
+ 'notnull' => true,
+ 'length' => 1,
+ ]);
+ $table->addColumn('uid', Type::STRING, [
+ 'notnull' => true,
+ 'length' => 255,
+ ]);
+ $table->addColumn('recurrence_id', Type::BIGINT, [
+ 'notnull' => false,
+ 'length' => 11,
+ 'unsigned' => true,
+ ]);
+ $table->addColumn('is_recurrence_exception', Type::SMALLINT, [
+ 'notnull' => true,
+ 'length' => 1,
+ ]);
+ $table->addColumn('event_hash', Type::STRING, [
+ 'notnull' => true,
+ 'length' => 255,
+ ]);
+ $table->addColumn('alarm_hash', Type::STRING, [
+ 'notnull' => true,
+ 'length' => 255,
+ ]);
+ $table->addColumn('type', Type::STRING, [
+ 'notnull' => true,
+ 'length' => 255,
+ ]);
+ $table->addColumn('is_relative', Type::SMALLINT, [
+ 'notnull' => true,
+ 'length' => 1,
+ ]);
+ $table->addColumn('notification_date', Type::BIGINT, [
+ 'notnull' => true,
+ 'length' => 11,
+ 'unsigned' => true,
+ ]);
+ $table->addColumn('is_repeat_based', Type::SMALLINT, [
+ 'notnull' => true,
+ 'length' => 1,
+ ]);
+
+ $table->setPrimaryKey(['id']);
+ $table->addIndex(['object_id'], 'calendar_reminder_objid');
+ $table->addIndex(['uid', 'recurrence_id'], 'calendar_reminder_uidrec');
+
+ return $schema;
+ }
+ }
+}