-
Notifications
You must be signed in to change notification settings - Fork 314
Forward inline images #12651
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Forward inline images #12651
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,47 @@ | ||||||||||||||||||||||||||||||||||
| <?php | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| declare(strict_types=1); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||
| * SPDX-FileCopyrightText: 2026 Nextcloud GmbH and Nextcloud contributors | ||||||||||||||||||||||||||||||||||
| * SPDX-License-Identifier: AGPL-3.0-or-later | ||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| namespace OCA\Mail\Migration; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| use Closure; | ||||||||||||||||||||||||||||||||||
| use OCP\DB\ISchemaWrapper; | ||||||||||||||||||||||||||||||||||
| use OCP\DB\Types; | ||||||||||||||||||||||||||||||||||
| use OCP\Migration\Attributes\ModifyColumn; | ||||||||||||||||||||||||||||||||||
| use OCP\Migration\IOutput; | ||||||||||||||||||||||||||||||||||
| use OCP\Migration\SimpleMigrationStep; | ||||||||||||||||||||||||||||||||||
| use Override; | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||
| * @psalm-api | ||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
| #[ModifyColumn( | ||||||||||||||||||||||||||||||||||
| table: 'mail_attachments', | ||||||||||||||||||||||||||||||||||
| description: 'Add column to store content-id and content-disposition', ) | ||||||||||||||||||||||||||||||||||
| ] | ||||||||||||||||||||||||||||||||||
| class Version5008Date20260320125737 extends SimpleMigrationStep { | ||||||||||||||||||||||||||||||||||
| /** | ||||||||||||||||||||||||||||||||||
| * @param Closure(): ISchemaWrapper $schemaClosure | ||||||||||||||||||||||||||||||||||
| */ | ||||||||||||||||||||||||||||||||||
| #[Override] | ||||||||||||||||||||||||||||||||||
| public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||||||||||||||||||||||||||||||||||
| $schema = $schemaClosure(); | ||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||
| if ($schema->hasTable('mail_attachments')) { | ||||||||||||||||||||||||||||||||||
| $attachmentsTable = $schema->getTable('mail_attachments'); | ||||||||||||||||||||||||||||||||||
| $attachmentsTable->addColumn('content_id', Types::STRING, [ | ||||||||||||||||||||||||||||||||||
| 'notnull' => false, | ||||||||||||||||||||||||||||||||||
| ]); | ||||||||||||||||||||||||||||||||||
| $attachmentsTable->addColumn('disposition', Types::STRING, [ | ||||||||||||||||||||||||||||||||||
| 'notnull' => false, | ||||||||||||||||||||||||||||||||||
| ]); | ||||||||||||||||||||||||||||||||||
|
Comment on lines
+37
to
+42
|
||||||||||||||||||||||||||||||||||
| $attachmentsTable->addColumn('content_id', Types::STRING, [ | |
| 'notnull' => false, | |
| ]); | |
| $attachmentsTable->addColumn('disposition', Types::STRING, [ | |
| 'notnull' => false, | |
| ]); | |
| if (!$attachmentsTable->hasColumn('content_id')) { | |
| $attachmentsTable->addColumn('content_id', Types::STRING, [ | |
| 'notnull' => false, | |
| ]); | |
| } | |
| if (!$attachmentsTable->hasColumn('disposition')) { | |
| $attachmentsTable->addColumn('disposition', Types::STRING, [ | |
| 'notnull' => false, | |
| ]); | |
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NoAdminRequiredis imported but not used anywhere in this controller (the file still uses@NoAdminRequireddocblock annotations, not the attribute). Please drop the unused import to avoid dead code and keep imports clean.