aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-10 11:51:13 +0200
committerChocobozzz <me@florianbigard.com>2022-08-10 14:32:00 +0200
commita3b472a12ec6e57dbe2f650419f8064864686eab (patch)
treef36559488e34493c029b686772e986902150a647 /server/initializers
parent0567049a9819d67070aa6d548a75a7e632a4aaa4 (diff)
downloadPeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.tar.gz
PeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.tar.zst
PeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.zip
Add ability to list imports of a channel sync
Diffstat (limited to 'server/initializers')
-rw-r--r--server/initializers/constants.ts2
-rw-r--r--server/initializers/migrations/0735-video-channel-sync-import-foreign-key.ts32
2 files changed, 33 insertions, 1 deletions
diff --git a/server/initializers/constants.ts b/server/initializers/constants.ts
index 697a64d42..c2289ef36 100644
--- a/server/initializers/constants.ts
+++ b/server/initializers/constants.ts
@@ -25,7 +25,7 @@ import { CONFIG, registerConfigChangedHandler } from './config'
25 25
26// --------------------------------------------------------------------------- 26// ---------------------------------------------------------------------------
27 27
28const LAST_MIGRATION_VERSION = 730 28const LAST_MIGRATION_VERSION = 735
29 29
30// --------------------------------------------------------------------------- 30// ---------------------------------------------------------------------------
31 31
diff --git a/server/initializers/migrations/0735-video-channel-sync-import-foreign-key.ts b/server/initializers/migrations/0735-video-channel-sync-import-foreign-key.ts
new file mode 100644
index 000000000..ffe0b11ab
--- /dev/null
+++ b/server/initializers/migrations/0735-video-channel-sync-import-foreign-key.ts
@@ -0,0 +1,32 @@
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.addColumn('videoImport', 'videoChannelSyncId', {
10 type: Sequelize.INTEGER,
11 defaultValue: null,
12 allowNull: true,
13 references: {
14 model: 'videoChannelSync',
15 key: 'id'
16 },
17 onUpdate: 'CASCADE',
18 onDelete: 'SET NULL'
19 }, { transaction: utils.transaction })
20}
21
22async function down (utils: {
23 queryInterface: Sequelize.QueryInterface
24 transaction: Sequelize.Transaction
25}) {
26 await utils.queryInterface.dropTable('videoChannelSync', { transaction: utils.transaction })
27}
28
29export {
30 up,
31 down
32}