You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
49 lines
987 B
TypeScript
49 lines
987 B
TypeScript
import { BelongsTo, Column, CreatedAt, ForeignKey, Table, UpdatedAt } from 'sequelize-typescript'
|
|||
import { VideoCommentModel } from '../video/video-comment.js'
|
|||
import { AbuseModel } from './abuse.js'
|
|||
import { SequelizeModel } from '../shared/index.js'
|
|||
|
|||
@Table({
|
|||
tableName: 'commentAbuse',
|
|||
indexes: [
|
|||
{
|
|||
fields: [ 'abuseId' ]
|
|||
},
|
|||
{
|
|||
fields: [ 'videoCommentId' ]
|
|||
}
|
|||
]
|
|||
})
|
|||
export class VideoCommentAbuseModel extends SequelizeModel<VideoCommentAbuseModel> {
|
|||
|
|||
@CreatedAt
|
|||
createdAt: Date
|
|||
|
|||
@UpdatedAt
|
|||
updatedAt: Date
|
|||
|
|||
@ForeignKey(() => AbuseModel)
|
|||
@Column
|
|||
abuseId: number
|
|||
|
|||
@BelongsTo(() => AbuseModel, {
|
|||
foreignKey: {
|
|||
allowNull: false
|
|||
},
|
|||
onDelete: 'cascade'
|
|||
})
|
|||
Abuse: Awaited<AbuseModel>
|
|||
|
|||
@ForeignKey(() => VideoCommentModel)
|
|||
@Column
|
|||
videoCommentId: number
|
|||
|
|||
@BelongsTo(() => VideoCommentModel, {
|
|||
foreignKey: {
|
|||
allowNull: true
|
|||
},
|
|||
onDelete: 'set null'
|
|||
})
|
|||
VideoComment: Awaited<VideoCommentModel>
|
|||
}
|