chore: preserve notes with local reactions (#16412)
This commit is contained in:
parent
9ea7340da6
commit
fea9f27fd6
|
@ -86,6 +86,7 @@ export class CleanRemoteNotesProcessorService {
|
||||||
'note."userHost" IS NOT NULL',
|
'note."userHost" IS NOT NULL',
|
||||||
'NOT EXISTS (SELECT 1 FROM user_note_pining WHERE "noteId" = note."id")',
|
'NOT EXISTS (SELECT 1 FROM user_note_pining WHERE "noteId" = note."id")',
|
||||||
'NOT EXISTS (SELECT 1 FROM note_favorite WHERE "noteId" = note."id")',
|
'NOT EXISTS (SELECT 1 FROM note_favorite WHERE "noteId" = note."id")',
|
||||||
|
'NOT EXISTS (SELECT 1 FROM note_reaction INNER JOIN "user" ON note_reaction."userId" = "user".id WHERE note_reaction."noteId" = note."id" AND "user"."host" IS NULL)',
|
||||||
].join(' AND ');
|
].join(' AND ');
|
||||||
|
|
||||||
const minId = (await this.notesRepository.createQueryBuilder('note')
|
const minId = (await this.notesRepository.createQueryBuilder('note')
|
||||||
|
|
Loading…
Reference in New Issue