From f2e31d589c900c0c79e74b8eb29a98384d9e6fc0 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Mon, 30 Aug 2021 16:28:36 +0200 Subject: [PATCH] Fix pending job table migration --- server/initializers/constants.ts | 2 +- .../migrations/0670-pending-job-default.ts | 27 +++++++++++++++++++ 2 files changed, 28 insertions(+), 1 deletion(-) create mode 100644 server/initializers/migrations/0670-pending-job-default.ts diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts index 2d8087f46..5395f744c 100644 --- a/server/initializers/constants.ts +++ b/server/initializers/constants.ts @@ -24,7 +24,7 @@ import { CONFIG, registerConfigChangedHandler } from './config' // --------------------------------------------------------------------------- -const LAST_MIGRATION_VERSION = 665 +const LAST_MIGRATION_VERSION = 670 // --------------------------------------------------------------------------- diff --git a/server/initializers/migrations/0670-pending-job-default.ts b/server/initializers/migrations/0670-pending-job-default.ts new file mode 100644 index 000000000..7e9def1a0 --- /dev/null +++ b/server/initializers/migrations/0670-pending-job-default.ts @@ -0,0 +1,27 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction + queryInterface: Sequelize.QueryInterface + sequelize: Sequelize.Sequelize + db: any +}): Promise { + for (const column of [ 'pendingMove', 'pendingTranscode' ]) { + const data = { + type: Sequelize.INTEGER, + allowNull: false, + defaultValue: 0 + } + + await utils.queryInterface.changeColumn('videoJobInfo', column, data) + } +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +}