Table "addresses" { "id" int [pk, not null, increment] "name" text "localpart" text [not null] "domain" text [not null] "email" text [not null] Indexes { email [unique] } } Table "mailboxes" { "id" int [pk, not null, increment] "name" text [not null] "uidnext" int [not null, default: 1] "nextmodseq" bigint [not null, default: 1] "first_recent" int [not null, default: 1] "uidvalidity" int [not null, default: 1] Indexes { name [unique] } } Table "messages" { "id" int [pk, not null, increment] "messageID" text [pk, not null] "idate" timestamp [not null] "rfc822size" int } Table "mailbox_messages" { "mailbox" int [not null] "uid" int [pk, not null] "message" int [pk, not null] "modseq" bigint [not null] "seen" boolean [not null, default: false] "deleted" boolean [not null, default: false] } Ref: mailbox_messages.mailbox > mailboxes.id Ref: mailbox_messages.message - messages.id Table "bodyparts" { "id" int [pk, not null, increment] "bytes" int [not null] "hash" text [not null] "text" text "data" binary } Table "part_numbers" { "message" int [pk, not null] "part" text [not null] "bodypart" int [not null] "bytes" int "nb_lines" int } // todo on delete cascade Ref: part_numbers.message > messages.id Ref: part_numbers.bodypart - bodyparts.id Table "field_names" { "id" int [pk, not null, increment] "name" text [not null] Indexes { name [unique] } } Table "header_fields" { "id" int [pk, not null, increment] "message" int [pk, not null] "part" text [not null] "position" int [not null] "field" int [not null] "value" text Indexes { message [unique] part [unique] position [unique] field [unique] } } Ref: header_fields.message > messages.id Ref: header_fields.part > part_numbers.part Ref: header_fields.field > field_names.id Table "address_fields" { "message" int [not null] "part" text [not null] "position" int [not null] "field" int [not null] "number" int "address" int [not null] } Ref: address_fields.message > messages.id Ref: address_fields.part > part_numbers.part Ref: address_fields.field > field_names.id Ref: address_fields.address > addresses.id // app table Table "front_threads" { "id" int [pk, not null, increment] "room" int [not null] "name" text "notSeen" int [not null, default: true] "lastUpdate" timestamp [not null] "isDm" bool [not null, default: true] } Ref: front_threads.room > front_rooms.id Table "front_rooms" { "id" int [pk, not null, increment] "name" text "isGroup" bool [not null, default: false] "notSeen" int [not null] "lastUpdate" timestamp [not null] } Table "front_room_messages" { "room" int [not null] "thread" int [not null] "message" int [not null] } Ref: front_room_messages.room > front_rooms.id Ref: front_room_messages.message - messages.id Ref: front_room_messages.thread > front_threads.id