mirror of
https://github.com/Chocobozzz/PeerTube.git
synced 2024-11-25 18:20:31 -06:00
Remove :443 from video urls too
This commit is contained in:
parent
6b467fd54e
commit
d6aaab28f7
@ -9,7 +9,7 @@ import { isTestInstance, root, sanitizeHost, sanitizeUrl } from '../helpers/core
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
const LAST_MIGRATION_VERSION = 160
|
||||
const LAST_MIGRATION_VERSION = 165
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
|
25
server/initializers/migrations/0165-video-route.ts
Normal file
25
server/initializers/migrations/0165-video-route.ts
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user