+ @HasMany(() => VideoCommentModel, {
+ foreignKey: {
+ allowNull: false
+ },
+ onDelete: 'cascade',
+ hooks: true
+ })
+ VideoComments: VideoCommentModel[]
+
+ @BeforeDestroy
+ static async sendDeleteIfOwned (instance: AccountModel, options) {
+ if (!instance.Actor) {
+ instance.Actor = await instance.$get('Actor', { transaction: options.transaction }) as ActorModel
+ }
+