Files
matrix-rust-sdk/crates/matrix-sdk-sqlite/migrations/media_store/001_init.sql
dragonfly1033 2afbdfae0b Split media store from event cache store. (#5568)
This PR is a start to the process of splitting the media store from the
event cache store. #5410

It contains:
* Split `MediaStore` trait from `EventCacheStore`. 
* Rename `EventCacheStoreMedia` to `MediaStoreInner`. 
* Move relevant tests into `MediaStoreIntegrationTests`.

This will be done over 3 PR's (reviewing 1, 2, 3 then merging 3 into 2
into 1).

A reminder comment for my own sanity:
This PR will not pass tests until after merging.

Current state of this PR:
- [x] Step 1 reviewed #5568
- [x] Step 2 reviewed #5569 
- [x] Step 3 reviewed #5571 
- [x] Step 3 merged into Step 2
- [x] Step 2 merged into Step 1
- [ ] Add changes to changelog.
- [ ] Ready to merge 🎉 

Note, may also want to: 
* Re-organize file structure
* Split/refactor benchmarks namely `benchmarks/benches/event_cache.rs`

<!-- description of the changes in this PR -->

- [ ] Public API changes documented in changelogs (optional)

<!-- Sign-off, if not part of the commits -->
<!-- See CONTRIBUTING.md if you don't know what this is -->
Signed-off-by: Shrey Patel shreyp@element.io

---------

Co-authored-by: Shrey Patel <shreyp@element.io>
2025-09-10 12:03:02 +02:00

22 lines
508 B
SQL

-- basic kv metadata like the database version and store cipher
CREATE TABLE "kv" (
"key" TEXT PRIMARY KEY NOT NULL,
"value" BLOB NOT NULL
);
CREATE TABLE "media" (
"uri" BLOB NOT NULL,
"format" BLOB NOT NULL,
"data" BLOB NOT NULL,
"last_access" INTEGER NOT NULL,
"ignore_policy" BOOLEAN NOT NULL DEFAULT FALSE,
PRIMARY KEY ("uri", "format")
);
CREATE TABLE "lease_locks" (
"key" TEXT PRIMARY KEY NOT NULL,
"holder" TEXT NOT NULL,
"expiration" REAL NOT NULL
);