42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
|
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
|
-
+
+
|
** The content tables have a content version number which rarely
** changes. The aux tables have an arbitrary version number (typically
** a date) which can change frequently. When the content schema changes,
** we have to execute special procedures to update the schema. When
** the aux schema changes, all we need to do is rebuild the database.
*/
#define CONTENT_SCHEMA "2"
#define AUX_SCHEMA "2011-04-25 19:50"
#define AUX_SCHEMA_MIN "2011-04-25 19:50"
#define AUX_SCHEMA_MAX "2014-11-24 20:35"
#endif /* INTERFACE */
/*
** The schema for a repository database.
**
|
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
-
-
+
+
|
@ rcvid INTEGER, -- Origin of this record
@ size INTEGER, -- Size of content. -1 for a phantom.
@ uuid TEXT UNIQUE NOT NULL, -- SHA1 hash of the content
@ content BLOB, -- Compressed content of this record
@ CHECK( length(uuid)==40 AND rid>0 )
@ );
@ CREATE TABLE delta(
@ rid INTEGER PRIMARY KEY, -- Record ID
@ srcid INTEGER NOT NULL REFERENCES blob -- Record holding source document
@ rid INTEGER PRIMARY KEY, -- BLOB that is delta-compressed
@ srcid INTEGER NOT NULL REFERENCES blob -- Baseline for delta-compression
@ );
@ CREATE INDEX delta_i1 ON delta(srcid);
@
@ -------------------------------------------------------------------------
@ -- The BLOB and DELTA tables above hold the "global state" of a Fossil
@ -- project; the stuff that is normally exchanged during "sync". The
@ -- "local state" of a repository is contained in the remaining tables of
|
248
249
250
251
252
253
254
255
256
257
258
259
260
261
|
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
|
+
|
@ -- Parent/child linkages between checkins
@ --
@ CREATE TABLE plink(
@ pid INTEGER REFERENCES blob, -- Parent manifest
@ cid INTEGER REFERENCES blob, -- Child manifest
@ isprim BOOLEAN, -- pid is the primary parent of cid
@ mtime DATETIME, -- the date/time stamp on cid. Julian day.
@ baseid INTEGER REFERENCES blob, -- Baseline if child is a delta manifest
@ UNIQUE(pid, cid)
@ );
@ CREATE INDEX plink_i2 ON plink(cid,pid);
@
@ -- A "leaf" checkin is a checkin that has no children in the same
@ -- branch. The set of all leaves is easily computed with a join,
@ -- between the plink and tagxref tables, but it is a slower join for
|