mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-24 13:09:07 +01:00
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;
|
||
|
}
|