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

Add database models #289

Merged
merged 28 commits into from
Nov 1, 2023
Merged

Add database models #289

merged 28 commits into from
Nov 1, 2023

Conversation

neekolas
Copy link
Contributor

@neekolas neekolas commented Oct 30, 2023

Summary

  • Adds a first pass at the database schema
  • Adds initial models matching the schema
  • Breaks up models into one file per table

Notes

I decided to break up the DB models into multiple files. The xmtp crate's EncryptedMessageStore was getting pretty long and unwieldy, especially for tests. I figure we can break up the impl blocks for the store methods and all the Trait implementations into the respective per-table files and things should be more manageable. Lmk what you all think.

@neekolas neekolas changed the title Refactor DB stuff into multiple files Add database models Oct 30, 2023
Base automatically changed from rich/sqlite-store to main October 30, 2023 15:32
@neekolas neekolas marked this pull request as ready for review October 30, 2023 16:17
@neekolas neekolas requested review from a team, richardhuaaa and insipx October 30, 2023 16:17
user_address TEXT PRIMARY KEY NOT NULL,
created_at BIGINT NOT NULL,
last_refreshed BIGINT NOT NULL
user_address TEXT PRIMARY KEY NOT NULL,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we re-using some of the tables from XMTP?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This schema below is all we have a need for at the moment. Because OpenMLS has its own database structure with the KeyValue store, some of the tables from the old xmtp schema simply aren't necessary.

Copy link
Contributor

@insipx insipx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@neekolas neekolas merged commit 9c0984d into main Nov 1, 2023
10 of 14 checks passed
@neekolas neekolas deleted the nmolnar/add-db-models branch November 1, 2023 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants