Fossil SCM
The UNIQUE constraint on the default TICKET table was wrong. The tkt_uuid column should be unique unto itself, not in combination with tkt_time. Existing servers will need to fix their TICKET implementations using the setup menu. This check-in changes the default.
Commit
fb8dc7d07f8e9ac0dda84ee16a1d7b0a5b973f1a
Parent
9236f0c086010e7…
2 files changed
+17
-3
+2
-4
+17
-3
| --- src/schema.c | ||
| +++ src/schema.c | ||
| @@ -278,15 +278,29 @@ | ||
| 278 | 278 | @ ); |
| 279 | 279 | @ CREATE INDEX tagxref_i1 ON tagxref(tagid, mtime); |
| 280 | 280 | @ |
| 281 | 281 | @ -- Template for the TICKET table |
| 282 | 282 | @ -- |
| 283 | +@ -- NB: when changing the schema of the TICKET table here, also make the | |
| 284 | +@ -- same change in tktsetup.c. | |
| 285 | +@ -- | |
| 283 | 286 | @ CREATE TABLE ticket( |
| 287 | +@ -- Do not change any column that begins with tkt_ | |
| 284 | 288 | @ tkt_id INTEGER PRIMARY KEY, |
| 285 | -@ tkt_uuid TEXT, | |
| 286 | -@ tkt_mtime REAL, | |
| 287 | -@ UNIQUE(tkt_uuid, tkt_mtime) | |
| 289 | +@ tkt_uuid TEXT UNIQUE, | |
| 290 | +@ tkt_mtime DATE, | |
| 291 | +@ -- Add as many field as required below this line | |
| 292 | +@ type TEXT, | |
| 293 | +@ status TEXT, | |
| 294 | +@ subsystem TEXT, | |
| 295 | +@ priority TEXT, | |
| 296 | +@ severity TEXT, | |
| 297 | +@ foundin TEXT, | |
| 298 | +@ private_contact TEXT, | |
| 299 | +@ resolution TEXT, | |
| 300 | +@ title TEXT, | |
| 301 | +@ comment TEXT | |
| 288 | 302 | @ ); |
| 289 | 303 | ; |
| 290 | 304 | |
| 291 | 305 | /* |
| 292 | 306 | ** Predefined tagid values |
| 293 | 307 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -278,15 +278,29 @@ | |
| 278 | @ ); |
| 279 | @ CREATE INDEX tagxref_i1 ON tagxref(tagid, mtime); |
| 280 | @ |
| 281 | @ -- Template for the TICKET table |
| 282 | @ -- |
| 283 | @ CREATE TABLE ticket( |
| 284 | @ tkt_id INTEGER PRIMARY KEY, |
| 285 | @ tkt_uuid TEXT, |
| 286 | @ tkt_mtime REAL, |
| 287 | @ UNIQUE(tkt_uuid, tkt_mtime) |
| 288 | @ ); |
| 289 | ; |
| 290 | |
| 291 | /* |
| 292 | ** Predefined tagid values |
| 293 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -278,15 +278,29 @@ | |
| 278 | @ ); |
| 279 | @ CREATE INDEX tagxref_i1 ON tagxref(tagid, mtime); |
| 280 | @ |
| 281 | @ -- Template for the TICKET table |
| 282 | @ -- |
| 283 | @ -- NB: when changing the schema of the TICKET table here, also make the |
| 284 | @ -- same change in tktsetup.c. |
| 285 | @ -- |
| 286 | @ CREATE TABLE ticket( |
| 287 | @ -- Do not change any column that begins with tkt_ |
| 288 | @ tkt_id INTEGER PRIMARY KEY, |
| 289 | @ tkt_uuid TEXT UNIQUE, |
| 290 | @ tkt_mtime DATE, |
| 291 | @ -- Add as many field as required below this line |
| 292 | @ type TEXT, |
| 293 | @ status TEXT, |
| 294 | @ subsystem TEXT, |
| 295 | @ priority TEXT, |
| 296 | @ severity TEXT, |
| 297 | @ foundin TEXT, |
| 298 | @ private_contact TEXT, |
| 299 | @ resolution TEXT, |
| 300 | @ title TEXT, |
| 301 | @ comment TEXT |
| 302 | @ ); |
| 303 | ; |
| 304 | |
| 305 | /* |
| 306 | ** Predefined tagid values |
| 307 |
+2
-4
| --- src/tktsetup.c | ||
| +++ src/tktsetup.c | ||
| @@ -65,11 +65,11 @@ | ||
| 65 | 65 | /* @-comment: ** */ |
| 66 | 66 | static const char zDefaultTicketTable[] = |
| 67 | 67 | @ CREATE TABLE ticket( |
| 68 | 68 | @ -- Do not change any column that begins with tkt_ |
| 69 | 69 | @ tkt_id INTEGER PRIMARY KEY, |
| 70 | -@ tkt_uuid TEXT, | |
| 70 | +@ tkt_uuid TEXT UNIQUE, | |
| 71 | 71 | @ tkt_mtime DATE, |
| 72 | 72 | @ -- Add as many field as required below this line |
| 73 | 73 | @ type TEXT, |
| 74 | 74 | @ status TEXT, |
| 75 | 75 | @ subsystem TEXT, |
| @@ -77,13 +77,11 @@ | ||
| 77 | 77 | @ severity TEXT, |
| 78 | 78 | @ foundin TEXT, |
| 79 | 79 | @ private_contact TEXT, |
| 80 | 80 | @ resolution TEXT, |
| 81 | 81 | @ title TEXT, |
| 82 | -@ comment TEXT, | |
| 83 | -@ -- Do not alter this UNIQUE clause: | |
| 84 | -@ UNIQUE(tkt_uuid, tkt_mtime) | |
| 82 | +@ comment TEXT | |
| 85 | 83 | @ ); |
| 86 | 84 | ; |
| 87 | 85 | |
| 88 | 86 | /* |
| 89 | 87 | ** Return the ticket table definition |
| 90 | 88 |
| --- src/tktsetup.c | |
| +++ src/tktsetup.c | |
| @@ -65,11 +65,11 @@ | |
| 65 | /* @-comment: ** */ |
| 66 | static const char zDefaultTicketTable[] = |
| 67 | @ CREATE TABLE ticket( |
| 68 | @ -- Do not change any column that begins with tkt_ |
| 69 | @ tkt_id INTEGER PRIMARY KEY, |
| 70 | @ tkt_uuid TEXT, |
| 71 | @ tkt_mtime DATE, |
| 72 | @ -- Add as many field as required below this line |
| 73 | @ type TEXT, |
| 74 | @ status TEXT, |
| 75 | @ subsystem TEXT, |
| @@ -77,13 +77,11 @@ | |
| 77 | @ severity TEXT, |
| 78 | @ foundin TEXT, |
| 79 | @ private_contact TEXT, |
| 80 | @ resolution TEXT, |
| 81 | @ title TEXT, |
| 82 | @ comment TEXT, |
| 83 | @ -- Do not alter this UNIQUE clause: |
| 84 | @ UNIQUE(tkt_uuid, tkt_mtime) |
| 85 | @ ); |
| 86 | ; |
| 87 | |
| 88 | /* |
| 89 | ** Return the ticket table definition |
| 90 |
| --- src/tktsetup.c | |
| +++ src/tktsetup.c | |
| @@ -65,11 +65,11 @@ | |
| 65 | /* @-comment: ** */ |
| 66 | static const char zDefaultTicketTable[] = |
| 67 | @ CREATE TABLE ticket( |
| 68 | @ -- Do not change any column that begins with tkt_ |
| 69 | @ tkt_id INTEGER PRIMARY KEY, |
| 70 | @ tkt_uuid TEXT UNIQUE, |
| 71 | @ tkt_mtime DATE, |
| 72 | @ -- Add as many field as required below this line |
| 73 | @ type TEXT, |
| 74 | @ status TEXT, |
| 75 | @ subsystem TEXT, |
| @@ -77,13 +77,11 @@ | |
| 77 | @ severity TEXT, |
| 78 | @ foundin TEXT, |
| 79 | @ private_contact TEXT, |
| 80 | @ resolution TEXT, |
| 81 | @ title TEXT, |
| 82 | @ comment TEXT |
| 83 | @ ); |
| 84 | ; |
| 85 | |
| 86 | /* |
| 87 | ** Return the ticket table definition |
| 88 |