71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
|
@ -- will exist for the record and that entry will point to another
@ -- entry that holds the source of the delta. Deltas can be chained.
@ --
@ CREATE TABLE blob(
@ rid INTEGER PRIMARY KEY, -- Record ID
@ rcvid INTEGER, -- Origin of this record
@ size INTEGER, -- Size of content. -1 for a phantom.
@ uuid TEXT UNIQUE, -- SHA1 hash of the content
@ content BLOB -- Compressed content of this record
@ );
@ CREATE TABLE delta(
@ rid INTEGER PRIMARY KEY, -- Record ID
@ srcid INTEGER NOT NULL REFERENCES blob -- Record holding source document
@ );
@ CREATE INDEX delta_i1 ON delta(srcid);
@
|
|
|
>
|
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
@ -- will exist for the record and that entry will point to another
@ -- entry that holds the source of the delta. Deltas can be chained.
@ --
@ CREATE TABLE blob(
@ rid INTEGER PRIMARY KEY, -- Record ID
@ 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
@ );
@ CREATE INDEX delta_i1 ON delta(srcid);
@
|