]>
Commit | Line | Data |
---|---|---|
3fd3ab2d C |
1 | import { Column, CreatedAt, ForeignKey, Model, Table, UpdatedAt } from 'sequelize-typescript' |
2 | import { TagModel } from './tag' | |
3 | import { VideoModel } from './video' | |
e02643f3 | 4 | |
3fd3ab2d C |
5 | @Table({ |
6 | tableName: 'videoTag', | |
7 | indexes: [ | |
8 | { | |
9 | fields: [ 'videoId' ] | |
10 | }, | |
11 | { | |
12 | fields: [ 'tagId' ] | |
13 | } | |
14 | ] | |
15 | }) | |
16 | export class VideoTagModel extends Model<VideoTagModel> { | |
17 | @CreatedAt | |
18 | createdAt: Date | |
e02643f3 | 19 | |
3fd3ab2d C |
20 | @UpdatedAt |
21 | updatedAt: Date | |
e02643f3 | 22 | |
3fd3ab2d C |
23 | @ForeignKey(() => VideoModel) |
24 | @Column | |
25 | videoId: number | |
7920c273 | 26 | |
3fd3ab2d C |
27 | @ForeignKey(() => TagModel) |
28 | @Column | |
29 | tagId: number | |
7920c273 | 30 | } |