Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor database tables and query wrappers #402

Merged
merged 7 commits into from
Dec 31, 2023
Merged

Refactor database tables and query wrappers #402

merged 7 commits into from
Dec 31, 2023

Conversation

tulir
Copy link
Member

@tulir tulir commented Dec 30, 2023

  • 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.

@tulir tulir merged commit 35db0ab into main Dec 31, 2023
12 checks passed
@tulir tulir deleted the tulir/db-refactor branch December 31, 2023 14:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant