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-02-07 14:52:35 +0300
committerChristoph Wurst <christoph@winzerhof-wurst.at>2020-02-10 15:32:34 +0300
commit90a90dd24d21da7130cee7a514ca348f0de1fb24 (patch)
tree437ef244f08481e3970684e07901169f47b25712 /lib/Migration
parentec940371233c2c3630d5fb48e65e9e75203cbbc1 (diff)
Add a lazy structure analyzation to get the attachments icon back
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Migration')
-rw-r--r--lib/Migration/Version1020Date20200206134751.php41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/Migration/Version1020Date20200206134751.php b/lib/Migration/Version1020Date20200206134751.php
new file mode 100644
index 000000000..658cf2891
--- /dev/null
+++ b/lib/Migration/Version1020Date20200206134751.php
@@ -0,0 +1,41 @@
+<?php
+
+declare(strict_types=1);
+
+namespace OCA\Mail\Migration;
+
+use Closure;
+use OCP\DB\ISchemaWrapper;
+use OCP\Migration\IOutput;
+use OCP\Migration\SimpleMigrationStep;
+
+class Version1020Date20200206134751 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');
+ $messagesTable->addColumn('structure_analyzed', 'boolean', [
+ 'notnull' => true,
+ 'default' => false,
+ ]);
+ $messagesTable->addColumn('flag_attachments', 'boolean', [
+ 'notnull' => false,
+ ]);
+ $messagesTable->addColumn('preview_text', 'string', [
+ 'notnull' => false,
+ 'length' => 255,
+ ]);
+
+ return $schema;
+ }
+
+}