ニジカ投稿局 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.
 
 
 
 
 

35 lines
898 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. db: any
  7. }): Promise<void> {
  8. const { transaction } = utils
  9. const query = `
  10. CREATE TABLE IF NOT EXISTS "videoLiveSession" (
  11. "id" serial,
  12. "startDate" timestamp with time zone NOT NULL,
  13. "endDate" timestamp with time zone,
  14. "error" integer,
  15. "replayVideoId" integer REFERENCES "video" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
  16. "liveVideoId" integer REFERENCES "video" ("id") ON DELETE SET NULL ON UPDATE CASCADE,
  17. "createdAt" timestamp with time zone NOT NULL,
  18. "updatedAt" timestamp with time zone NOT NULL,
  19. PRIMARY KEY ("id")
  20. );
  21. `
  22. await utils.sequelize.query(query, { transaction })
  23. }
  24. function down () {
  25. throw new Error('Not implemented.')
  26. }
  27. export {
  28. up,
  29. down
  30. }