1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
|
Table account {
entitykey INTEGER [pk, increment]
jid TEXT
}
Table jid {
entitykey INTEGER [pk, increment]
jid TEXT
}
Table occupant {
entitykey INTEGER [pk, increment]
fk_account_ek INTEGER [not null]
fk_jid_ek INTEGER [not null, note: 'remote jid']
timestamp REAL [not null]
id TEXT [not null]
fk_real_jid_ek TEXT
nickname TEXT
avatar_sha TEXT
indexes {
(id, fk_jid_ek, fk_account_ek) [unique, name: 'idx_occupant']
}
}
Ref: occupant.fk_account_ek > account.entitykey [delete: cascade]
Ref: occupant.fk_jid_ek > jid.entitykey
Ref: occupant.fk_real_jid_ek > jid.entitykey
Table message {
entitykey INTEGER [pk, increment]
fk_account_ek INTEGER [not null]
fk_jid_ek INTEGER [not null, note: 'remote jid']
resource TEXT
m_type INTEGER [not null]
direction INTEGER [not null]
timestamp REAL [not null]
message_id TEXT [not null]
stanza_id TEXT
stable_id INTEGER [not null]
fk_occupant_ek INTEGER
message TEXT [not null]
user_delay_ts REAL
fk_encryption_ek INTEGER
fk_securitylabel_ek INTEGER
indexes {
(fk_account_ek, fk_jid_ek, timestamp) [name: 'idx_message', note: 'timestamp DESC']
(message_id, fk_jid_ek, fk_account_ek, direction) [unique, name: 'idx_message_dedup']
}
}
Ref: message.fk_account_ek > account.entitykey [delete: cascade]
Ref: message.fk_jid_ek > jid.entitykey
Ref: message.fk_occupant_ek > occupant.entitykey
Ref: message.fk_securitylabel_ek > securitylabel.entitykey
Ref: message.fk_encryption_ek > encryption.entitykey
Table call {
entitykey INTEGER [pk]
sid TEXT
}
Ref: call.entitykey - message.entitykey [delete: cascade]
Table filetransfer {
entitykey INTEGER [pk]
sid TEXT
}
Ref: filetransfer.entitykey - message.entitykey [delete: cascade]
Table encryption {
entitykey INTEGER [pk, increment]
protocol INTEGER [not null]
key TEXT [not null]
trust INTEGER [not null]
indexes {
(protocol, key, trust) [name: 'idx_encryption']
}
}
Table oob {
entitykey INTEGER [pk]
url TEXT [not null]
description TEXT
}
Ref: oob.entitykey - message.entitykey [delete: cascade]
Table reply {
entitykey INTEGER [pk]
fallback_end INTEGER
quoted_jid TEXT [not null]
quoted_id TEXT [not null]
}
Ref: reply.entitykey - message.entitykey [delete: cascade]
Table securitylabel {
entitykey INTEGER [pk, increment]
fk_account_ek INTEGER [not null]
fk_jid_ek INTEGER [not null, note: 'remote jid']
timestamp REAL [not null]
label_hash TEXT [not null]
displaymarking TEXT [not null]
fgcolor TEXT [not null]
bgcolor TEXT [not null]
indexes {
(label_hash, fk_jid_ek, fk_account_ek) [unique, name: 'idx_securitylabel']
}
}
Ref: securitylabel.fk_account_ek > account.entitykey [delete: cascade]
Ref: securitylabel.fk_jid_ek > jid.entitykey
Table error {
entitykey INTEGER [pk, increment]
fk_account_ek INTEGER [not null]
fk_jid_ek INTEGER [not null, note: 'remote jid']
error_id TEXT
by TEXT
e_type TEXT [not null]
text TEXT
condition TEXT [not null]
condition_text TEXT
indexes {
(error_id, fk_jid_ek, fk_account_ek) [unique, name: 'idx_error']
}
}
Ref: error.fk_account_ek > account.entitykey [delete: cascade]
Ref: error.fk_jid_ek > jid.entitykey
Table reaction {
entitykey INTEGER [pk, increment]
fk_account_ek INTEGER [not null]
fk_jid_ek INTEGER [not null, note: 'remote jid']
direction INTEGER [not null]
timestamp REAL [not null]
fk_occupant_ek INTEGER [not null]
reaction_id TEXT
emojis TEXT [not null]
indexes {
(reaction_id, fk_jid_ek, fk_account_ek, fk_occupant_ek) [unique, name: 'idx_reaction']
}
}
Ref: reaction.fk_account_ek > account.entitykey [delete: cascade]
Ref: reaction.fk_jid_ek > jid.entitykey
Table retraction {
entitykey INTEGER [pk, increment]
fk_account_ek INTEGER [not null]
fk_jid_ek INTEGER [not null, note: 'remote jid']
direction INTEGER [not null]
timestamp REAL [not null]
fk_occupant_ek INTEGER [not null]
retraction_id TEXT [not null]
indexes {
(retraction_id, fk_jid_ek, fk_account_ek, fk_occupant_ek, direction) [unique, name: 'idx_retraction']
}
}
Ref: retraction.fk_account_ek > account.entitykey [delete: cascade]
Ref: retraction.fk_jid_ek > jid.entitykey
Table moderation {
entitykey INTEGER [pk, increment]
fk_account_ek INTEGER [not null]
fk_jid_ek INTEGER [not null, note: 'remote jid']
timestamp REAL [not null]
moderation_id TEXT [not null]
fk_occupant_ek INTEGER
by TEXT [not null]
reason TEXT
indexes {
(moderation_id, fk_jid_ek, fk_account_ek) [unique, name: 'idx_moderation']
}
}
Ref: moderation.fk_account_ek > account.entitykey [delete: cascade]
Ref: moderation.fk_jid_ek > jid.entitykey
Ref: moderation.fk_occupant_ek > occupant.entitykey
Table correction {
entitykey INTEGER [pk, increment]
fk_account_ek INTEGER [not null]
fk_jid_ek INTEGER [not null, note: 'remote jid']
resource TEXT
direction INTEGER [not null]
timestamp INTEGER [not null]
message_id TEXT
fk_occupant_ek INTEGER
correction_id TEXT [not null]
corrected_message TEXT [not null]
fk_encryption_ek INTEGER
indexes {
(correction_id, fk_jid_ek, fk_account_ek, direction, fk_occupant_ek, timestamp) [name: 'idx_correction', note: 'timestamp DESC']
(message_id, fk_jid_ek, fk_account_ek, direction) [unique, name: 'idx_correction_dedup']
}
}
Ref: correction.fk_account_ek > account.entitykey [delete: cascade]
Ref: correction.fk_jid_ek > jid.entitykey
Ref: correction.fk_occupant_ek > occupant.entitykey
Ref: correction.fk_encryption_ek > encryption.entitykey
Table marker {
entitykey INTEGER [pk, increment]
fk_account_ek INTEGER [not null]
fk_jid_ek INTEGER [not null, note: 'remote jid']
fk_occupant_ek INTEGER [not null]
marker_id TEXT [not null]
received_ts INTEGER
displayed_ts INTEGER
acknowledged_ts INTEGER
indexes {
(marker_id, fk_jid_ek, fk_account_ek, fk_occupant_ek) [unique, name: 'idx_marker']
}
}
Ref: marker.fk_account_ek > account.entitykey [delete: cascade]
Ref: marker.fk_jid_ek > jid.entitykey
|