blob: 7e880c96804de7681bd98b5ae07f5577736dae2a (
plain) (
tree)
|
|
import { Column, CreatedAt, ForeignKey, Model, Table, UpdatedAt } from 'sequelize-typescript'
import { AttributesOnly } from '@shared/typescript-utils'
import { TagModel } from './tag'
import { VideoModel } from './video'
@Table({
tableName: 'videoTag',
indexes: [
{
fields: [ 'videoId' ]
},
{
fields: [ 'tagId' ]
}
]
})
export class VideoTagModel extends Model<Partial<AttributesOnly<VideoTagModel>>> {
@CreatedAt
createdAt: Date
@UpdatedAt
updatedAt: Date
@ForeignKey(() => VideoModel)
@Column
videoId: number
@ForeignKey(() => TagModel)
@Column
tagId: number
}
|