Otherwise, upgrading to v16 may hit conflicts if two users share the
same Signal UUID, which was possible in prior DB versions.
---
This is useful only when upgrading a DB from the signald version of the
bridge, where some Matrix users had logged into the same Signal account
(and thus shared the same UUID in the "users" table).
Though this removes Signal UUID associations from Matrix users,
migrating from the signald version requires re-logging in anyways.
The only time this would not be safe is when migrating a DB that had
already been migrated from signald (i.e. a v13-v15 version) and users
logged back in, with some sharing the same Signal UUID.
* Change most columns to `NOT NULL`, including primary keys
(because SQLite).
* Change columns only storing signal user IDs (portal receiver, message
sender, user uuid) to use the `uuid` type instead of `TEXT`.
* Drop chat ID from message table primary key.
* Add part index to message table to replace timestamp hack for storing
multiple parts of the same message.
* Change query wrappers to use new QureyHelper struct in dbutil, and
pass contexts and errors everywhere.
As a part of changing the portal receiver from phone number to uuid,
old portals whose receiver isn't logged in anymore may be discarded.
The discarded portals will be stored in the lost_portals table for
cleanup or recovery.