aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/initializers/migrations/0080-video-channels.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/initializers/migrations/0080-video-channels.ts')
-rw-r--r--server/initializers/migrations/0080-video-channels.ts4
1 files changed, 2 insertions, 2 deletions
diff --git a/server/initializers/migrations/0080-video-channels.ts b/server/initializers/migrations/0080-video-channels.ts
index fc55ef3a2..f19721517 100644
--- a/server/initializers/migrations/0080-video-channels.ts
+++ b/server/initializers/migrations/0080-video-channels.ts
@@ -34,7 +34,7 @@ async function up (utils: {
34 // Create one author per user that does not already exist 34 // Create one author per user that does not already exist
35 const users = await utils.db.User.findAll() 35 const users = await utils.db.User.findAll()
36 for (const user of users) { 36 for (const user of users) {
37 const author = await utils.db.Author.find({ where: { userId: user.id }}) 37 const author = await utils.db.Author.find({ where: { userId: user.id } })
38 if (!author) { 38 if (!author) {
39 await utils.db.Author.create({ 39 await utils.db.Author.create({
40 name: user.username, 40 name: user.username,
@@ -72,7 +72,7 @@ async function up (utils: {
72 const rawVideos = await utils.sequelize.query(query, options) 72 const rawVideos = await utils.sequelize.query(query, options)
73 73
74 for (const rawVideo of rawVideos) { 74 for (const rawVideo of rawVideos) {
75 const videoChannel = await utils.db.VideoChannel.findOne({ where: { authorId: rawVideo.authorId }}) 75 const videoChannel = await utils.db.VideoChannel.findOne({ where: { authorId: rawVideo.authorId } })
76 76
77 const video = await utils.db.Video.findById(rawVideo.id) 77 const video = await utils.db.Video.findById(rawVideo.id)
78 video.channelId = videoChannel.id 78 video.channelId = videoChannel.id