ニジカ投稿局 https://tv.nizika.tv
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

39 lines
815 B

  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. const { transaction } = utils
  8. {
  9. const query = 'DELETE FROM "videoSource" WHERE "videoId" IS NULL'
  10. await utils.sequelize.query(query, { transaction })
  11. }
  12. {
  13. const query = 'ALTER TABLE "videoSource" ALTER COLUMN "videoId" SET NOT NULL'
  14. await utils.sequelize.query(query, { transaction })
  15. }
  16. {
  17. const data = {
  18. type: Sequelize.DATE,
  19. allowNull: true,
  20. defaultValue: null
  21. }
  22. await utils.queryInterface.addColumn('video', 'inputFileUpdatedAt', data, { transaction })
  23. }
  24. }
  25. function down (options) {
  26. throw new Error('Not implemented.')
  27. }
  28. export {
  29. up,
  30. down
  31. }