1 import * as Sequelize from 'sequelize'
3 async function up (utils: {
4 transaction: Sequelize.Transaction
5 queryInterface: Sequelize.QueryInterface
6 sequelize: Sequelize.Sequelize
11 CREATE TABLE IF NOT EXISTS "userNotificationSetting" ("id" SERIAL,
12 "newVideoFromSubscription" INTEGER NOT NULL DEFAULT NULL,
13 "newCommentOnMyVideo" INTEGER NOT NULL DEFAULT NULL,
14 "videoAbuseAsModerator" INTEGER NOT NULL DEFAULT NULL,
15 "blacklistOnMyVideo" INTEGER NOT NULL DEFAULT NULL,
16 "myVideoPublished" INTEGER NOT NULL DEFAULT NULL,
17 "myVideoImportFinished" INTEGER NOT NULL DEFAULT NULL,
18 "newUserRegistration" INTEGER NOT NULL DEFAULT NULL,
19 "newFollow" INTEGER NOT NULL DEFAULT NULL,
20 "commentMention" INTEGER NOT NULL DEFAULT NULL,
21 "userId" INTEGER REFERENCES "user" ("id") ON DELETE CASCADE ON UPDATE CASCADE,
22 "createdAt" TIMESTAMP WITH TIME ZONE NOT NULL,
23 "updatedAt" TIMESTAMP WITH TIME ZONE NOT NULL,
26 await utils.sequelize.query(query)
30 const query = 'INSERT INTO "userNotificationSetting" ' +
31 '("newVideoFromSubscription", "newCommentOnMyVideo", "videoAbuseAsModerator", "blacklistOnMyVideo", ' +
32 '"myVideoPublished", "myVideoImportFinished", "newUserRegistration", "newFollow", "commentMention", ' +
33 '"userId", "createdAt", "updatedAt") ' +
34 '(SELECT 1, 1, 3, 3, 1, 1, 1, 1, 1, id, NOW(), NOW() FROM "user")'
36 await utils.sequelize.query(query)
40 function down (options) {
41 throw new Error('Not implemented.')