aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations
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/migrations
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/migrations')
-rw-r--r--server/initializers/migrations/0735-video-channel-sync-import-foreign-key.ts32
1 files changed, 32 insertions, 0 deletions
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}