aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/models/video/video-change-ownership.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-12-08 14:30:29 +0100
committerChocobozzz <chocobozzz@cpy.re>2020-12-09 11:41:22 +0100
commitb49f22d8f9a52ab75fd38db2d377249eb58fa678 (patch)
treea2825877d7b3b53454804a79c9d2a14c5d37385c /server/models/video/video-change-ownership.ts
parent6c8c15f914cd375da1db5d0cd4d924a86c53d4c1 (diff)
downloadPeerTube-b49f22d8f9a52ab75fd38db2d377249eb58fa678.tar.gz
PeerTube-b49f22d8f9a52ab75fd38db2d377249eb58fa678.tar.zst
PeerTube-b49f22d8f9a52ab75fd38db2d377249eb58fa678.zip
Upgrade sequelize to v6
Diffstat (limited to 'server/models/video/video-change-ownership.ts')
-rw-r--r--server/models/video/video-change-ownership.ts11
1 files changed, 5 insertions, 6 deletions
diff --git a/server/models/video/video-change-ownership.ts b/server/models/video/video-change-ownership.ts
index ac0ab7e8b..298e8bfe2 100644
--- a/server/models/video/video-change-ownership.ts
+++ b/server/models/video/video-change-ownership.ts
@@ -1,10 +1,9 @@
1import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' 1import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript'
2import { AccountModel } from '../account/account' 2import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership'
3import { ScopeNames as VideoScopeNames, VideoModel } from './video'
4import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos' 3import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos'
4import { AccountModel } from '../account/account'
5import { getSort } from '../utils' 5import { getSort } from '../utils'
6import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership' 6import { ScopeNames as VideoScopeNames, VideoModel } from './video'
7import * as Bluebird from 'bluebird'
8 7
9enum ScopeNames { 8enum ScopeNames {
10 WITH_ACCOUNTS = 'WITH_ACCOUNTS', 9 WITH_ACCOUNTS = 'WITH_ACCOUNTS',
@@ -54,7 +53,7 @@ enum ScopeNames {
54 ] 53 ]
55 } 54 }
56})) 55}))
57export class VideoChangeOwnershipModel extends Model<VideoChangeOwnershipModel> { 56export class VideoChangeOwnershipModel extends Model {
58 @CreatedAt 57 @CreatedAt
59 createdAt: Date 58 createdAt: Date
60 59
@@ -119,7 +118,7 @@ export class VideoChangeOwnershipModel extends Model<VideoChangeOwnershipModel>
119 ]).then(([ count, rows ]) => ({ total: count, data: rows })) 118 ]).then(([ count, rows ]) => ({ total: count, data: rows }))
120 } 119 }
121 120
122 static load (id: number): Bluebird<MVideoChangeOwnershipFull> { 121 static load (id: number): Promise<MVideoChangeOwnershipFull> {
123 return VideoChangeOwnershipModel.scope([ ScopeNames.WITH_ACCOUNTS, ScopeNames.WITH_VIDEO ]) 122 return VideoChangeOwnershipModel.scope([ ScopeNames.WITH_ACCOUNTS, ScopeNames.WITH_VIDEO ])
124 .findByPk(id) 123 .findByPk(id)
125 } 124 }