Co-authored-by: MeiMei <30769358+mei23@users.noreply.github.com>
Co-authored-by: Satsuki Yanagi <17376330+u1-liquid@users.noreply.github.com>
This commit is contained in:
syuilo 2020-01-30 04:37:25 +09:00 committed by GitHub
parent a5955c1123
commit f6154dc0af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
871 changed files with 26140 additions and 71950 deletions

View file

@ -2,6 +2,7 @@ import { Entity, Index, JoinColumn, ManyToOne, Column, PrimaryColumn } from 'typ
import { User } from './user';
import { id } from '../id';
import { Note } from './note';
import { FollowRequest } from './follow-request';
@Entity()
export class Notification {
@ -54,12 +55,14 @@ export class Notification {
* quote - (Watchしている)稿Renoteされた
* reaction - (Watchしている)稿
* pollVote - (Watchしている)稿
* receiveFollowRequest -
* followRequestAccepted -
*/
@Column('varchar', {
length: 32,
@Column('enum', {
enum: ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted'],
comment: 'The type of the Notification.'
})
public type: string;
public type: 'follow' | 'mention' | 'reply' | 'renote' | 'quote' | 'reaction' | 'pollVote' | 'receiveFollowRequest' | 'followRequestAccepted';
/**
*
@ -82,6 +85,18 @@ export class Notification {
@JoinColumn()
public note: Note | null;
@Column({
...id(),
nullable: true
})
public followRequestId: FollowRequest['id'] | null;
@ManyToOne(type => FollowRequest, {
onDelete: 'CASCADE'
})
@JoinColumn()
public followRequest: FollowRequest | null;
@Column('varchar', {
length: 128, nullable: true
})