BlueGit

ict rusty-teams

Files

rusty-teams / crates / store / src / migrations / 0012_outbox_drafts.sql

0012_outbox_drafts.sql

0012_outbox_drafts.sql 872 B Download Raw
1CREATE TABLE outbox (
2 id TEXT PRIMARY KEY,
3 conversation_id TEXT NOT NULL,
4 target TEXT NOT NULL,
5 thread_root_id TEXT,
6 payload TEXT NOT NULL,
7 state TEXT NOT NULL,
8 last_error TEXT,
9 created_at INTEGER NOT NULL
10);
11
12CREATE INDEX outbox_by_conversation ON outbox (conversation_id, created_at);
13
14CREATE TABLE drafts (
15 conversation_id TEXT PRIMARY KEY,
16 payload TEXT NOT NULL,
17 preview TEXT NOT NULL,
18 updated_at INTEGER NOT NULL
19);
20
21CREATE TABLE attachment_images (
22 owner_kind TEXT NOT NULL,
23 owner_id TEXT NOT NULL,
24 position INTEGER NOT NULL,
25 name TEXT NOT NULL,
26 format TEXT NOT NULL,
27 bytes BLOB NOT NULL,
28 width INTEGER,
29 height INTEGER,
30 PRIMARY KEY (owner_kind, owner_id, position)
31) WITHOUT ROWID;