~hkdb/geary/disco-3.34.1

« back to all changes in this revision

Viewing changes to sql/version-024.sql

  • Committer: hkdb
  • Date: 2019-10-08 10:54:21 UTC
  • Revision ID: hkdb@3df.io-20191008105421-3dkwnpnhcamm77to
Tags: upstream-3.34.1-disco
ImportĀ upstreamĀ versionĀ 3.34.1-disco

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--
 
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.
 
5
--
 
6
-- Also add GarbageCollectionTable, a single-row table holding various information about when
 
7
-- GC has occurred and when it should occur next.
 
8
--
 
9
 
 
10
CREATE TABLE DeleteAttachmentFileTable (
 
11
    id INTEGER PRIMARY KEY,
 
12
    filename TEXT NOT NULL
 
13
);
 
14
 
 
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
 
20
);
 
21
 
 
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);
 
25