status-go/protocol/migrations/sqlite/1656958989_contact_verification.up.sql
Richard Ramos 0322ac497b
feat: contact verification request (#2586)
fix: add verification request to response

fix: code review

add missing functions and simplify timestamp usage

fix: sync verification requests

feat: add endpoint to fetch all received verification requests

feat: add signal when trusting verification request

Co-authored-by: Jonathan Rainville <rainville.jonathan@gmail.com>
2022-07-05 15:49:44 -04:00

21 lines
624 B
SQL

ALTER TABLE contacts ADD COLUMN verification_status INT DEFAULT 0;
UPDATE contacts SET verification_status = 0;
CREATE TABLE IF NOT EXISTS trusted_users (
id TEXT PRIMARY KEY ON CONFLICT REPLACE,
trust_status INT NOT NULL DEFAULT 0,
updated_at INT NOT NULL DEFAULT 0
) WITHOUT ROWID;
CREATE TABLE IF NOT EXISTS verification_requests (
from_user TEXT,
to_user TEXT,
challenge TEXT NOT NULL,
requested_at INT NOT NULL DEFAULT 0,
response TEXT,
replied_at INT NOT NULL DEFAULT 0,
verification_status INT NOT NULL DEFAULT 0,
CONSTRAINT fromto_unique UNIQUE (from_user, to_user) ON CONFLICT REPLACE
);