From 5a86c58ccbc0567c6af1d59dfab98aa59398bf80 Mon Sep 17 00:00:00 2001 From: Avinash Lingaloo Date: Thu, 31 Mar 2022 17:32:27 +0400 Subject: [PATCH] fix association (#6108) --- app/database/models/server/posts_in_channel.ts | 2 +- app/database/models/server/posts_in_thread.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/database/models/server/posts_in_channel.ts b/app/database/models/server/posts_in_channel.ts index 4b3e00b58..8abda43f3 100644 --- a/app/database/models/server/posts_in_channel.ts +++ b/app/database/models/server/posts_in_channel.ts @@ -24,7 +24,7 @@ export default class PostsInChannelModel extends Model implements PostsInChannel static associations: Associations = { /** A CHANNEL can have multiple POSTS_IN_CHANNEL. (relationship is 1:N)*/ - [CHANNEL]: {type: 'belongs_to', key: 'id'}, + [CHANNEL]: {type: 'belongs_to', key: 'channel_id'}, }; /** channel_id: Associated channel identifier */ diff --git a/app/database/models/server/posts_in_thread.ts b/app/database/models/server/posts_in_thread.ts index 45116e747..e7f56b0a6 100644 --- a/app/database/models/server/posts_in_thread.ts +++ b/app/database/models/server/posts_in_thread.ts @@ -24,7 +24,7 @@ export default class PostsInThreadModel extends Model implements PostsInThreadMo static associations: Associations = { /** A POST can have a POSTS_IN_THREAD.(relationship is 1:1)*/ - [POST]: {type: 'belongs_to', key: 'id'}, + [POST]: {type: 'belongs_to', key: 'root_id'}, }; /** root_id: Associated root post identifier */