* MM_30476 : Added all isolated tables from the server schema * MM_30476 : Updated 'test' script in package.json * MM_30476 : Added USER section of the server schema * MM_30476 : Added the models index back * MM_30476 : Updated User entity as per previous comments * MM_30476 : Added lazy query to channel membership * MM_30476 : Adjusted PR as per suggestions * MM_30476 : Update nick_name in user model Co-authored-by: Elias Nahum <nahumhbl@gmail.com> * MM_30476 : Adjusted extra padding * MM_30476 : Corrected ChannelMemberShipSchema to ChannelMembershipSchema * MM_30476 : Updated types/database/index.ts to types/database/index.d.ts Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
37 lines
1.2 KiB
TypeScript
37 lines
1.2 KiB
TypeScript
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
|
// See LICENSE.txt for license information.
|
|
|
|
import {Relation} from '@nozbe/watermelondb';
|
|
import Model, {Associations} from '@nozbe/watermelondb/Model';
|
|
|
|
import User from '@typings/database/user';
|
|
import Post from '@typings/database/post';
|
|
|
|
/**
|
|
* The Reaction Model is used to present the reactions a user had on a particular post
|
|
*/
|
|
export default class Reaction extends Model {
|
|
/** table (entity name) : Reaction */
|
|
static table: string;
|
|
|
|
/** associations : Describes every relationship to this entity. */
|
|
static associations: Associations;
|
|
|
|
/** createAt : Creation timestamp used for sorting reactions amongst users on a particular post */
|
|
createAt: number;
|
|
|
|
/** emoji_name : The emoticon used to express the reaction */
|
|
emojiName: string;
|
|
|
|
/** post_id : The related Post's foreign key on which this reaction was expressed */
|
|
postId: string;
|
|
|
|
/** user_id : The related User's foreign key by which this reaction was expressed */
|
|
userId: string;
|
|
|
|
/** reactionUser : The related record to the User model */
|
|
user: Relation<User>;
|
|
|
|
/** reactionPost : The related record to the Post model */
|
|
post: Relation<Post>;
|
|
}
|