diff options
| author | anatawa12 <anatawa12@icloud.com> | 2025-07-15 09:20:48 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-07-15 09:20:48 +0900 |
| commit | 08cc5a99bb026a9e9f308254ae814f1b9a2f620d (patch) | |
| tree | cb2a7c94f29dcaf31ee0fce4fa74e5b3bb808c00 /packages/backend/src/models/NoteDraft.ts | |
| parent | Bump version to 2025.7.0-beta.1 (diff) | |
| download | misskey-08cc5a99bb026a9e9f308254ae814f1b9a2f620d.tar.gz misskey-08cc5a99bb026a9e9f308254ae814f1b9a2f620d.tar.bz2 misskey-08cc5a99bb026a9e9f308254ae814f1b9a2f620d.zip | |
Don't remove notes when reply / renote is removed (#16287)
* chore: make NO ACTION on channel/reply/renote removal
* chore(docs): add description to show a possibility of reply null with replyId non-null
* fix: packing NoteDraft fails when reply / renote is removed
* feat: show drafts targeting removed renote / reply as "削除された投稿への投稿"
Diffstat (limited to 'packages/backend/src/models/NoteDraft.ts')
| -rw-r--r-- | packages/backend/src/models/NoteDraft.ts | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/packages/backend/src/models/NoteDraft.ts b/packages/backend/src/models/NoteDraft.ts index edae254bb8..39d85e53dc 100644 --- a/packages/backend/src/models/NoteDraft.ts +++ b/packages/backend/src/models/NoteDraft.ts @@ -24,8 +24,9 @@ export class MiNoteDraft { }) public replyId: MiNote['id'] | null; + // There is a possibility that replyId is not null but reply is null when the reply note is deleted. @ManyToOne(type => MiNote, { - onDelete: 'CASCADE', + createForeignKeyConstraints: false, }) @JoinColumn() public reply: MiNote | null; @@ -38,8 +39,9 @@ export class MiNoteDraft { }) public renoteId: MiNote['id'] | null; + // There is a possibility that renoteId is not null but renote is null when the renote note is deleted. @ManyToOne(type => MiNote, { - onDelete: 'CASCADE', + createForeignKeyConstraints: false, }) @JoinColumn() public renote: MiNote | null; @@ -114,8 +116,10 @@ export class MiNoteDraft { }) public channelId: MiChannel['id'] | null; + // There is a possibility that channelId is not null but channel is null when the channel is deleted. + // (deleting channel is not implemented so it's not happening now but may happen in the future) @ManyToOne(type => MiChannel, { - onDelete: 'CASCADE', + createForeignKeyConstraints: false, }) @JoinColumn() public channel: MiChannel | null; |