Fossil SCM
Changes to the design of the alias table.
Commit
0a8fad6a5d7bdeb97e75d8ca76690402a53ddba8
Parent
a6ee563c7065524…
2 files changed
+4
-4
+2
-2
+4
-4
| --- src/rebuild.c | ||
| +++ src/rebuild.c | ||
| @@ -81,17 +81,17 @@ | ||
| 81 | 81 | @ ); |
| 82 | 82 | ; |
| 83 | 83 | static const char zSchemaUpdate3[] = |
| 84 | 84 | @ -- Make sure the alias table exists. |
| 85 | 85 | @ -- |
| 86 | -@ CREATE TABLE alias( | |
| 86 | +@ CREATE TABLE repository.alias( | |
| 87 | 87 | @ hval TEXT, -- Hex-encoded hash value |
| 88 | 88 | @ htype ANY, -- Type of hash. |
| 89 | 89 | @ rid INTEGER REFERENCES blob, -- Blob that this hash names |
| 90 | -@ PRIMARY KEY(hval,htype) | |
| 90 | +@ PRIMARY KEY(hval,htype,rid) | |
| 91 | 91 | @ ) WITHOUT ROWID; |
| 92 | -@ CREATE INDEX alias_rid ON alias(rid,htype) | |
| 92 | +@ CREATE INDEX alias_rid ON alias(rid); | |
| 93 | 93 | ; |
| 94 | 94 | |
| 95 | 95 | /* |
| 96 | 96 | ** Update the schema as necessary |
| 97 | 97 | */ |
| @@ -366,11 +366,11 @@ | ||
| 366 | 366 | rebuild_update_schema(); |
| 367 | 367 | blob_init(&sql, 0, 0); |
| 368 | 368 | db_prepare(&q, |
| 369 | 369 | "SELECT name FROM sqlite_master /*scan*/" |
| 370 | 370 | " WHERE type='table'" |
| 371 | - " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','hname'," | |
| 371 | + " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','alias'," | |
| 372 | 372 | "'config','shun','private','reportfmt'," |
| 373 | 373 | "'concealed','accesslog','modreq'," |
| 374 | 374 | "'purgeevent','purgeitem','unversioned')" |
| 375 | 375 | " AND name NOT GLOB 'sqlite_*'" |
| 376 | 376 | " AND name NOT GLOB 'fx_*'" |
| 377 | 377 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -81,17 +81,17 @@ | |
| 81 | @ ); |
| 82 | ; |
| 83 | static const char zSchemaUpdate3[] = |
| 84 | @ -- Make sure the alias table exists. |
| 85 | @ -- |
| 86 | @ CREATE TABLE alias( |
| 87 | @ hval TEXT, -- Hex-encoded hash value |
| 88 | @ htype ANY, -- Type of hash. |
| 89 | @ rid INTEGER REFERENCES blob, -- Blob that this hash names |
| 90 | @ PRIMARY KEY(hval,htype) |
| 91 | @ ) WITHOUT ROWID; |
| 92 | @ CREATE INDEX alias_rid ON alias(rid,htype) |
| 93 | ; |
| 94 | |
| 95 | /* |
| 96 | ** Update the schema as necessary |
| 97 | */ |
| @@ -366,11 +366,11 @@ | |
| 366 | rebuild_update_schema(); |
| 367 | blob_init(&sql, 0, 0); |
| 368 | db_prepare(&q, |
| 369 | "SELECT name FROM sqlite_master /*scan*/" |
| 370 | " WHERE type='table'" |
| 371 | " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','hname'," |
| 372 | "'config','shun','private','reportfmt'," |
| 373 | "'concealed','accesslog','modreq'," |
| 374 | "'purgeevent','purgeitem','unversioned')" |
| 375 | " AND name NOT GLOB 'sqlite_*'" |
| 376 | " AND name NOT GLOB 'fx_*'" |
| 377 |
| --- src/rebuild.c | |
| +++ src/rebuild.c | |
| @@ -81,17 +81,17 @@ | |
| 81 | @ ); |
| 82 | ; |
| 83 | static const char zSchemaUpdate3[] = |
| 84 | @ -- Make sure the alias table exists. |
| 85 | @ -- |
| 86 | @ CREATE TABLE repository.alias( |
| 87 | @ hval TEXT, -- Hex-encoded hash value |
| 88 | @ htype ANY, -- Type of hash. |
| 89 | @ rid INTEGER REFERENCES blob, -- Blob that this hash names |
| 90 | @ PRIMARY KEY(hval,htype,rid) |
| 91 | @ ) WITHOUT ROWID; |
| 92 | @ CREATE INDEX alias_rid ON alias(rid); |
| 93 | ; |
| 94 | |
| 95 | /* |
| 96 | ** Update the schema as necessary |
| 97 | */ |
| @@ -366,11 +366,11 @@ | |
| 366 | rebuild_update_schema(); |
| 367 | blob_init(&sql, 0, 0); |
| 368 | db_prepare(&q, |
| 369 | "SELECT name FROM sqlite_master /*scan*/" |
| 370 | " WHERE type='table'" |
| 371 | " AND name NOT IN ('admin_log', 'blob','delta','rcvfrom','user','alias'," |
| 372 | "'config','shun','private','reportfmt'," |
| 373 | "'concealed','accesslog','modreq'," |
| 374 | "'purgeevent','purgeitem','unversioned')" |
| 375 | " AND name NOT GLOB 'sqlite_*'" |
| 376 | " AND name NOT GLOB 'fx_*'" |
| 377 |
+2
-2
| --- src/schema.c | ||
| +++ src/schema.c | ||
| @@ -119,13 +119,13 @@ | ||
| 119 | 119 | @ -- |
| 120 | 120 | @ CREATE TABLE alias( |
| 121 | 121 | @ hval TEXT, -- Hex-encoded hash value |
| 122 | 122 | @ htype ANY, -- Type of hash. |
| 123 | 123 | @ rid INTEGER REFERENCES blob, -- Blob that this hash names |
| 124 | -@ PRIMARY KEY(hval,htype) | |
| 124 | +@ PRIMARY KEY(hval,htype,id) | |
| 125 | 125 | @ ) WITHOUT ROWID; |
| 126 | -@ CREATE INDEX alias_rid ON alias(rid,htype) | |
| 126 | +@ CREATE INDEX alias_rid ON alias(rid); | |
| 127 | 127 | @ |
| 128 | 128 | @ -- Information about users |
| 129 | 129 | @ -- |
| 130 | 130 | @ -- The user.pw field can be either cleartext of the password, or |
| 131 | 131 | @ -- a SHA1 hash of the password. If the user.pw field is exactly 40 |
| 132 | 132 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -119,13 +119,13 @@ | |
| 119 | @ -- |
| 120 | @ CREATE TABLE alias( |
| 121 | @ hval TEXT, -- Hex-encoded hash value |
| 122 | @ htype ANY, -- Type of hash. |
| 123 | @ rid INTEGER REFERENCES blob, -- Blob that this hash names |
| 124 | @ PRIMARY KEY(hval,htype) |
| 125 | @ ) WITHOUT ROWID; |
| 126 | @ CREATE INDEX alias_rid ON alias(rid,htype) |
| 127 | @ |
| 128 | @ -- Information about users |
| 129 | @ -- |
| 130 | @ -- The user.pw field can be either cleartext of the password, or |
| 131 | @ -- a SHA1 hash of the password. If the user.pw field is exactly 40 |
| 132 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -119,13 +119,13 @@ | |
| 119 | @ -- |
| 120 | @ CREATE TABLE alias( |
| 121 | @ hval TEXT, -- Hex-encoded hash value |
| 122 | @ htype ANY, -- Type of hash. |
| 123 | @ rid INTEGER REFERENCES blob, -- Blob that this hash names |
| 124 | @ PRIMARY KEY(hval,htype,id) |
| 125 | @ ) WITHOUT ROWID; |
| 126 | @ CREATE INDEX alias_rid ON alias(rid); |
| 127 | @ |
| 128 | @ -- Information about users |
| 129 | @ -- |
| 130 | @ -- The user.pw field can be either cleartext of the password, or |
| 131 | @ -- a SHA1 hash of the password. If the user.pw field is exactly 40 |
| 132 |