aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/migrations')
-rw-r--r--server/initializers/migrations/0075-video-resolutions.ts2
-rw-r--r--server/initializers/migrations/0140-actor-url.ts6
-rw-r--r--server/initializers/migrations/0235-delete-some-video-indexes.ts4
-rw-r--r--server/initializers/migrations/0240-drop-old-indexes.ts4
-rw-r--r--server/initializers/migrations/0345-video-playlists.ts4
5 files changed, 6 insertions, 14 deletions
diff --git a/server/initializers/migrations/0075-video-resolutions.ts b/server/initializers/migrations/0075-video-resolutions.ts
index 26a188e5e..e4f26cb77 100644
--- a/server/initializers/migrations/0075-video-resolutions.ts
+++ b/server/initializers/migrations/0075-video-resolutions.ts
@@ -1,6 +1,6 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import { join } from 'path' 2import { join } from 'path'
3import { CONFIG } from '../../initializers/constants' 3import { CONFIG } from '../../initializers/config'
4import { getVideoFileResolution } from '../../helpers/ffmpeg-utils' 4import { getVideoFileResolution } from '../../helpers/ffmpeg-utils'
5import { readdir, rename } from 'fs-extra' 5import { readdir, rename } from 'fs-extra'
6 6
diff --git a/server/initializers/migrations/0140-actor-url.ts b/server/initializers/migrations/0140-actor-url.ts
index e64ee3487..020499391 100644
--- a/server/initializers/migrations/0140-actor-url.ts
+++ b/server/initializers/migrations/0140-actor-url.ts
@@ -1,13 +1,13 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import { CONFIG } from '../constants' 2import { WEBSERVER } from '../constants'
3 3
4async function up (utils: { 4async function up (utils: {
5 transaction: Sequelize.Transaction, 5 transaction: Sequelize.Transaction,
6 queryInterface: Sequelize.QueryInterface, 6 queryInterface: Sequelize.QueryInterface,
7 sequelize: Sequelize.Sequelize 7 sequelize: Sequelize.Sequelize
8}): Promise<void> { 8}): Promise<void> {
9 const toReplace = CONFIG.WEBSERVER.HOSTNAME + ':443' 9 const toReplace = WEBSERVER.HOSTNAME + ':443'
10 const by = CONFIG.WEBSERVER.HOST 10 const by = WEBSERVER.HOST
11 const replacer = column => `replace("${column}", '${toReplace}', '${by}')` 11 const replacer = column => `replace("${column}", '${toReplace}', '${by}')`
12 12
13 { 13 {
diff --git a/server/initializers/migrations/0235-delete-some-video-indexes.ts b/server/initializers/migrations/0235-delete-some-video-indexes.ts
index e362f240c..5964b0dc5 100644
--- a/server/initializers/migrations/0235-delete-some-video-indexes.ts
+++ b/server/initializers/migrations/0235-delete-some-video-indexes.ts
@@ -1,8 +1,4 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import { createClient } from 'redis'
3import { CONFIG } from '../constants'
4import { JobQueue } from '../../lib/job-queue'
5import { initDatabaseModels } from '../database'
6 2
7async function up (utils: { 3async function up (utils: {
8 transaction: Sequelize.Transaction 4 transaction: Sequelize.Transaction
diff --git a/server/initializers/migrations/0240-drop-old-indexes.ts b/server/initializers/migrations/0240-drop-old-indexes.ts
index ba961e3f9..39868fa2d 100644
--- a/server/initializers/migrations/0240-drop-old-indexes.ts
+++ b/server/initializers/migrations/0240-drop-old-indexes.ts
@@ -1,8 +1,4 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import { createClient } from 'redis'
3import { CONFIG } from '../constants'
4import { JobQueue } from '../../lib/job-queue'
5import { initDatabaseModels } from '../database'
6 2
7async function up (utils: { 3async function up (utils: {
8 transaction: Sequelize.Transaction 4 transaction: Sequelize.Transaction
diff --git a/server/initializers/migrations/0345-video-playlists.ts b/server/initializers/migrations/0345-video-playlists.ts
index 11670b11d..6953f5553 100644
--- a/server/initializers/migrations/0345-video-playlists.ts
+++ b/server/initializers/migrations/0345-video-playlists.ts
@@ -1,7 +1,7 @@
1import * as Sequelize from 'sequelize' 1import * as Sequelize from 'sequelize'
2import { CONFIG } from '../constants'
3import { VideoPlaylistPrivacy, VideoPlaylistType } from '../../../shared/models/videos' 2import { VideoPlaylistPrivacy, VideoPlaylistType } from '../../../shared/models/videos'
4import * as uuidv4 from 'uuid/v4' 3import * as uuidv4 from 'uuid/v4'
4import { WEBSERVER } from '../constants'
5 5
6async function up (utils: { 6async function up (utils: {
7 transaction: Sequelize.Transaction, 7 transaction: Sequelize.Transaction,
@@ -57,7 +57,7 @@ CREATE TABLE IF NOT EXISTS "videoPlaylistElement"
57 for (const username of usernames) { 57 for (const username of usernames) {
58 const uuid = uuidv4() 58 const uuid = uuidv4()
59 59
60 const baseUrl = CONFIG.WEBSERVER.URL + '/video-playlists/' + uuid 60 const baseUrl = WEBSERVER.URL + '/video-playlists/' + uuid
61 const query = ` 61 const query = `
62 INSERT INTO "videoPlaylist" ("url", "uuid", "name", "privacy", "type", "ownerAccountId", "createdAt", "updatedAt") 62 INSERT INTO "videoPlaylist" ("url", "uuid", "name", "privacy", "type", "ownerAccountId", "createdAt", "updatedAt")
63 SELECT '${baseUrl}' AS "url", 63 SELECT '${baseUrl}' AS "url",