-
Couldn't load subscription status.
- Fork 287
Enforce NOT NULL and Remove Default Value for mail_attachments.created_at Column #11943
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
Merged
kesselb
merged 13 commits into
nextcloud:bug/5901/set-created-at-on-insert
from
dhairyajangir:fix/attachment-createdat-timestamp-and-migration
Oct 23, 2025
+71
−6
Merged
Changes from all commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
804f18c
Migration: Enforce NOT NULL and remove default on mail_attachments.cr…
dhairyajangir f75ccb4
Fix: Use tabs instead of spaces for indentation
dhairyajangir b403409
Merge branch 'nextcloud:main' into fix/attachment-createdat-timestamp…
dhairyajangir e6a50fd
fix: set createdAt timestamp for local attachments
dhairyajangir 0e6f1e5
Update lib/Migration/Version5007Date20251019000000.php
dhairyajangir 2e0c502
Update lib/Migration/Version5007Date20251019000000.php
dhairyajangir 8ef9ae9
Update lib/Migration/Version5007Date20251019000000.php
dhairyajangir 11f5f97
Update lib/Migration/Version5007Date20251019000000.php
dhairyajangir 8f61520
Merge branch 'main' into fix/attachment-createdat-timestamp-and-migra…
dhairyajangir f9e5510
Update lib/Migration/Version5007Date20251019000000.php
dhairyajangir cc2a93c
Update lib/Migration/Version5007Date20251019000000.php
dhairyajangir 4dfb510
Merge branch 'main' into fix/attachment-createdat-timestamp-and-migra…
dhairyajangir 91ade16
chore: bump version to 5.6.0-alpha.4
dhairyajangir File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| <?php | ||
|
|
||
| declare(strict_types=1); | ||
|
|
||
| /** | ||
| * SPDX-FileCopyrightText: 2025 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\Migration\IOutput; | ||
| use OCP\Migration\SimpleMigrationStep; | ||
|
|
||
| class Version5006Date20251019000000 extends SimpleMigrationStep { | ||
| /** | ||
| * @param Closure(): ISchemaWrapper $schemaClosure | ||
| */ | ||
| #[\Override] | ||
| public function changeSchema(IOutput $output, Closure $schemaClosure, array $options): ?ISchemaWrapper { | ||
| $schema = $schemaClosure(); | ||
|
|
||
| if (!$schema->hasTable('mail_attachments')) { | ||
| return $schema; | ||
| } | ||
|
|
||
| $attachments = $schema->getTable('mail_attachments'); | ||
|
|
||
| // Ensure created_at is NOT NULL and has no default, so app must set it. | ||
| if ($attachments->hasColumn('created_at')) { | ||
| $attachments->modifyColumn('created_at', [ | ||
| 'default' => null, | ||
| ]); | ||
| } | ||
|
|
||
| return $schema; | ||
| } | ||
| } | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Please increase the
versioninappinfo/info.xmlto5.6.0-alpha.4(otherwise the migration will not run).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.
sure :)
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.
91ade16