1 import * as Sequelize from 'sequelize'
2 import { VideoStorage } from '@shared/models'
4 async function up (utils: {
5 transaction: Sequelize.Transaction
6 queryInterface: Sequelize.QueryInterface
7 sequelize: Sequelize.Sequelize
12 CREATE TABLE IF NOT EXISTS "videoJobInfo" (
14 "pendingMove" INTEGER NOT NULL,
15 "pendingTranscode" INTEGER NOT NULL,
16 "videoId" serial UNIQUE NOT NULL REFERENCES "video" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
17 "createdAt" timestamp WITH time zone NOT NULL,
18 "updatedAt" timestamp WITH time zone NOT NULL,
23 await utils.sequelize.query(query)
27 await utils.queryInterface.addColumn('videoFile', 'storage', {
28 type: Sequelize.INTEGER,
30 defaultValue: VideoStorage.FILE_SYSTEM
32 await utils.queryInterface.changeColumn('videoFile', 'storage', { type: Sequelize.INTEGER, allowNull: false, defaultValue: null })
36 await utils.queryInterface.addColumn('videoStreamingPlaylist', 'storage', {
37 type: Sequelize.INTEGER,
39 defaultValue: VideoStorage.FILE_SYSTEM
41 await utils.queryInterface.changeColumn('videoStreamingPlaylist', 'storage', {
42 type: Sequelize.INTEGER,
49 function down (options) {
50 throw new Error('Not implemented.')