42 lines
793 B
TypeScript
42 lines
793 B
TypeScript
|
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
|
||
|
import { User } from './user';
|
||
|
import { id } from '../id';
|
||
|
|
||
|
@Entity()
|
||
|
@Index(['userId', 'reporterId'], { unique: true })
|
||
|
export class AbuseUserReport {
|
||
|
@PrimaryColumn(id())
|
||
|
public id: string;
|
||
|
|
||
|
@Index()
|
||
|
@Column('timestamp with time zone', {
|
||
|
comment: 'The created date of the AbuseUserReport.'
|
||
|
})
|
||
|
public createdAt: Date;
|
||
|
|
||
|
@Index()
|
||
|
@Column(id())
|
||
|
public userId: User['id'];
|
||
|
|
||
|
@ManyToOne(type => User, {
|
||
|
onDelete: 'CASCADE'
|
||
|
})
|
||
|
@JoinColumn()
|
||
|
public user: User | null;
|
||
|
|
||
|
@Index()
|
||
|
@Column(id())
|
||
|
public reporterId: User['id'];
|
||
|
|
||
|
@ManyToOne(type => User, {
|
||
|
onDelete: 'CASCADE'
|
||
|
})
|
||
|
@JoinColumn()
|
||
|
public reporter: User | null;
|
||
|
|
||
|
@Column('varchar', {
|
||
|
length: 512,
|
||
|
})
|
||
|
public comment: string;
|
||
|
}
|