ニジカ投稿局 https://tv.nizika.tv
You can not 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

  1. import { BelongsTo, Column, CreatedAt, ForeignKey, Table, UpdatedAt } from 'sequelize-typescript'
  2. import { VideoCommentModel } from '../video/video-comment.js'
  3. import { AbuseModel } from './abuse.js'
  4. import { SequelizeModel } from '../shared/index.js'
  5. @Table({
  6. tableName: 'commentAbuse',
  7. indexes: [
  8. {
  9. fields: [ 'abuseId' ]
  10. },
  11. {
  12. fields: [ 'videoCommentId' ]
  13. }
  14. ]
  15. })
  16. export class VideoCommentAbuseModel extends SequelizeModel<VideoCommentAbuseModel> {
  17. @CreatedAt
  18. createdAt: Date
  19. @UpdatedAt
  20. updatedAt: Date
  21. @ForeignKey(() => AbuseModel)
  22. @Column
  23. abuseId: number
  24. @BelongsTo(() => AbuseModel, {
  25. foreignKey: {
  26. allowNull: false
  27. },
  28. onDelete: 'cascade'
  29. })
  30. Abuse: Awaited<AbuseModel>
  31. @ForeignKey(() => VideoCommentModel)
  32. @Column
  33. videoCommentId: number
  34. @BelongsTo(() => VideoCommentModel, {
  35. foreignKey: {
  36. allowNull: true
  37. },
  38. onDelete: 'set null'
  39. })
  40. VideoComment: Awaited<VideoCommentModel>
  41. }