+ @ForeignKey(() => VideoLiveReplaySettingModel)
+ @Column
+ replaySettingId: number
+
+ @BelongsTo(() => VideoLiveReplaySettingModel, {
+ foreignKey: {
+ allowNull: true
+ },
+ onDelete: 'set null'
+ })
+ ReplaySetting: VideoLiveReplaySettingModel
+
+ @BeforeDestroy
+ static deleteReplaySetting (instance: VideoLiveSessionModel) {
+ return VideoLiveReplaySettingModel.destroy({
+ where: {
+ id: instance.replaySettingId
+ }
+ })
+ }
+