1 import * as Sequelize from 'sequelize'
2 import { DataType } from 'sequelize-typescript'
3 import { createPrivateAndPublicKeys } from '../../helpers'
4 import { CONFIG } from '../constants'
6 async function up (utils: {
7 transaction: Sequelize.Transaction,
8 queryInterface: Sequelize.QueryInterface,
9 sequelize: Sequelize.Sequelize
11 const toReplace = CONFIG.WEBSERVER.HOSTNAME + ':443'
12 const by = CONFIG.WEBSERVER.HOST
13 const replacer = column => `replace("${column}", '${toReplace}', '${by}')`
16 const query = `UPDATE video SET url = ${replacer('url')}`
17 await utils.sequelize.query(query)
22 UPDATE actor SET url = ${replacer('url')}, "inboxUrl" = ${replacer('inboxUrl')}, "outboxUrl" = ${replacer('outboxUrl')},
23 "sharedInboxUrl" = ${replacer('sharedInboxUrl')}, "followersUrl" = ${replacer('followersUrl')},
24 "followingUrl" = ${replacer('followingUrl')}
26 await utils.sequelize.query(query)
30 const query = `UPDATE server SET host = replace(host, ':443', '')`
31 await utils.sequelize.query(query)
35 function down (options) {
36 throw new Error('Not implemented.')