79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
@ 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, -- 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
|
|
|
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
|
@ 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, -- 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
|
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
|
@ -- Linkages between checkins, files created by each checkin, and
@ -- the names of those files.
@ --
@ -- pid==0 if the file is added by checkin mid.
@ -- fid==0 if the file is removed by checkin mid.
@ --
@ CREATE TABLE mlink(
@ mid INTEGER REFERENCES blob, -- Manifest ID where change occurs
@ pid INTEGER REFERENCES blob, -- File ID in parent manifest
@ fid INTEGER REFERENCES blob, -- Changed file ID in this manifest
@ fnid INTEGER REFERENCES filename, -- Name of the file
@ pfnid INTEGER REFERENCES filename, -- Previous name. 0 if unchanged
@ mperm INTEGER -- File permissions. 1==exec
@ isaux BOOLEAN DEFAULT 0 -- TRUE if pmid is the primary (not used yet)
@ );
@ CREATE INDEX mlink_i1 ON mlink(mid);
@ CREATE INDEX mlink_i2 ON mlink(fnid);
@ CREATE INDEX mlink_i3 ON mlink(fid);
@ CREATE INDEX mlink_i4 ON mlink(pid);
@
@ -- 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
|
>
|
>
|
<
|
|
|
|
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
|
@ -- Linkages between checkins, files created by each checkin, and
@ -- the names of those files.
@ --
@ -- pid==0 if the file is added by checkin mid.
@ -- fid==0 if the file is removed by checkin mid.
@ --
@ CREATE TABLE mlink(
@ mid INTEGER REFERENCES plink(cid), -- Checkin that contains fid
@ fid INTEGER REFERENCES blob, -- New file content. 0 if deleted
@ pmid INTEGER DEFAULT 0 -- (not used yet)
@ pid INTEGER REFERENCES blob, -- Prev file content. 0 if new
@ fnid INTEGER REFERENCES filename, -- Name of the file
@ pfnid INTEGER REFERENCES filename, -- Previous name. 0 if unchanged
@ mperm INTEGER, -- File permissions. 1==exec
@ isaux BOOLEAN DEFAULT 0 -- (not used yet)
@ );
@ CREATE INDEX mlink_i1 ON mlink(mid);
@ CREATE INDEX mlink_i2 ON mlink(fnid);
@ CREATE INDEX mlink_i3 ON mlink(fid);
@ CREATE INDEX mlink_i4 ON mlink(pid);
@
@ -- 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 cid 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
|
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
|
@ -- done by an --integrate merge. The difference between vfile.chnged==3|5
@ -- and a regular add is that with vfile.chnged==3|5 we know that the
@ -- current version of the file is already in the repository.
@ --
@ CREATE TABLE vfile(
@ id INTEGER PRIMARY KEY, -- ID of the checked out file
@ vid INTEGER REFERENCES blob, -- The baseline this file is part of.
@ chnged INT DEFAULT 0, -- 0:unchnged 1:edited 2:m-chng 3:m-add 4:i-chng 5:i-add
@ deleted BOOLEAN DEFAULT 0, -- True if deleted
@ isexe BOOLEAN, -- True if file should be executable
@ islink BOOLEAN, -- True if file should be symlink
@ rid INTEGER, -- Originally from this repository record
@ mrid INTEGER, -- Based on this record due to a merge
@ mtime INTEGER, -- Mtime of file on disk. sec since 1970
@ pathname TEXT, -- Full pathname relative to root
|
|
|
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
|
@ -- done by an --integrate merge. The difference between vfile.chnged==3|5
@ -- and a regular add is that with vfile.chnged==3|5 we know that the
@ -- current version of the file is already in the repository.
@ --
@ CREATE TABLE vfile(
@ id INTEGER PRIMARY KEY, -- ID of the checked out file
@ vid INTEGER REFERENCES blob, -- The baseline this file is part of.
@ chnged INT DEFAULT 0, -- 0:unchng 1:edit 2:m-chng 3:m-add 4:i-chng 5:i-add
@ deleted BOOLEAN DEFAULT 0, -- True if deleted
@ isexe BOOLEAN, -- True if file should be executable
@ islink BOOLEAN, -- True if file should be symlink
@ rid INTEGER, -- Originally from this repository record
@ mrid INTEGER, -- Based on this record due to a merge
@ mtime INTEGER, -- Mtime of file on disk. sec since 1970
@ pathname TEXT, -- Full pathname relative to root
|