Remove :443 from video urls too

This commit is contained in:
Chocobozzz 2018-01-05 14:51:05 +01:00
parent 6b467fd54e
commit d6aaab28f7
No known key found for this signature in database
GPG Key ID: 583A612D890159BE
2 changed files with 26 additions and 1 deletions

View File

@ -9,7 +9,7 @@ import { isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------
const LAST_MIGRATION_VERSION = 160 const LAST_MIGRATION_VERSION = 165
// --------------------------------------------------------------------------- // ---------------------------------------------------------------------------

View File

@ -0,0 +1,25 @@
import * as Sequelize from 'sequelize'
async function up (utils: {
transaction: Sequelize.Transaction,
queryInterface: Sequelize.QueryInterface,
sequelize: Sequelize.Sequelize
}): Promise<void> {
{
const toReplace = ':443'
const by = ''
const replacer = column => `replace("${column}", '${toReplace}', '${by}')`
const query = `UPDATE video SET url = ${replacer('url')}`
await utils.sequelize.query(query)
}
}
function down (options) {
throw new Error('Not implemented.')
}
export {
up,
down
}