github.com/status-im/status-go@v1.1.0/protocol/encryption/migrations/sqlite/1536754952_initial_schema.up.sql (about)

     1  CREATE TABLE sessions (
     2    dhr BLOB,
     3    dhs_public BLOB,
     4    dhs_private BLOB,
     5    root_chain_key BLOB,
     6    send_chain_key BLOB,
     7    send_chain_n INTEGER,
     8    recv_chain_key BLOB,
     9    recv_chain_n INTEGER,
    10    step INTEGER,
    11    pn  INTEGER,
    12    id BLOB NOT NULL PRIMARY KEY,
    13    UNIQUE(id) ON CONFLICT REPLACE
    14  );
    15  
    16  CREATE TABLE keys (
    17    public_key BLOB NOT NULL,
    18    msg_num INTEGER,
    19    message_key BLOB NOT NULL,
    20    UNIQUE (msg_num, message_key) ON CONFLICT REPLACE
    21  );
    22  
    23  CREATE TABLE bundles (
    24    identity BLOB NOT NULL,
    25    installation_id TEXT NOT NULL,
    26    private_key BLOB,
    27    signed_pre_key BLOB NOT NULL PRIMARY KEY ON CONFLICT IGNORE,
    28    timestamp UNSIGNED BIG INT NOT NULL,
    29    expired BOOLEAN DEFAULT 0
    30  );
    31  
    32  CREATE TABLE ratchet_info (
    33    bundle_id BLOB NOT NULL,
    34    ephemeral_key BLOB,
    35    identity BLOB NOT NULL,
    36    symmetric_key BLOB NOT NULL,
    37    installation_id TEXT NOT NULL,
    38    UNIQUE(bundle_id, identity) ON CONFLICT REPLACE,
    39    FOREIGN KEY (bundle_id) REFERENCES bundles(signed_pre_key)
    40  );