From b49f22d8f9a52ab75fd38db2d377249eb58fa678 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 8 Dec 2020 14:30:29 +0100 Subject: Upgrade sequelize to v6 --- server/models/video/video-change-ownership.ts | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'server/models/video/video-change-ownership.ts') 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 @@ import { AllowNull, BelongsTo, Column, CreatedAt, ForeignKey, Model, Scopes, Table, UpdatedAt } from 'sequelize-typescript' -import { AccountModel } from '../account/account' -import { ScopeNames as VideoScopeNames, VideoModel } from './video' +import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership' import { VideoChangeOwnership, VideoChangeOwnershipStatus } from '../../../shared/models/videos' +import { AccountModel } from '../account/account' import { getSort } from '../utils' -import { MVideoChangeOwnershipFormattable, MVideoChangeOwnershipFull } from '@server/types/models/video/video-change-ownership' -import * as Bluebird from 'bluebird' +import { ScopeNames as VideoScopeNames, VideoModel } from './video' enum ScopeNames { WITH_ACCOUNTS = 'WITH_ACCOUNTS', @@ -54,7 +53,7 @@ enum ScopeNames { ] } })) -export class VideoChangeOwnershipModel extends Model { +export class VideoChangeOwnershipModel extends Model { @CreatedAt createdAt: Date @@ -119,7 +118,7 @@ export class VideoChangeOwnershipModel extends Model ]).then(([ count, rows ]) => ({ total: count, data: rows })) } - static load (id: number): Bluebird { + static load (id: number): Promise { return VideoChangeOwnershipModel.scope([ ScopeNames.WITH_ACCOUNTS, ScopeNames.WITH_VIDEO ]) .findByPk(id) } -- cgit v1.2.3