Fossil SCM

Changes to the design of the alias table.

drh 2017-02-27 23:17 fossil-2.0
Commit 0a8fad6a5d7bdeb97e75d8ca76690402a53ddba8
2 files changed +4 -4 +2 -2
+4 -4
--- src/rebuild.c
+++ src/rebuild.c
@@ -81,17 +81,17 @@
8181
@ );
8282
;
8383
static const char zSchemaUpdate3[] =
8484
@ -- Make sure the alias table exists.
8585
@ --
86
-@ CREATE TABLE alias(
86
+@ CREATE TABLE repository.alias(
8787
@ hval TEXT, -- Hex-encoded hash value
8888
@ htype ANY, -- Type of hash.
8989
@ rid INTEGER REFERENCES blob, -- Blob that this hash names
90
-@ PRIMARY KEY(hval,htype)
90
+@ PRIMARY KEY(hval,htype,rid)
9191
@ ) WITHOUT ROWID;
92
-@ CREATE INDEX alias_rid ON alias(rid,htype)
92
+@ CREATE INDEX alias_rid ON alias(rid);
9393
;
9494
9595
/*
9696
** Update the schema as necessary
9797
*/
@@ -366,11 +366,11 @@
366366
rebuild_update_schema();
367367
blob_init(&sql, 0, 0);
368368
db_prepare(&q,
369369
"SELECT name FROM sqlite_master /*scan*/"
370370
" 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',"
372372
"'config','shun','private','reportfmt',"
373373
"'concealed','accesslog','modreq',"
374374
"'purgeevent','purgeitem','unversioned')"
375375
" AND name NOT GLOB 'sqlite_*'"
376376
" AND name NOT GLOB 'fx_*'"
377377
--- 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 @@
119119
@ --
120120
@ CREATE TABLE alias(
121121
@ hval TEXT, -- Hex-encoded hash value
122122
@ htype ANY, -- Type of hash.
123123
@ rid INTEGER REFERENCES blob, -- Blob that this hash names
124
-@ PRIMARY KEY(hval,htype)
124
+@ PRIMARY KEY(hval,htype,id)
125125
@ ) WITHOUT ROWID;
126
-@ CREATE INDEX alias_rid ON alias(rid,htype)
126
+@ CREATE INDEX alias_rid ON alias(rid);
127127
@
128128
@ -- Information about users
129129
@ --
130130
@ -- The user.pw field can be either cleartext of the password, or
131131
@ -- a SHA1 hash of the password. If the user.pw field is exactly 40
132132
--- 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

Keyboard Shortcuts

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