[Gekidou] Allow multiple posts in thread and posts in channel for a specific root or channel (#5594)

* Allow multiple posts in thread and posts in channel for a specific root or channel

* Apply suggestions from code review

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>

Co-authored-by: Miguel Alatzar <migbot@users.noreply.github.com>
This commit is contained in:
Elias Nahum
2021-08-04 15:43:25 -04:00
committed by GitHub
parent 733b10377b
commit 7c5b3a1574
15 changed files with 34 additions and 12 deletions

View File

@@ -52,7 +52,7 @@ export default class ChannelModel extends Model {
[GROUPS_IN_CHANNEL]: {type: 'has_many', foreignKey: 'channel_id'},
/** A CHANNEL can be associated with multiple POSTS_IN_CHANNEL (relationship is 1:N) */
[POSTS_IN_CHANNEL]: {type: 'has_many', foreignKey: 'id'},
[POSTS_IN_CHANNEL]: {type: 'has_many', foreignKey: 'channel_id'},
/** A CHANNEL can contain multiple POST (relationship is 1:N) */
[POST]: {type: 'has_many', foreignKey: 'channel_id'},

View File

@@ -38,7 +38,7 @@ export default class PostModel extends Model {
[FILE]: {type: 'has_many', foreignKey: 'post_id'},
/** A POST can have multiple POSTS_IN_THREAD. (relationship is 1:N)*/
[POSTS_IN_THREAD]: {type: 'has_many', foreignKey: 'id'},
[POSTS_IN_THREAD]: {type: 'has_many', foreignKey: 'root_id'},
/** A POST can have multiple REACTION. (relationship is 1:N)*/
[REACTION]: {type: 'has_many', foreignKey: 'post_id'},

View File

@@ -26,6 +26,9 @@ export default class PostsInChannelModel extends Model {
[CHANNEL]: {type: 'belongs_to', key: 'id'},
};
/** channel_id: Associated channel identifier */
@field('channel_id') channelId!: string;
/** earliest : The earliest timestamp of the post in that channel */
@field('earliest') earliest!: number;

View File

@@ -26,6 +26,9 @@ export default class PostsInThreadModel extends Model {
[POST]: {type: 'belongs_to', key: 'id'},
};
/** root_id: Associated root post identifier */
@field('root_id') rootId!: string;
/** earliest : Lower bound of a timestamp range */
@field('earliest') earliest!: number;