diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-31 15:01:56 +0900 |
|---|---|---|
| committer | syuilo <Syuilotan@yahoo.co.jp> | 2023-03-31 15:01:56 +0900 |
| commit | 9bc5d52e413dcf35e85613e0c5a5b319ba95017a (patch) | |
| tree | badac56bd198b281c9e3a4cc662d1533b8076389 /packages/backend/src/models/entities | |
| parent | refactor (diff) | |
| download | misskey-9bc5d52e413dcf35e85613e0c5a5b319ba95017a.tar.gz misskey-9bc5d52e413dcf35e85613e0c5a5b319ba95017a.tar.bz2 misskey-9bc5d52e413dcf35e85613e0c5a5b319ba95017a.zip | |
feat: チャンネルにノートをピン留めできるように
Resolve #7740
Diffstat (limited to 'packages/backend/src/models/entities')
| -rw-r--r-- | packages/backend/src/models/entities/Channel.ts | 5 | ||||
| -rw-r--r-- | packages/backend/src/models/entities/ChannelNotePining.ts | 35 |
2 files changed, 5 insertions, 35 deletions
diff --git a/packages/backend/src/models/entities/Channel.ts b/packages/backend/src/models/entities/Channel.ts index a6e32d54f7..2d346fdf9d 100644 --- a/packages/backend/src/models/entities/Channel.ts +++ b/packages/backend/src/models/entities/Channel.ts @@ -59,6 +59,11 @@ export class Channel { @JoinColumn() public banner: DriveFile | null; + @Column('varchar', { + array: true, length: 128, default: '{}', + }) + public pinnedNoteIds: string[]; + @Index() @Column('integer', { default: 0, diff --git a/packages/backend/src/models/entities/ChannelNotePining.ts b/packages/backend/src/models/entities/ChannelNotePining.ts deleted file mode 100644 index ab5796626a..0000000000 --- a/packages/backend/src/models/entities/ChannelNotePining.ts +++ /dev/null @@ -1,35 +0,0 @@ -import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; -import { id } from '../id.js'; -import { Note } from './Note.js'; -import { Channel } from './Channel.js'; - -@Entity() -@Index(['channelId', 'noteId'], { unique: true }) -export class ChannelNotePining { - @PrimaryColumn(id()) - public id: string; - - @Column('timestamp with time zone', { - comment: 'The created date of the ChannelNotePining.', - }) - public createdAt: Date; - - @Index() - @Column(id()) - public channelId: Channel['id']; - - @ManyToOne(type => Channel, { - onDelete: 'CASCADE', - }) - @JoinColumn() - public channel: Channel | null; - - @Column(id()) - public noteId: Note['id']; - - @ManyToOne(type => Note, { - onDelete: 'CASCADE', - }) - @JoinColumn() - public note: Note | null; -} |