From a9bfa85d2cdf13670aaced740da5b493fbeddfce Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Wed, 15 Dec 2021 15:58:10 +0100 Subject: Add ability for admins to set default p2p policy --- server/initializers/migrations/0675-p2p-enabled.ts | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 server/initializers/migrations/0675-p2p-enabled.ts (limited to 'server/initializers/migrations/0675-p2p-enabled.ts') diff --git a/server/initializers/migrations/0675-p2p-enabled.ts b/server/initializers/migrations/0675-p2p-enabled.ts new file mode 100644 index 000000000..b4f53381e --- /dev/null +++ b/server/initializers/migrations/0675-p2p-enabled.ts @@ -0,0 +1,21 @@ +import * as Sequelize from 'sequelize' + +async function up (utils: { + transaction: Sequelize.Transaction + queryInterface: Sequelize.QueryInterface + sequelize: Sequelize.Sequelize + db: any +}): Promise { + await utils.queryInterface.renameColumn('user', 'webTorrentEnabled', 'p2pEnabled') + + await utils.sequelize.query('ALTER TABLE "user" ALTER COLUMN "p2pEnabled" DROP DEFAULT') +} + +function down (options) { + throw new Error('Not implemented.') +} + +export { + up, + down +} -- cgit v1.2.3