diff options
Diffstat (limited to 'server/initializers/migrations')
6 files changed, 9 insertions, 14 deletions
diff --git a/server/initializers/migrations/0065-video-file-size.ts b/server/initializers/migrations/0065-video-file-size.ts index 58f8f3bcc..4e2075f8b 100644 --- a/server/initializers/migrations/0065-video-file-size.ts +++ b/server/initializers/migrations/0065-video-file-size.ts | |||
@@ -1,8 +1,7 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import * as Promise from 'bluebird' | 2 | import * as Promise from 'bluebird' |
3 | import { stat } from 'fs' | 3 | import { stat } from 'fs' |
4 | 4 | import { VideoModel } from '../../models/video/video' | |
5 | import { VideoInstance } from '../../models' | ||
6 | 5 | ||
7 | function up (utils: { | 6 | function up (utils: { |
8 | transaction: Sequelize.Transaction, | 7 | transaction: Sequelize.Transaction, |
@@ -11,7 +10,7 @@ function up (utils: { | |||
11 | db: any | 10 | db: any |
12 | }): Promise<void> { | 11 | }): Promise<void> { |
13 | return utils.db.Video.listOwnedAndPopulateAuthorAndTags() | 12 | return utils.db.Video.listOwnedAndPopulateAuthorAndTags() |
14 | .then((videos: VideoInstance[]) => { | 13 | .then((videos: VideoModel[]) => { |
15 | const tasks: Promise<any>[] = [] | 14 | const tasks: Promise<any>[] = [] |
16 | 15 | ||
17 | videos.forEach(video => { | 16 | videos.forEach(video => { |
diff --git a/server/initializers/migrations/0100-activitypub.ts b/server/initializers/migrations/0100-activitypub.ts index 50a0adc14..fb42e1d57 100644 --- a/server/initializers/migrations/0100-activitypub.ts +++ b/server/initializers/migrations/0100-activitypub.ts | |||
@@ -4,14 +4,14 @@ import { createPrivateAndPublicKeys } from '../../helpers/peertube-crypto' | |||
4 | import { shareVideoByServer } from '../../lib/activitypub/share' | 4 | import { shareVideoByServer } from '../../lib/activitypub/share' |
5 | import { getVideoActivityPubUrl, getVideoChannelActivityPubUrl } from '../../lib/activitypub/url' | 5 | import { getVideoActivityPubUrl, getVideoChannelActivityPubUrl } from '../../lib/activitypub/url' |
6 | import { createLocalAccountWithoutKeys } from '../../lib/user' | 6 | import { createLocalAccountWithoutKeys } from '../../lib/user' |
7 | import { ApplicationModel } from '../../models/application/application' | ||
7 | import { JOB_CATEGORIES, SERVER_ACCOUNT_NAME } from '../constants' | 8 | import { JOB_CATEGORIES, SERVER_ACCOUNT_NAME } from '../constants' |
8 | import { PeerTubeDatabase } from '../database' | ||
9 | 9 | ||
10 | async function up (utils: { | 10 | async function up (utils: { |
11 | transaction: Sequelize.Transaction, | 11 | transaction: Sequelize.Transaction, |
12 | queryInterface: Sequelize.QueryInterface, | 12 | queryInterface: Sequelize.QueryInterface, |
13 | sequelize: Sequelize.Sequelize, | 13 | sequelize: Sequelize.Sequelize, |
14 | db: PeerTubeDatabase | 14 | db: any |
15 | }): Promise<void> { | 15 | }): Promise<void> { |
16 | const q = utils.queryInterface | 16 | const q = utils.queryInterface |
17 | const db = utils.db | 17 | const db = utils.db |
@@ -65,7 +65,7 @@ async function up (utils: { | |||
65 | 65 | ||
66 | // Create application account | 66 | // Create application account |
67 | { | 67 | { |
68 | const applicationInstance = await db.Application.findOne() | 68 | const applicationInstance = await ApplicationModel.findOne() |
69 | const accountCreated = await createLocalAccountWithoutKeys(SERVER_ACCOUNT_NAME, null, applicationInstance.id, undefined) | 69 | const accountCreated = await createLocalAccountWithoutKeys(SERVER_ACCOUNT_NAME, null, applicationInstance.id, undefined) |
70 | 70 | ||
71 | const { publicKey, privateKey } = await createPrivateAndPublicKeys() | 71 | const { publicKey, privateKey } = await createPrivateAndPublicKeys() |
diff --git a/server/initializers/migrations/0105-server-mail.ts b/server/initializers/migrations/0105-server-mail.ts index 5836992d5..4b9600e91 100644 --- a/server/initializers/migrations/0105-server-mail.ts +++ b/server/initializers/migrations/0105-server-mail.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import { PeerTubeDatabase } from '../database' | ||
3 | 2 | ||
4 | async function up (utils: { | 3 | async function up (utils: { |
5 | transaction: Sequelize.Transaction, | 4 | transaction: Sequelize.Transaction, |
6 | queryInterface: Sequelize.QueryInterface, | 5 | queryInterface: Sequelize.QueryInterface, |
7 | sequelize: Sequelize.Sequelize, | 6 | sequelize: Sequelize.Sequelize, |
8 | db: PeerTubeDatabase | 7 | db: any |
9 | }): Promise<void> { | 8 | }): Promise<void> { |
10 | await utils.queryInterface.removeColumn('Servers', 'email') | 9 | await utils.queryInterface.removeColumn('Servers', 'email') |
11 | } | 10 | } |
diff --git a/server/initializers/migrations/0110-server-key.ts b/server/initializers/migrations/0110-server-key.ts index 560353945..5ff6daf69 100644 --- a/server/initializers/migrations/0110-server-key.ts +++ b/server/initializers/migrations/0110-server-key.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import { PeerTubeDatabase } from '../database' | ||
3 | 2 | ||
4 | async function up (utils: { | 3 | async function up (utils: { |
5 | transaction: Sequelize.Transaction, | 4 | transaction: Sequelize.Transaction, |
6 | queryInterface: Sequelize.QueryInterface, | 5 | queryInterface: Sequelize.QueryInterface, |
7 | sequelize: Sequelize.Sequelize, | 6 | sequelize: Sequelize.Sequelize, |
8 | db: PeerTubeDatabase | 7 | db: any |
9 | }): Promise<void> { | 8 | }): Promise<void> { |
10 | await utils.queryInterface.removeColumn('Servers', 'publicKey') | 9 | await utils.queryInterface.removeColumn('Servers', 'publicKey') |
11 | } | 10 | } |
diff --git a/server/initializers/migrations/0115-account-avatar.ts b/server/initializers/migrations/0115-account-avatar.ts index 2b947ceda..b318e8163 100644 --- a/server/initializers/migrations/0115-account-avatar.ts +++ b/server/initializers/migrations/0115-account-avatar.ts | |||
@@ -1,11 +1,10 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import { PeerTubeDatabase } from '../database' | ||
3 | 2 | ||
4 | async function up (utils: { | 3 | async function up (utils: { |
5 | transaction: Sequelize.Transaction, | 4 | transaction: Sequelize.Transaction, |
6 | queryInterface: Sequelize.QueryInterface, | 5 | queryInterface: Sequelize.QueryInterface, |
7 | sequelize: Sequelize.Sequelize, | 6 | sequelize: Sequelize.Sequelize, |
8 | db: PeerTubeDatabase | 7 | db: any |
9 | }): Promise<void> { | 8 | }): Promise<void> { |
10 | await utils.db.Avatar.sync() | 9 | await utils.db.Avatar.sync() |
11 | 10 | ||
diff --git a/server/initializers/migrations/0120-video-null.ts b/server/initializers/migrations/0120-video-null.ts index 9130d10ee..63f3984dd 100644 --- a/server/initializers/migrations/0120-video-null.ts +++ b/server/initializers/migrations/0120-video-null.ts | |||
@@ -1,12 +1,11 @@ | |||
1 | import * as Sequelize from 'sequelize' | 1 | import * as Sequelize from 'sequelize' |
2 | import { CONSTRAINTS_FIELDS } from '../constants' | 2 | import { CONSTRAINTS_FIELDS } from '../constants' |
3 | import { PeerTubeDatabase } from '../database' | ||
4 | 3 | ||
5 | async function up (utils: { | 4 | async function up (utils: { |
6 | transaction: Sequelize.Transaction, | 5 | transaction: Sequelize.Transaction, |
7 | queryInterface: Sequelize.QueryInterface, | 6 | queryInterface: Sequelize.QueryInterface, |
8 | sequelize: Sequelize.Sequelize, | 7 | sequelize: Sequelize.Sequelize, |
9 | db: PeerTubeDatabase | 8 | db: any |
10 | }): Promise<void> { | 9 | }): Promise<void> { |
11 | 10 | ||
12 | { | 11 | { |