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".
Commit
08cbc7b2e4fc2f618826583198a25190fde330d4
Parent
df80ab0ce93c9ca…
1 file changed
+3
-2
+3
-2
| --- src/unversioned.c | ||
| +++ src/unversioned.c | ||
| @@ -31,18 +31,19 @@ | ||
| 31 | 31 | /* |
| 32 | 32 | ** SQL code to implement the tables needed by the unversioned. |
| 33 | 33 | */ |
| 34 | 34 | static const char zUnversionedInit[] = |
| 35 | 35 | @ 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 | |
| 37 | 38 | @ rcvid INTEGER, -- Where received from |
| 38 | 39 | @ mtime DATETIME, -- timestamp. Seconds since 1970. |
| 39 | 40 | @ hash TEXT, -- Content hash. NULL if a delete marker |
| 40 | 41 | @ sz INTEGER, -- size of content after decompression |
| 41 | 42 | @ encoding INT, -- 0: plaintext. 1: zlib compressed |
| 42 | 43 | @ content BLOB -- content of the file. NULL if oversized |
| 43 | -@ ) WITHOUT ROWID; | |
| 44 | +@ ); | |
| 44 | 45 | ; |
| 45 | 46 | |
| 46 | 47 | /* |
| 47 | 48 | ** Make sure the unversioned table exists in the repository. |
| 48 | 49 | */ |
| 49 | 50 |
| --- 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 |