diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2020-09-24 19:24:51 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-24 19:24:51 +0300 |
commit | 9862e2375b73fb88b44f898d90c4fa89aac4ed4f (patch) | |
tree | d3a694c4fd9a91ca75aaf1cd95438754699f578e /lib/Migration | |
parent | 306367f91a4ae1f26ef307116f32a0880caa40c7 (diff) | |
parent | 356602c357c307609e7cecd540fbb9e5c9c85ce1 (diff) |
Merge pull request #3637 from nextcloud/fix/3297/set-mime-type-to-attachmentsv1.5.0-beta3
Gets mime type of uploaded attachments
Diffstat (limited to 'lib/Migration')
-rw-r--r-- | lib/Migration/Version1060Date20200921141700.php | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/lib/Migration/Version1060Date20200921141700.php b/lib/Migration/Version1060Date20200921141700.php new file mode 100644 index 000000000..8abfc8aa3 --- /dev/null +++ b/lib/Migration/Version1060Date20200921141700.php @@ -0,0 +1,32 @@ +<?php + +declare(strict_types=1); + +namespace OCA\Mail\Migration; + +use Closure; +use OCP\DB\ISchemaWrapper; +use OCP\Migration\IOutput; +use OCP\Migration\SimpleMigrationStep; + +class Version1060Date20200921141700 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(); + + $accountsTable = $schema->getTable('mail_attachments'); + $accountsTable->addColumn('mime_type', 'string', [ + 'notnull' => false, + 'length' => 255, // RFC 4288 defines max size + ]); + + return $schema; + } +} |