diff options
author | Chocobozzz <me@florianbigard.com> | 2022-08-10 11:51:13 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2022-08-10 14:32:00 +0200 |
commit | a3b472a12ec6e57dbe2f650419f8064864686eab (patch) | |
tree | f36559488e34493c029b686772e986902150a647 /server/initializers/migrations | |
parent | 0567049a9819d67070aa6d548a75a7e632a4aaa4 (diff) | |
download | PeerTube-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.ts | 32 |
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 @@ | |||
1 | import * as Sequelize from 'sequelize' | ||
2 | |||
3 | async 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 | |||
22 | async function down (utils: { | ||
23 | queryInterface: Sequelize.QueryInterface | ||
24 | transaction: Sequelize.Transaction | ||
25 | }) { | ||
26 | await utils.queryInterface.dropTable('videoChannelSync', { transaction: utils.transaction }) | ||
27 | } | ||
28 | |||
29 | export { | ||
30 | up, | ||
31 | down | ||
32 | } | ||