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

0715-video-source.ts 761 B

12345678910111213141516171819202122232425262728293031323334
  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 query = `
  10. CREATE TABLE IF NOT EXISTS "videoSource" (
  11. "id" SERIAL ,
  12. "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL,
  13. "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL,
  14. "filename" VARCHAR(255) DEFAULT NULL,
  15. "videoId" INTEGER
  16. REFERENCES "video" ("id")
  17. ON DELETE CASCADE
  18. ON UPDATE CASCADE,
  19. PRIMARY KEY ("id")
  20. );
  21. `
  22. await utils.sequelize.query(query)
  23. }
  24. }
  25. function down (options) {
  26. throw new Error('Not implemented.')
  27. }
  28. export {
  29. up,
  30. down
  31. }