Fossil SCM

Change the UNVERSIONED table to use an INTEGER PRIMARY KEY with AUTOINCREMENT. This is a precondition to adding search to unversioned files. To rebuild legacy repos, first DROP the old unversioned table, then run "fossil sync -u".

drh 2016-08-30 16:34 trunk
Commit 08cbc7b2e4fc2f618826583198a25190fde330d4
1 file changed +3 -2
--- src/unversioned.c
+++ src/unversioned.c
@@ -31,18 +31,19 @@
3131
/*
3232
** SQL code to implement the tables needed by the unversioned.
3333
*/
3434
static const char zUnversionedInit[] =
3535
@ CREATE TABLE IF NOT EXISTS repository.unversioned(
36
-@ name TEXT PRIMARY KEY, -- Name of the uv file
36
+@ uvid INTEGER PRIMARY KEY AUTOINCREMENT, -- unique ID for this file
37
+@ name TEXT UNIQUE, -- Name of the uv file
3738
@ rcvid INTEGER, -- Where received from
3839
@ mtime DATETIME, -- timestamp. Seconds since 1970.
3940
@ hash TEXT, -- Content hash. NULL if a delete marker
4041
@ sz INTEGER, -- size of content after decompression
4142
@ encoding INT, -- 0: plaintext. 1: zlib compressed
4243
@ content BLOB -- content of the file. NULL if oversized
43
-@ ) WITHOUT ROWID;
44
+@ );
4445
;
4546
4647
/*
4748
** Make sure the unversioned table exists in the repository.
4849
*/
4950
--- src/unversioned.c
+++ src/unversioned.c
@@ -31,18 +31,19 @@
31 /*
32 ** SQL code to implement the tables needed by the unversioned.
33 */
34 static const char zUnversionedInit[] =
35 @ CREATE TABLE IF NOT EXISTS repository.unversioned(
36 @ name TEXT PRIMARY KEY, -- Name of the uv file
 
37 @ rcvid INTEGER, -- Where received from
38 @ mtime DATETIME, -- timestamp. Seconds since 1970.
39 @ hash TEXT, -- Content hash. NULL if a delete marker
40 @ sz INTEGER, -- size of content after decompression
41 @ encoding INT, -- 0: plaintext. 1: zlib compressed
42 @ content BLOB -- content of the file. NULL if oversized
43 @ ) WITHOUT ROWID;
44 ;
45
46 /*
47 ** Make sure the unversioned table exists in the repository.
48 */
49
--- src/unversioned.c
+++ src/unversioned.c
@@ -31,18 +31,19 @@
31 /*
32 ** SQL code to implement the tables needed by the unversioned.
33 */
34 static const char zUnversionedInit[] =
35 @ CREATE TABLE IF NOT EXISTS repository.unversioned(
36 @ uvid INTEGER PRIMARY KEY AUTOINCREMENT, -- unique ID for this file
37 @ name TEXT UNIQUE, -- Name of the uv file
38 @ rcvid INTEGER, -- Where received from
39 @ mtime DATETIME, -- timestamp. Seconds since 1970.
40 @ hash TEXT, -- Content hash. NULL if a delete marker
41 @ sz INTEGER, -- size of content after decompression
42 @ encoding INT, -- 0: plaintext. 1: zlib compressed
43 @ content BLOB -- content of the file. NULL if oversized
44 @ );
45 ;
46
47 /*
48 ** Make sure the unversioned table exists in the repository.
49 */
50

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button