2021-10-13 05:50:48 +00:00
|
|
|
CREATE TABLE "accounts" (
|
2021-10-25 23:42:14 +00:00
|
|
|
"id" INTEGER PRIMARY KEY AUTOINCREMENT
|
2021-10-13 05:50:48 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE "mailboxes" (
|
2021-10-29 03:20:03 +00:00
|
|
|
"account" INTEGER NOT NULL,
|
|
|
|
"name" TEXT NOT NULL,
|
|
|
|
"uidvalidity" INTEGER NOT NULL,
|
2021-10-13 05:50:48 +00:00
|
|
|
|
|
|
|
PRIMARY KEY ("account", "name")
|
|
|
|
);
|
|
|
|
|
|
|
|
CREATE TABLE "messages" (
|
2021-11-05 13:51:58 +00:00
|
|
|
-- "id" TEXT PRIMARY KEY,
|
|
|
|
"id" INTEGER PRIMARY KEY,
|
|
|
|
"mailbox_acct" TEXT NOT NULL,
|
|
|
|
"mailbox" TEXT NOT NULL,
|
|
|
|
"uid" INTEGER NOT NULL,
|
2021-10-29 03:20:03 +00:00
|
|
|
"date" DATETIME,
|
|
|
|
"subject" TEXT,
|
|
|
|
"from" JSON,
|
|
|
|
"sender" JSON,
|
|
|
|
"reply_to" JSON,
|
|
|
|
"to" JSON,
|
|
|
|
"cc" JSON,
|
|
|
|
"bcc" JSON,
|
|
|
|
"in_reply_to" TEXT,
|
|
|
|
"message_id" TEXT,
|
2021-11-05 13:51:58 +00:00
|
|
|
"mbox" BLOB,
|
|
|
|
|
|
|
|
FOREIGN KEY ("mailbox_acct") REFERENCES "mailboxes" ("account"),
|
|
|
|
FOREIGN KEY ("mailbox") REFERENCES "mailboxes" ("name")
|
2021-10-13 05:50:48 +00:00
|
|
|
);
|