Fix database models type definition (#5588)

This commit is contained in:
Elias Nahum
2021-08-03 00:26:15 -04:00
committed by GitHub
parent e8ce78f39d
commit 85bef9eefc
4 changed files with 21 additions and 21 deletions

View File

@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Relation} from '@nozbe/watermelondb';
import {Query, Relation} from '@nozbe/watermelondb';
import Model, {Associations} from '@nozbe/watermelondb/Model';
/**
@@ -42,19 +42,19 @@ export default class ChannelModel extends Model {
type: string;
/** members : Users belonging to this channel */
members: ChannelMembershipModel[];
members: Query<ChannelMembershipModel>;
/** drafts : All drafts for this channel */
drafts: DraftModel[];
drafts: Query<DraftModel>;
/** groupsInChannel : Every group contained in this channel */
groupsInChannel: GroupsInChannelModel[];
groupsInChannel: Query<GroupsInChannelModel>;
/** posts : All posts made in the channel */
posts: PostModel[];
posts: Query<PostModel>;
/** postsInChannel : a section of the posts for that channel bounded by a range */
postsInChannel: PostsInChannelModel[];
postsInChannel: Query<PostsInChannelModel>;
/** team : The TEAM to which this CHANNEL belongs */
team: Relation<TeamModel>;

View File

@@ -22,11 +22,11 @@ export default class GroupModel extends Model {
name: string;
/** groupsInChannel : All the related children records from GroupsInChannel */
groupsInChannel: GroupsInChannelModel[];
groupsInChannel: Query<GroupsInChannelModel>;
/** groupsInTeam : All the related children records from GroupsInTeam */
groupsInTeam: GroupsInTeamModel[];
groupsInTeam: Query<GroupsInTeamModel>;
/** groupMemberships : All the related children records from GroupMembership */
groupMemberships: GroupMembershipModel[];
groupMemberships: Query<GroupMembershipModel>;
}

View File

@@ -1,7 +1,7 @@
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {Relation} from '@nozbe/watermelondb';
import {Query, Relation} from '@nozbe/watermelondb';
import Model, {Associations} from '@nozbe/watermelondb/Model';
/**
@@ -57,19 +57,19 @@ export default class PostModel extends Model {
props: object;
/** drafts : Every drafts associated with this Post */
drafts: DraftModel;
drafts: Query<DraftModel>;
/** files: All the files associated with this Post */
files: FileModel[];
files: Query<FileModel>;
/** postsInThread: Every posts associated to a thread */
postsInThread: PostInThreadModel[];
postsInThread: Query<PostInThreadModel>;
/** metadata: All the extra data associated with this Post */
metadata: Relation<PostMetadataModel>;
/** reactions: All the reactions associated with this Post */
reactions: ReactionModel[];
reactions: Query<ReactionModel>;
/** author: The author of this Post */
author: Relation<UserModel>;

View File

@@ -71,23 +71,23 @@ export default class UserModel extends Model {
timezone: UserTimezone | null;
/** channelsCreated : All the channels that this user created */
channelsCreated: ChannelModel[];
channelsCreated: Query<ChannelModel>;
/** channels : All the channels that this user is part of */
channels: ChannelMembershipModel[];
channels: Query<ChannelMembershipModel>;
/** groups : All the groups that this user is part of */
groups: GroupMembershipModel[];
groups: Query<GroupMembershipModel>;
/** posts : All the posts that this user has written*/
posts: PostModel[];
posts: Query<PostModel>;
/** preferences : All user preferences */
preferences: PreferenceModel[];
preferences: Query<PreferenceModel>;
/** reactions : All the reactions to posts that this user had */
reactions: ReactionModel[];
reactions: Query<ReactionModel>;
/** teams : All the team that this user is part of */
teams: TeamMembershipModel[];
teams: Query<TeamMembershipModel>;
}