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 */