0165-video-route.ts 533 B

12345678910111213141516171819202122232425
  1. import * as Sequelize from 'sequelize'
  2. async function up (utils: {
  3. transaction: Sequelize.Transaction,
  4. queryInterface: Sequelize.QueryInterface,
  5. sequelize: Sequelize.Sequelize
  6. }): Promise<void> {
  7. {
  8. const toReplace = ':443'
  9. const by = ''
  10. const replacer = column => `replace("${column}", '${toReplace}', '${by}')`
  11. const query = `UPDATE video SET url = ${replacer('url')}`
  12. await utils.sequelize.query(query)
  13. }
  14. }
  15. function down (options) {
  16. throw new Error('Not implemented.')
  17. }
  18. export {
  19. up,
  20. down
  21. }