status-console-client/protocol/client/migrations/0001_add_messages_contacts.up.db.sql
Dmitry Shulyak 0775fbb085
Implement streams for public and private chats (#35)
Stateless messenger

Replace original messenger with stateless messenger

Add benchmark for loading messages

Add new message event after msg was persisted

Request history chat by chat otherwise it doesn't worko

Db and stream tests

Move flag parsing higher

Fix linter and test
2019-05-14 19:34:36 +03:00

23 lines
466 B
SQL

CREATE TABLE IF NOT EXISTS user_messages (
id VARCHAR UNIQUE NOT NULL,
contact_id VARCHAR NOT NULL,
content_type VARCHAR,
message_type VARCHAR,
text TEXT,
clock BIGINT,
timestamp BIGINT,
content_chat_id TEXT,
content_text TEXT,
public_key BLOB
);
CREATE INDEX contact_ids ON user_messages(contact_id);
CREATE TABLE IF NOT EXISTS user_contacts (
id VARCHAR PRIMARY KEY NOT NULL,
name VARCHAR NOT NULL,
type INT NOT NULL,
state INT,
public_key BLOB
) WITHOUT ROWID;