aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-03-22 14:35:04 +0100
committerChocobozzz <me@florianbigard.com>2022-03-22 16:25:14 +0100
commit1808a1f8e4b7b102823492a2007a46929aebf189 (patch)
treea345140ec9a7a20c222ace3cda18ac999277c8c3 /server/initializers/migrations
parent348c2ce3ff3fe2f25a31f08bfb36c88723a0ce46 (diff)
downloadPeerTube-1808a1f8e4b7b102823492a2007a46929aebf189.tar.gz
PeerTube-1808a1f8e4b7b102823492a2007a46929aebf189.tar.zst
PeerTube-1808a1f8e4b7b102823492a2007a46929aebf189.zip
Add video edition finished notification
Diffstat (limited to 'server/initializers/migrations')
-rw-r--r--server/initializers/migrations/0700-edition-finished-notification.ts42
1 files changed, 42 insertions, 0 deletions
diff --git a/server/initializers/migrations/0700-edition-finished-notification.ts b/server/initializers/migrations/0700-edition-finished-notification.ts
new file mode 100644
index 000000000..103c0b456
--- /dev/null
+++ b/server/initializers/migrations/0700-edition-finished-notification.ts
@@ -0,0 +1,42 @@
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 const { transaction } = utils
10
11 {
12 const data = {
13 type: Sequelize.INTEGER,
14 defaultValue: null,
15 allowNull: true
16 }
17 await utils.queryInterface.addColumn('userNotificationSetting', 'myVideoEditionFinished', data, { transaction })
18 }
19
20 {
21 const query = 'UPDATE "userNotificationSetting" SET "myVideoEditionFinished" = 1'
22 await utils.sequelize.query(query, { transaction })
23 }
24
25 {
26 const data = {
27 type: Sequelize.INTEGER,
28 defaultValue: null,
29 allowNull: false
30 }
31 await utils.queryInterface.changeColumn('userNotificationSetting', 'myVideoEditionFinished', data, { transaction })
32 }
33}
34
35function down () {
36 throw new Error('Not implemented.')
37}
38
39export {
40 up,
41 down
42}