diff options
author | Chocobozzz <me@florianbigard.com> | 2020-12-08 14:30:29 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2020-12-09 11:41:22 +0100 |
commit | b49f22d8f9a52ab75fd38db2d377249eb58fa678 (patch) | |
tree | a2825877d7b3b53454804a79c9d2a14c5d37385c /server/models/video/video-change-ownership.ts | |
parent | 6c8c15f914cd375da1db5d0cd4d924a86c53d4c1 (diff) | |
download | PeerTube-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.ts | 11 |
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 @@ | |||
1 | import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' | 1 | import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' |
2 | import { AccountModel } from '../account/account' | 2 | import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership' |
3 | import { ScopeNames as VideoScopeNames, VideoModel } from './video' | ||
4 | import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos' | 3 | import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos' |
4 | import { AccountModel } from '../account/account' | ||
5 | import { getSort } from '../utils' | 5 | import { getSort } from '../utils' |
6 | import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership' | 6 | import { ScopeNames as VideoScopeNames, VideoModel } from './video' |
7 | import * as Bluebird from 'bluebird' | ||
8 | 7 | ||
9 | enum ScopeNames { | 8 | enum ScopeNames { |
10 | WITH_ACCOUNTS = 'WITH_ACCOUNTS', | 9 | WITH_ACCOUNTS = 'WITH_ACCOUNTS', |
@@ -54,7 +53,7 @@ enum ScopeNames { | |||
54 | ] | 53 | ] |
55 | } | 54 | } |
56 | })) | 55 | })) |
57 | export class VideoChangeOwnershipModel extends Model<VideoChangeOwnershipModel> { | 56 | export 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 | } |