From 156c50af3085468a47b8ae73fe8cfcae46b42398 Mon Sep 17 00:00:00 2001 From: Lucas Declercq Date: Sat, 6 Oct 2018 19:17:21 +0200 Subject: Add downloadingEnabled property to video model --- .../migrations/0280-video-downloading-enabled.ts | 27 ++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 server/initializers/migrations/0280-video-downloading-enabled.ts (limited to 'server/initializers/migrations') diff --git a/server/initializers/migrations/0280-video-downloading-enabled.ts b/server/initializers/migrations/0280-video-downloading-enabled.ts new file mode 100644 index 000000000..c0700108c --- /dev/null +++ b/server/initializers/migrations/0280-video-downloading-enabled.ts @@ -0,0 +1,27 @@ +import * as Sequelize from 'sequelize' +import { Migration } from '../../models/migrations' + +async function up (utils: { + transaction: Sequelize.Transaction, + queryInterface: Sequelize.QueryInterface, + sequelize: Sequelize.Sequelize +}): Promise { + const data = { + type: Sequelize.BOOLEAN, + allowNull: false, + defaultValue: true + } as Migration.Boolean + await utils.queryInterface.addColumn('video', 'downloadingEnabled', data) + + data.defaultValue = null + return utils.queryInterface.changeColumn('video', 'downloadingEnabled', data) +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3