Files
mattermost-mobile/app/constants/database.ts
Anurag Shivarathri 0e5d63a7c3 [MM-48375 Gekidou] Threads Sync Fix (#6788)
* Init

* Test fix

* New sync implementation

* misc

* Includes migration and other servers sync

* Misc

* Migration fix

* Migration is done version 7

* Update app/queries/servers/thread.ts

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Update app/database/operator/server_data_operator/handlers/team_threads_sync.ts

Co-authored-by: Elias Nahum <nahumhbl@gmail.com>

* Feedback changes

* Fixes when old thread gets a reply

* Fix

Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Elias Nahum <nahumhbl@gmail.com>
2022-12-01 21:38:27 +05:30

103 lines
2.9 KiB
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import keyMirror from '@utils/key_mirror';
export const MM_TABLES = {
APP: {
INFO: 'Info',
GLOBAL: 'Global',
SERVERS: 'Servers',
},
SERVER: {
CATEGORY: 'Category',
CATEGORY_CHANNEL: 'CategoryChannel',
CHANNEL: 'Channel',
CHANNEL_INFO: 'ChannelInfo',
CHANNEL_MEMBERSHIP: 'ChannelMembership',
CONFIG: 'Config',
CUSTOM_EMOJI: 'CustomEmoji',
DRAFT: 'Draft',
FILE: 'File',
GROUP: 'Group',
GROUP_CHANNEL: 'GroupChannel',
GROUP_MEMBERSHIP: 'GroupMembership',
GROUP_TEAM: 'GroupTeam',
MY_CHANNEL: 'MyChannel',
MY_CHANNEL_SETTINGS: 'MyChannelSettings',
MY_TEAM: 'MyTeam',
POST: 'Post',
POSTS_IN_CHANNEL: 'PostsInChannel',
POSTS_IN_THREAD: 'PostsInThread',
PREFERENCE: 'Preference',
REACTION: 'Reaction',
ROLE: 'Role',
SYSTEM: 'System',
TEAM: 'Team',
TEAM_CHANNEL_HISTORY: 'TeamChannelHistory',
TEAM_MEMBERSHIP: 'TeamMembership',
TEAM_SEARCH_HISTORY: 'TeamSearchHistory',
THREAD: 'Thread',
THREADS_IN_TEAM: 'ThreadsInTeam',
THREAD_PARTICIPANT: 'ThreadParticipant',
TEAM_THREADS_SYNC: 'TeamThreadsSync',
USER: 'User',
},
};
export const MIGRATION_EVENTS = keyMirror({
MIGRATION_ERROR: null,
MIGRATION_STARTED: null,
MIGRATION_SUCCESS: null,
});
export const SYSTEM_IDENTIFIERS = {
CONFIG: 'config',
CURRENT_CHANNEL_ID: 'currentChannelId',
LAST_UNREAD_CHANNEL_ID: 'lastUnreadChannelId',
CURRENT_TEAM_ID: 'currentTeamId',
CURRENT_USER_ID: 'currentUserId',
DATA_RETENTION_POLICIES: 'dataRetentionPolicies',
EXPANDED_LINKS: 'expandedLinks',
LAST_DISMISSED_BANNER: 'lastDismissedBanner',
LAST_SERVER_VERSION_CHECK: 'LastServerVersionCheck',
LICENSE: 'license',
ONLY_UNREADS: 'onlyUnreads',
PUSH_VERIFICATION_STATUS: 'pushVerificationStatus',
RECENT_CUSTOM_STATUS: 'recentCustomStatus',
RECENT_MENTIONS: 'recentMentions',
RECENT_REACTIONS: 'recentReactions',
SESSION_EXPIRATION: 'sessionExpiration',
TEAM_HISTORY: 'teamHistory',
WEBSOCKET: 'WebSocket',
};
export const GLOBAL_IDENTIFIERS = {
DEVICE_TOKEN: 'deviceToken',
DONT_ASK_FOR_REVIEW: 'dontAskForReview',
FIRST_LAUNCH: 'firstLaunch',
LAST_ASK_FOR_REVIEW: 'lastAskForReview',
MULTI_SERVER_TUTORIAL: 'multiServerTutorial',
PROFILE_LONG_PRESS_TUTORIAL: 'profileLongPressTutorial',
ONBOARDING: 'onboarding',
};
export enum OperationType {
CREATE = 'CREATE',
UPDATE = 'UPDATE',
DELETE = 'DELETE',
}
// The only two types of databases in the app
export enum DatabaseType {
DEFAULT,
SERVER,
}
export default {
GLOBAL_IDENTIFIERS,
MM_TABLES,
MIGRATION_EVENTS,
SYSTEM_IDENTIFIERS,
};