0450-streaming-playlist-files.ts 760 B

12345678910111213141516171819202122232425262728293031323334353637383940
  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. references: {
  13. model: 'videoStreamingPlaylist',
  14. key: 'id'
  15. },
  16. onDelete: 'CASCADE'
  17. }
  18. await utils.queryInterface.addColumn('videoFile', 'videoStreamingPlaylistId', data)
  19. }
  20. {
  21. const data = {
  22. type: Sequelize.INTEGER,
  23. allowNull: true
  24. }
  25. await utils.queryInterface.changeColumn('videoFile', 'videoId', data)
  26. }
  27. }
  28. function down (options) {
  29. throw new Error('Not implemented.')
  30. }
  31. export {
  32. up,
  33. down
  34. }