0355-p2p-peer-version.ts 879 B

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. import * as Sequelize from 'sequelize'
  2. async function up (utils: {
  3. transaction: Sequelize.Transaction,
  4. queryInterface: Sequelize.QueryInterface,
  5. sequelize: Sequelize.Sequelize,
  6. db: any
  7. }): Promise<void> {
  8. {
  9. const data = {
  10. type: Sequelize.INTEGER,
  11. allowNull: true,
  12. defaultValue: null
  13. }
  14. await utils.queryInterface.addColumn('videoStreamingPlaylist', 'p2pMediaLoaderPeerVersion', data)
  15. }
  16. {
  17. const query = `UPDATE "videoStreamingPlaylist" SET "p2pMediaLoaderPeerVersion" = 0;`
  18. await utils.sequelize.query(query)
  19. }
  20. {
  21. const data = {
  22. type: Sequelize.INTEGER,
  23. allowNull: false,
  24. defaultValue: null
  25. }
  26. await utils.queryInterface.changeColumn('videoStreamingPlaylist', 'p2pMediaLoaderPeerVersion', data)
  27. }
  28. }
  29. function down (options) {
  30. throw new Error('Not implemented.')
  31. }
  32. export {
  33. up,
  34. down
  35. }