Exclude channel notes from featured polls (#13838)

* feat(backend): add `channelId` to `MiPoll` as a Denormalized field

* feat(backend): option to exclude polls in channels

* chore: exclude channel notes from featured polls

* docs(changelog): みつけるのアンケート欄にてチャンネルのアンケートが含まれてしまう問題を修正

* fix: missing license header
This commit is contained in:
anatawa12 2024-05-20 18:08:20 +09:00 committed by GitHub
parent 4d0db37d2e
commit f6df94070b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 44 additions and 0 deletions

View file

@ -8,6 +8,7 @@ import { noteVisibilities } from '@/types.js';
import { id } from './util/id.js';
import { MiNote } from './Note.js';
import type { MiUser } from './User.js';
import type { MiChannel } from "@/models/Channel.js";
@Entity('poll')
export class MiPoll {
@ -58,6 +59,14 @@ export class MiPoll {
comment: '[Denormalized]',
})
public userHost: string | null;
@Index()
@Column({
...id(),
nullable: true,
comment: '[Denormalized]',
})
public channelId: MiChannel['id'] | null;
//#endregion
constructor(data: Partial<MiPoll>) {