mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-13 08:33:09 +02:00
b9cb6d1c10
将来ESMに移行しやすいように Related: #7658 なんかmochaが起動しなくなってるけど理由不明 すぐ直したい
74 lines
1.3 KiB
TypeScript
74 lines
1.3 KiB
TypeScript
import { PrimaryColumn, Entity, Index, JoinColumn, Column, ManyToOne } from 'typeorm';
|
|
import { User } from './user.js';
|
|
import { id } from '../id.js';
|
|
|
|
@Entity()
|
|
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 targetUserId: User['id'];
|
|
|
|
@ManyToOne(type => User, {
|
|
onDelete: 'CASCADE'
|
|
})
|
|
@JoinColumn()
|
|
public targetUser: User | null;
|
|
|
|
@Index()
|
|
@Column(id())
|
|
public reporterId: User['id'];
|
|
|
|
@ManyToOne(type => User, {
|
|
onDelete: 'CASCADE'
|
|
})
|
|
@JoinColumn()
|
|
public reporter: User | null;
|
|
|
|
@Column({
|
|
...id(),
|
|
nullable: true
|
|
})
|
|
public assigneeId: User['id'] | null;
|
|
|
|
@ManyToOne(type => User, {
|
|
onDelete: 'SET NULL'
|
|
})
|
|
@JoinColumn()
|
|
public assignee: User | null;
|
|
|
|
@Index()
|
|
@Column('boolean', {
|
|
default: false
|
|
})
|
|
public resolved: boolean;
|
|
|
|
@Column('varchar', {
|
|
length: 2048,
|
|
})
|
|
public comment: string;
|
|
|
|
//#region Denormalized fields
|
|
@Index()
|
|
@Column('varchar', {
|
|
length: 128, nullable: true,
|
|
comment: '[Denormalized]'
|
|
})
|
|
public targetUserHost: string | null;
|
|
|
|
@Index()
|
|
@Column('varchar', {
|
|
length: 128, nullable: true,
|
|
comment: '[Denormalized]'
|
|
})
|
|
public reporterHost: string | null;
|
|
//#endregion
|
|
}
|