diff options
| author | syuilo <Syuilotan@yahoo.co.jp> | 2020-08-18 22:44:21 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-08-18 22:44:21 +0900 |
| commit | 9855405b8989713b81709fc1700e2ead97423467 (patch) | |
| tree | 54254d2159378d1903e962f0fb37c799bb0f4464 /src/models/entities/channel.ts | |
| parent | Sign (request-target) Fix #6652 (#6656) (diff) | |
| download | misskey-9855405b8989713b81709fc1700e2ead97423467.tar.gz misskey-9855405b8989713b81709fc1700e2ead97423467.tar.bz2 misskey-9855405b8989713b81709fc1700e2ead97423467.zip | |
Channel (#6621)
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wop
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* wip
* add notes
* wip
* wip
* wip
* wip
* sound
* wip
* add kick_gaba2
* wip
Diffstat (limited to 'src/models/entities/channel.ts')
| -rw-r--r-- | src/models/entities/channel.ts | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/models/entities/channel.ts b/src/models/entities/channel.ts new file mode 100644 index 0000000000..1868f75143 --- /dev/null +++ b/src/models/entities/channel.ts @@ -0,0 +1,74 @@ +import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm'; +import { User } from './user'; +import { id } from '../id'; +import { DriveFile } from './drive-file'; + +@Entity() +export class Channel { + @PrimaryColumn(id()) + public id: string; + + @Index() + @Column('timestamp with time zone', { + comment: 'The created date of the Channel.' + }) + public createdAt: Date; + + @Index() + @Column('timestamp with time zone', { + nullable: true + }) + public lastNotedAt: Date | null; + + @Index() + @Column({ + ...id(), + comment: 'The owner ID.' + }) + public userId: User['id']; + + @ManyToOne(type => User, { + onDelete: 'SET NULL' + }) + @JoinColumn() + public user: User | null; + + @Column('varchar', { + length: 128, + comment: 'The name of the Channel.' + }) + public name: string; + + @Column('varchar', { + length: 2048, nullable: true, + comment: 'The description of the Channel.' + }) + public description: string | null; + + @Column({ + ...id(), + nullable: true, + comment: 'The ID of banner Channel.' + }) + public bannerId: DriveFile['id'] | null; + + @ManyToOne(type => DriveFile, { + onDelete: 'SET NULL' + }) + @JoinColumn() + public banner: DriveFile | null; + + @Index() + @Column('integer', { + default: 0, + comment: 'The count of notes.' + }) + public notesCount: number; + + @Index() + @Column('integer', { + default: 0, + comment: 'The count of users.' + }) + public usersCount: number; +} |