diff options
| author | anatawa12 <anatawa12@icloud.com> | 2024-05-20 18:08:20 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-05-20 18:08:20 +0900 |
| commit | f6df94070b0fc1ca862d560b17488bd718c2ec85 (patch) | |
| tree | 77cafdee3d7134951f9c23aeb9580eac7db11c42 /packages/backend/src/models | |
| parent | fix notification limit with exclude/include types (#13836) (diff) | |
| download | misskey-f6df94070b0fc1ca862d560b17488bd718c2ec85.tar.gz misskey-f6df94070b0fc1ca862d560b17488bd718c2ec85.tar.bz2 misskey-f6df94070b0fc1ca862d560b17488bd718c2ec85.zip | |
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
Diffstat (limited to 'packages/backend/src/models')
| -rw-r--r-- | packages/backend/src/models/Poll.ts | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/packages/backend/src/models/Poll.ts b/packages/backend/src/models/Poll.ts index c2693dbb19..ca985c8b24 100644 --- a/packages/backend/src/models/Poll.ts +++ b/packages/backend/src/models/Poll.ts @@ -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>) { |