status-go/protocol/migrations/sqlite/1662106895_add_chat_first_message_timestamp.up.sql
Patryk Osmaczko 65be6f2b96 feat: add and distribute chatIdentity.FirstMessageTimestamp
`FirstMessageTimestamp` enables members of the community to determine if
there are any messages they can fetch on the community channel(chat).

`FirstMessageTimestamp` is advertised by admin for each community chat
through `CommunityDescription`. It assumes admin is online frequently
enough to capture the first channel message.

For existing communities admin determines first message timestamp by
finding oldest chat message in its local database.

task: status-im/status-desktop#6731
2022-09-09 08:59:39 +02:00

2 lines
113 B
SQL

ALTER TABLE chats ADD COLUMN first_message_timestamp INT DEFAULT 0;
UPDATE chats SET first_message_timestamp = 0;