Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/mail.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2020-05-29 15:52:59 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-05-29 15:54:23 +0300
commit174ccb7f874004e619bc322560cbea3bd9fbcccd (patch)
tree0fd7300774cb3f9e9bb455a9e6723f4e1336753a /lib/Migration
parentb2c572e9aa07b400592e383862127201ce9ee533 (diff)
Wide the mail_messages message_id column
Message-IDs can be up to 995 chars according to the RFC. For some leeway I've bumped this to 1024. Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Migration')
-rw-r--r--lib/Migration/Version1040Date20200529124657.php35
1 files changed, 35 insertions, 0 deletions
diff --git a/lib/Migration/Version1040Date20200529124657.php b/lib/Migration/Version1040Date20200529124657.php
new file mode 100644
index 000000000..deb625728
--- /dev/null
+++ b/lib/Migration/Version1040Date20200529124657.php
@@ -0,0 +1,35 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OCA\Mail\Migration;
+
+use Closure;
+use OCP\DB\ISchemaWrapper;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+class Version1040Date20200529124657 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) {
+ /** @var ISchemaWrapper $schema */
+ $schema = $schemaClosure();
+
+ $messagesTable = $schema->getTable('mail_messages');
+ /**
+ * @see https://stackoverflow.com/questions/30079128/maximum-internet-email-message-id-length/34811337#34811337
+ */
+ $messagesTable
+ ->getColumn('message_id')
+ ->setLength(1024);
+
+ return $schema;
+ }
+}