diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2016-12-30 11:45:00 +0100 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2016-12-30 11:45:00 +0100 |
commit | 79066fdf33f79d2d41394f10881e2c226ca26b49 (patch) | |
tree | 4e7356b1e0d56dd64dfe2039ca97326560495809 /server/models/video.js | |
parent | 3d118fb501f576a298f6bb059167e4c7f4dd8dcc (diff) | |
download | PeerTube-79066fdf33f79d2d41394f10881e2c226ca26b49.tar.gz PeerTube-79066fdf33f79d2d41394f10881e2c226ca26b49.tar.zst PeerTube-79066fdf33f79d2d41394f10881e2c226ca26b49.zip |
Server: add updatedAt attribute to videos
Diffstat (limited to 'server/models/video.js')
-rw-r--r-- | server/models/video.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/server/models/video.js b/server/models/video.js index f51d08f06..3fe8368c7 100644 --- a/server/models/video.js +++ b/server/models/video.js | |||
@@ -20,7 +20,6 @@ const customVideosValidators = require('../helpers/custom-validators').videos | |||
20 | // --------------------------------------------------------------------------- | 20 | // --------------------------------------------------------------------------- |
21 | 21 | ||
22 | module.exports = function (sequelize, DataTypes) { | 22 | module.exports = function (sequelize, DataTypes) { |
23 | // TODO: add indexes on searchable columns | ||
24 | const Video = sequelize.define('Video', | 23 | const Video = sequelize.define('Video', |
25 | { | 24 | { |
26 | id: { | 25 | id: { |
@@ -329,7 +328,8 @@ function toFormatedJSON () { | |||
329 | duration: this.duration, | 328 | duration: this.duration, |
330 | tags: map(this.Tags, 'name'), | 329 | tags: map(this.Tags, 'name'), |
331 | thumbnailPath: constants.STATIC_PATHS.THUMBNAILS + '/' + this.getThumbnailName(), | 330 | thumbnailPath: constants.STATIC_PATHS.THUMBNAILS + '/' + this.getThumbnailName(), |
332 | createdAt: this.createdAt | 331 | createdAt: this.createdAt, |
332 | updatedAt: this.updatedAt | ||
333 | } | 333 | } |
334 | 334 | ||
335 | return json | 335 | return json |
@@ -356,6 +356,7 @@ function toAddRemoteJSON (callback) { | |||
356 | thumbnailData: thumbnailData.toString('binary'), | 356 | thumbnailData: thumbnailData.toString('binary'), |
357 | tags: map(self.Tags, 'name'), | 357 | tags: map(self.Tags, 'name'), |
358 | createdAt: self.createdAt, | 358 | createdAt: self.createdAt, |
359 | updatedAt: self.updatedAt, | ||
359 | extname: self.extname | 360 | extname: self.extname |
360 | } | 361 | } |
361 | 362 | ||
@@ -373,6 +374,7 @@ function toUpdateRemoteJSON (callback) { | |||
373 | duration: this.duration, | 374 | duration: this.duration, |
374 | tags: map(this.Tags, 'name'), | 375 | tags: map(this.Tags, 'name'), |
375 | createdAt: this.createdAt, | 376 | createdAt: this.createdAt, |
377 | updatedAt: this.updatedAt, | ||
376 | extname: this.extname | 378 | extname: this.extname |
377 | } | 379 | } |
378 | 380 | ||