CREATE TABLE IF NOT EXISTS revoked_peers (
    id         INTEGER PRIMARY KEY AUTOINCREMENT,
    device_id  TEXT    NOT NULL UNIQUE,
    public_key TEXT    NOT NULL,
    revoked_at INTEGER NOT NULL,
    revoked_by TEXT    NOT NULL,
    reason     TEXT    NOT NULL,
    prev_hash  TEXT    NOT NULL DEFAULT '',
    this_hash  TEXT    NOT NULL
);

CREATE INDEX IF NOT EXISTS idx_revoked_peers_device_id  ON revoked_peers (device_id);
CREATE INDEX IF NOT EXISTS idx_revoked_peers_revoked_at ON revoked_peers (revoked_at);
