diff options
author | Christoph Wurst <christoph@winzerhof-wurst.at> | 2020-11-19 12:47:50 +0300 |
---|---|---|
committer | GretaD <gretadoci@gmail.com> | 2020-12-03 15:57:54 +0300 |
commit | 87d99c0e5629ae4551d3776bef554dd3c448aebf (patch) | |
tree | ccbd7bb5890fca25b51a10a824b0b4dcd9bf6ffc /lib/Migration | |
parent | 44a004276a21e57aeca78b71599b5ec3aa7d5d13 (diff) |
Allow always showing images from trusted senders
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/Migration')
-rw-r--r-- | lib/Migration/Version1080Date20201119084820.php | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/Migration/Version1080Date20201119084820.php b/lib/Migration/Version1080Date20201119084820.php new file mode 100644 index 000000000..92d908d03 --- /dev/null +++ b/lib/Migration/Version1080Date20201119084820.php @@ -0,0 +1,43 @@ +<?php + +declare(strict_types=1); + +namespace OCA\Mail\Migration; + +use Closure; +use OCP\DB\ISchemaWrapper; +use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; + +class Version1080Date20201119084820 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(); + + $table = $schema->createTable('mail_trusted_senders'); + $table->addColumn('id', 'integer', [ + 'autoincrement' => true, + 'notnull' => true, + 'length' => 4, + ]); + $table->addColumn('email', 'string', [ + 'notnull' => true, + 'length' => 255, + ]); + $table->addColumn('user_id', 'string', [ + 'notnull' => true, + 'length' => 64, + ]); + $table->setPrimaryKey(['id']); + $table->addUniqueIndex(['email', 'user_id'], 'mail_trusted_sender_uniq'); + + return $schema; + } +} |