})
Video: VideoModel
+ static removeOldRemoteViewsHistory (beforeDate: string) {
+ const query = {
+ where: {
+ startDate: {
+ [Sequelize.Op.lt]: beforeDate
+ },
+ videoId: {
+ [Sequelize.Op.in]: Sequelize.literal('(SELECT "id" FROM "video" WHERE "remote" IS TRUE)')
+ }
+ }
+ }
+
+ return VideoViewModel.destroy(query)
+ }
}