Files
mattermost-mobile/app/database/schema/server/table_schemas/my_channel.ts
Elias Nahum 75ed884e65 Add column last_fetched_at to MyChannel & Thread tables and the migration (#6433)
* Add column last_fetched_at to MyChannel & Thread tables and the migration

* Fix schema tests

* Handle lastFetchAt, retrieve threads on init and properly observe thread unreads (#6436)

* [Gekidou] Set lastFetchAt when fetching posts for a channel (#6437)

* Set lastFetchAt when fetching posts for a channel

* When resetting _preparedState set always to null

* Revert changes in WS

* Handle and set lastFetchedAt for MyChannel in iOS push notification

* feedback review

* iOS fallback to last post createAt if no lastFetchAt set

* Handle lastFetchAt on Android push notifications

* create storePostsForChannel local action

* Fix iOS fallback to last post create_at

Co-authored-by: Daniel Espino García <larkox@gmail.com>
2022-06-29 13:28:50 -04:00

25 lines
778 B
TypeScript

// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
// See LICENSE.txt for license information.
import {tableSchema} from '@nozbe/watermelondb';
import {MM_TABLES} from '@constants/database';
const {MY_CHANNEL} = MM_TABLES.SERVER;
export default tableSchema({
name: MY_CHANNEL,
columns: [
{name: 'is_unread', type: 'boolean'},
{name: 'last_post_at', type: 'number'},
{name: 'last_viewed_at', type: 'number'},
{name: 'manually_unread', type: 'boolean'},
{name: 'mentions_count', type: 'number'},
{name: 'message_count', type: 'number'},
{name: 'roles', type: 'string'},
{name: 'viewed_at', type: 'number'},
{name: 'last_fetched_at', type: 'number', isIndexed: true},
],
});