CREATE TABLE IF NOT EXISTS devices (
    identity_key BLOB NOT NULL,
    device_id BLOB NOT NULL,
    device_name TEXT NOT NULL DEFAULT '',
    registered_at INTEGER NOT NULL DEFAULT (strftime('%s','now')),
    PRIMARY KEY (identity_key, device_id)
);
CREATE INDEX IF NOT EXISTS idx_devices_identity ON devices(identity_key);
