2
-- Add the DeleteAttachmentFile table, which allows for attachment files to be deleted (garbage
3
-- collected) after all references to them have been removed from the database without worrying
4
-- about deleting them first and the database transaction failing.
6
-- Also add GarbageCollectionTable, a single-row table holding various information about when
7
-- GC has occurred and when it should occur next.
10
CREATE TABLE DeleteAttachmentFileTable (
11
id INTEGER PRIMARY KEY,
12
filename TEXT NOT NULL
15
CREATE TABLE GarbageCollectionTable (
16
id INTEGER PRIMARY KEY,
17
last_reap_time_t INTEGER DEFAULT NULL,
18
last_vacuum_time_t INTEGER DEFAULT NULL,
19
reaped_messages_since_last_vacuum INTEGER DEFAULT 0
22
-- Insert a single row with a well-known rowid and default values, this will be the row used
23
-- by the ImapDB.GC class.
24
INSERT INTO GarbageCollectionTable (id) VALUES (0);