]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/initializers/migrations/0315-user-notifications.ts
Add import finished and video published notifs
[github/Chocobozzz/PeerTube.git] / server / initializers / migrations / 0315-user-notifications.ts
index 2bd9c657d40d236e5e2f6754f08c164fc4db9c3b..8c54c5d6c9e5d48067b314f05188ed3f36c90d82 100644 (file)
@@ -13,6 +13,8 @@ CREATE TABLE IF NOT EXISTS "userNotificationSetting" ("id" SERIAL,
 "newCommentOnMyVideo" INTEGER NOT NULL DEFAULT NULL,
 "videoAbuseAsModerator" INTEGER NOT NULL DEFAULT NULL,
 "blacklistOnMyVideo" INTEGER NOT NULL DEFAULT NULL,
+"myVideoPublished" INTEGER NOT NULL DEFAULT NULL,
+"myVideoImportFinished" INTEGER NOT NULL DEFAULT NULL,
 "userId" INTEGER REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
 "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL,
 "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL,
@@ -24,8 +26,8 @@ PRIMARY KEY ("id"))
   {
     const query = 'INSERT INTO "userNotificationSetting" ' +
       '("newVideoFromSubscription", "newCommentOnMyVideo", "videoAbuseAsModerator", "blacklistOnMyVideo", ' +
-      '"userId", "createdAt", "updatedAt") ' +
-      '(SELECT 2, 2, 4, 4, id, NOW(), NOW() FROM "user")'
+      '"myVideoPublished", "myVideoImportFinished", "userId", "createdAt", "updatedAt") ' +
+      '(SELECT 2, 2, 4, 4, 2, 2, id, NOW(), NOW() FROM "user")'
 
     await utils.sequelize.query(query)
   }