Add new follow, mention and user registered notifs
[oweals/peertube.git] / server / initializers / migrations / 0315-user-notifications.ts
index 2bd9c657d40d236e5e2f6754f08c164fc4db9c3b..34f9fd193abf987cfbaa561c93875b539111da87 100644 (file)
@@ -13,6 +13,11 @@ 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,
+"newUserRegistration" INTEGER NOT NULL DEFAULT NULL,
+"newFollow" INTEGER NOT NULL DEFAULT NULL,
+"commentMention" 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 +29,9 @@ PRIMARY KEY ("id"))
   {
     const query = 'INSERT INTO "userNotificationSetting" ' +
       '("newVideoFromSubscription", "newCommentOnMyVideo", "videoAbuseAsModerator", "blacklistOnMyVideo", ' +
+      '"myVideoPublished", "myVideoImportFinished", "newUserRegistration", "newFollow", "commentMention", ' +
       '"userId", "createdAt", "updatedAt") ' +
-      '(SELECT 2, 2, 4, 4, id, NOW(), NOW() FROM "user")'
+      '(SELECT 2, 2, 4, 4, 2, 2, 2, 2, 2, id, NOW(), NOW() FROM "user")'
 
     await utils.sequelize.query(query)
   }