aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0675-p2p-enabled.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-12-15 15:58:10 +0100
committerChocobozzz <me@florianbigard.com>2021-12-16 10:08:55 +0100
commita9bfa85d2cdf13670aaced740da5b493fbeddfce (patch)
tree3781c9218d4cc7786b6589365c0efbed2151703d /server/initializers/migrations/0675-p2p-enabled.ts
parentc77fdc605b3ccc1ab6890f889d8200fbe9372949 (diff)
downloadPeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.tar.gz
PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.tar.zst
PeerTube-a9bfa85d2cdf13670aaced740da5b493fbeddfce.zip
Add ability for admins to set default p2p policy
Diffstat (limited to 'server/initializers/migrations/0675-p2p-enabled.ts')
-rw-r--r--server/initializers/migrations/0675-p2p-enabled.ts21
1 files changed, 21 insertions, 0 deletions
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 @@
1import * as Sequelize from 'sequelize'
2
3async function up (utils: {
4 transaction: Sequelize.Transaction
5 queryInterface: Sequelize.QueryInterface
6 sequelize: Sequelize.Sequelize
7 db: any
8}): Promise<void> {
9 await utils.queryInterface.renameColumn('user', 'webTorrentEnabled', 'p2pEnabled')
10
11 await utils.sequelize.query('ALTER TABLE "user" ALTER COLUMN "p2pEnabled" DROP DEFAULT')
12}
13
14function down (options) {
15 throw new Error('Not implemented.')
16}
17
18export {
19 up,
20 down
21}