Init commit

This commit is contained in:
ShreejitPanchal
2026-05-19 19:56:02 +08:00
commit 6601501eff
4047 changed files with 2185372 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
import { type VideoDetails } from '@peertube/peertube-models'
import { AllowNull, BelongsTo, Column, CreatedAt, DataType, Default, ForeignKey, Table, UpdatedAt } from 'sequelize-typescript'
import { VideoModel } from '../video/video.js'
import { AbuseModel } from './abuse.js'
import { SequelizeModel } from '../shared/index.js'
@Table({
tableName: 'videoAbuse',
indexes: [
{
fields: [ 'abuseId' ]
},
{
fields: [ 'videoId' ]
}
]
})
export class VideoAbuseModel extends SequelizeModel<VideoAbuseModel> {
@CreatedAt
declare createdAt: Date
@UpdatedAt
declare updatedAt: Date
@AllowNull(true)
@Default(null)
@Column
declare startAt: number
@AllowNull(true)
@Default(null)
@Column
declare endAt: number
@AllowNull(true)
@Default(null)
@Column(DataType.JSONB)
declare deletedVideo: VideoDetails
@ForeignKey(() => AbuseModel)
@Column
declare abuseId: number
@BelongsTo(() => AbuseModel, {
foreignKey: {
allowNull: false
},
onDelete: 'cascade'
})
declare Abuse: Awaited<AbuseModel>
@ForeignKey(() => VideoModel)
@Column
declare videoId: number
@BelongsTo(() => VideoModel, {
foreignKey: {
allowNull: true
},
onDelete: 'set null'
})
declare Video: Awaited<VideoModel>
}