mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-23 15:49:10 +00:00
87 lines
1.1 KiB
TypeScript
87 lines
1.1 KiB
TypeScript
import { Column, Entity, Index } from 'typeorm';
|
|
import BaseModel from './BaseModel';
|
|
import User from './User';
|
|
import Project from './Project';
|
|
@Entity({
|
|
name: "UserAlerts"
|
|
})
|
|
export default class Model extends BaseModel{
|
|
|
|
@Column()
|
|
applicationLog!: {
|
|
|
|
@Column()
|
|
type!: Schema.Types.Object;
|
|
|
|
@Column()
|
|
ref!: 'ApplicationLog';
|
|
|
|
@Column()
|
|
alias!: 'applicationLog';
|
|
|
|
@Column()
|
|
index!: true;
|
|
}; //Which application log this content log belongs to.
|
|
|
|
@Column()
|
|
content!: Object;
|
|
|
|
@Column()
|
|
stringifiedContent!: string;
|
|
|
|
@Column()
|
|
type!: {
|
|
|
|
@Column()
|
|
type!: string;
|
|
|
|
@Column()
|
|
enum!: ['info', 'warning', 'error'];
|
|
|
|
@Column()
|
|
required!: true;
|
|
};
|
|
|
|
@Column()
|
|
tags!: [
|
|
{
|
|
|
|
@Column()
|
|
type!: string;
|
|
};
|
|
];
|
|
|
|
@Column()
|
|
createdByUser!: User;
|
|
|
|
|
|
|
|
|
|
|
|
@Column()
|
|
deletedByUser!: User;
|
|
}
|
|
|
|
schema.virtual('applicationLog'; {
|
|
|
|
@Column()
|
|
localField!: '_id';
|
|
|
|
@Column()
|
|
foreignField!: 'applicationLog';
|
|
|
|
@Column()
|
|
ref!: 'ApplicationLog';
|
|
|
|
@Column()
|
|
justOne!: true;
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|