| | @@ -140,37 +140,15 @@ |
| 140 | 140 | rebuild_schema_update_2_0(); |
| 141 | 141 | } |
| 142 | 142 | |
| 143 | 143 | /* |
| 144 | 144 | ** Update the repository schema for Fossil version 2.0. (2017-02-28) |
| 145 | | -** (1) Create the ALIAS table |
| 146 | | -** (2) Change the CHECK constraint on BLOB.UUID so that the length |
| 145 | +** (1) Change the CHECK constraint on BLOB.UUID so that the length |
| 147 | 146 | ** is greater than or equal to 40, not exactly equal to 40. |
| 148 | 147 | */ |
| 149 | 148 | void rebuild_schema_update_2_0(void){ |
| 150 | | - static const char zCreateAliasTable[] = |
| 151 | | - @ -- Make sure the alias table exists. |
| 152 | | - @ -- |
| 153 | | - @ CREATE TABLE repository.alias( |
| 154 | | - @ hval TEXT, -- Hex-encoded hash value |
| 155 | | - @ htype ANY, -- Type of hash. |
| 156 | | - @ rid INTEGER REFERENCES blob, -- Blob that this hash names |
| 157 | | - @ PRIMARY KEY(hval,htype,rid) |
| 158 | | - @ ) WITHOUT ROWID; |
| 159 | | - @ CREATE INDEX repository.alias_rid ON alias(rid); |
| 160 | | - ; |
| 161 | | - char *z; |
| 162 | | - |
| 163 | | - /* If the alias table is missing, create it. */ |
| 164 | | - if( !db_table_exists("repository", "alias") ){ |
| 165 | | - db_multi_exec("%s", zCreateAliasTable/*safe-for-%s*/); |
| 166 | | - } |
| 167 | | - |
| 168 | | - /* Make sure the CHECK constraint on the BLOB table says "length(uuid)>=40" |
| 169 | | - ** instead of "length(uuid)==40". */ |
| 170 | | - z = db_text(0, "SELECT sql FROM repository.sqlite_master WHERE" |
| 171 | | - " name LIKE 'blob' AND sql LIKE '%%length(uuid)==40%%'"); |
| 149 | + char *z = db_text(0, "SELECT sql FROM repository.sqlite_master WHERE name='blob'"); |
| 172 | 150 | if( z ){ |
| 173 | 151 | /* Search for: length(uuid)==40 |
| 174 | 152 | ** 0123456789 12345 */ |
| 175 | 153 | int i; |
| 176 | 154 | for(i=10; z[i]; i++){ |
| 177 | 155 | |