Fossil SCM
Give the JX column of USER and REPORTFMT a default value which is valid JSON.
Commit
2433964d8f4ac36300c9fc27abe3fe0b87f913c0d29e8a36dbdfec225444ae43
Parent
8f6d7dacbbfeb16…
3 files changed
+2
-1
+2
-2
+2
-1
+2
-1
| --- src/report.c | ||
| +++ src/report.c | ||
| @@ -263,11 +263,12 @@ | ||
| 263 | 263 | ** The "jx" column is intended to hold a JSON object containing optional |
| 264 | 264 | ** key-value pairs. |
| 265 | 265 | */ |
| 266 | 266 | void report_update_reportfmt_table(void){ |
| 267 | 267 | if( db_table_has_column("repository","reportfmt","jx")==0 ){ |
| 268 | - db_multi_exec("ALTER TABLE repository.reportfmt ADD COLUMN jx TEXT;"); | |
| 268 | + db_multi_exec("ALTER TABLE repository.reportfmt" | |
| 269 | + " ADD COLUMN jx TEXT DEFAULT '{}';"); | |
| 269 | 270 | } |
| 270 | 271 | } |
| 271 | 272 | |
| 272 | 273 | /* |
| 273 | 274 | ** Activate the ticket report query authorizer. Must be followed by an |
| 274 | 275 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -263,11 +263,12 @@ | |
| 263 | ** The "jx" column is intended to hold a JSON object containing optional |
| 264 | ** key-value pairs. |
| 265 | */ |
| 266 | void report_update_reportfmt_table(void){ |
| 267 | if( db_table_has_column("repository","reportfmt","jx")==0 ){ |
| 268 | db_multi_exec("ALTER TABLE repository.reportfmt ADD COLUMN jx TEXT;"); |
| 269 | } |
| 270 | } |
| 271 | |
| 272 | /* |
| 273 | ** Activate the ticket report query authorizer. Must be followed by an |
| 274 |
| --- src/report.c | |
| +++ src/report.c | |
| @@ -263,11 +263,12 @@ | |
| 263 | ** The "jx" column is intended to hold a JSON object containing optional |
| 264 | ** key-value pairs. |
| 265 | */ |
| 266 | void report_update_reportfmt_table(void){ |
| 267 | if( db_table_has_column("repository","reportfmt","jx")==0 ){ |
| 268 | db_multi_exec("ALTER TABLE repository.reportfmt" |
| 269 | " ADD COLUMN jx TEXT DEFAULT '{}';"); |
| 270 | } |
| 271 | } |
| 272 | |
| 273 | /* |
| 274 | ** Activate the ticket report query authorizer. Must be followed by an |
| 275 |
+2
-2
| --- src/schema.c | ||
| +++ src/schema.c | ||
| @@ -127,11 +127,11 @@ | ||
| 127 | 127 | @ ipaddr TEXT, -- IP address for which cookie is valid |
| 128 | 128 | @ cexpire DATETIME, -- Time when cookie expires |
| 129 | 129 | @ info TEXT, -- contact information |
| 130 | 130 | @ mtime DATE, -- last change. seconds since 1970 |
| 131 | 131 | @ photo BLOB, -- JPEG image of this user |
| 132 | -@ jx TEXT -- Extra fields in JSON | |
| 132 | +@ jx TEXT DEFAULT '{}' -- Extra fields in JSON | |
| 133 | 133 | @ ); |
| 134 | 134 | @ |
| 135 | 135 | @ -- The config table holds miscellanous information about the repository. |
| 136 | 136 | @ -- in the form of name-value pairs. |
| 137 | 137 | @ -- |
| @@ -178,11 +178,11 @@ | ||
| 178 | 178 | @ owner TEXT, -- Owner of this report format (not used) |
| 179 | 179 | @ title TEXT UNIQUE, -- Title of this report |
| 180 | 180 | @ mtime DATE, -- Last modified. seconds since 1970 |
| 181 | 181 | @ cols TEXT, -- A color-key specification |
| 182 | 182 | @ sqlcode TEXT, -- An SQL SELECT statement for this report |
| 183 | -@ jx TEXT -- Additional fields encoded as JSON | |
| 183 | +@ jx TEXT DEFAULT '{}' -- Additional fields encoded as JSON | |
| 184 | 184 | @ ); |
| 185 | 185 | @ |
| 186 | 186 | @ -- Some ticket content (such as the originators email address or contact |
| 187 | 187 | @ -- information) needs to be obscured to protect privacy. This is achieved |
| 188 | 188 | @ -- by storing an SHA1 hash of the content. For display, the hash is |
| 189 | 189 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -127,11 +127,11 @@ | |
| 127 | @ ipaddr TEXT, -- IP address for which cookie is valid |
| 128 | @ cexpire DATETIME, -- Time when cookie expires |
| 129 | @ info TEXT, -- contact information |
| 130 | @ mtime DATE, -- last change. seconds since 1970 |
| 131 | @ photo BLOB, -- JPEG image of this user |
| 132 | @ jx TEXT -- Extra fields in JSON |
| 133 | @ ); |
| 134 | @ |
| 135 | @ -- The config table holds miscellanous information about the repository. |
| 136 | @ -- in the form of name-value pairs. |
| 137 | @ -- |
| @@ -178,11 +178,11 @@ | |
| 178 | @ owner TEXT, -- Owner of this report format (not used) |
| 179 | @ title TEXT UNIQUE, -- Title of this report |
| 180 | @ mtime DATE, -- Last modified. seconds since 1970 |
| 181 | @ cols TEXT, -- A color-key specification |
| 182 | @ sqlcode TEXT, -- An SQL SELECT statement for this report |
| 183 | @ jx TEXT -- Additional fields encoded as JSON |
| 184 | @ ); |
| 185 | @ |
| 186 | @ -- Some ticket content (such as the originators email address or contact |
| 187 | @ -- information) needs to be obscured to protect privacy. This is achieved |
| 188 | @ -- by storing an SHA1 hash of the content. For display, the hash is |
| 189 |
| --- src/schema.c | |
| +++ src/schema.c | |
| @@ -127,11 +127,11 @@ | |
| 127 | @ ipaddr TEXT, -- IP address for which cookie is valid |
| 128 | @ cexpire DATETIME, -- Time when cookie expires |
| 129 | @ info TEXT, -- contact information |
| 130 | @ mtime DATE, -- last change. seconds since 1970 |
| 131 | @ photo BLOB, -- JPEG image of this user |
| 132 | @ jx TEXT DEFAULT '{}' -- Extra fields in JSON |
| 133 | @ ); |
| 134 | @ |
| 135 | @ -- The config table holds miscellanous information about the repository. |
| 136 | @ -- in the form of name-value pairs. |
| 137 | @ -- |
| @@ -178,11 +178,11 @@ | |
| 178 | @ owner TEXT, -- Owner of this report format (not used) |
| 179 | @ title TEXT UNIQUE, -- Title of this report |
| 180 | @ mtime DATE, -- Last modified. seconds since 1970 |
| 181 | @ cols TEXT, -- A color-key specification |
| 182 | @ sqlcode TEXT, -- An SQL SELECT statement for this report |
| 183 | @ jx TEXT DEFAULT '{}' -- Additional fields encoded as JSON |
| 184 | @ ); |
| 185 | @ |
| 186 | @ -- Some ticket content (such as the originators email address or contact |
| 187 | @ -- information) needs to be obscured to protect privacy. This is achieved |
| 188 | @ -- by storing an SHA1 hash of the content. For display, the hash is |
| 189 |
+2
-1
| --- src/user.c | ||
| +++ src/user.c | ||
| @@ -583,11 +583,12 @@ | ||
| 583 | 583 | ** The "JX" column is intended to hold a JSON object containing optional |
| 584 | 584 | ** key-value pairs. |
| 585 | 585 | */ |
| 586 | 586 | void user_update_user_table(void){ |
| 587 | 587 | if( db_table_has_column("repository","user","jx")==0 ){ |
| 588 | - db_multi_exec("ALTER TABLE repository.user ADD COLUMN jx TEXT;"); | |
| 588 | + db_multi_exec("ALTER TABLE repository.user" | |
| 589 | + " ADD COLUMN jx TEXT DEFAULT '{}';"); | |
| 589 | 590 | } |
| 590 | 591 | } |
| 591 | 592 | |
| 592 | 593 | /* |
| 593 | 594 | ** COMMAND: test-hash-passwords |
| 594 | 595 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -583,11 +583,12 @@ | |
| 583 | ** The "JX" column is intended to hold a JSON object containing optional |
| 584 | ** key-value pairs. |
| 585 | */ |
| 586 | void user_update_user_table(void){ |
| 587 | if( db_table_has_column("repository","user","jx")==0 ){ |
| 588 | db_multi_exec("ALTER TABLE repository.user ADD COLUMN jx TEXT;"); |
| 589 | } |
| 590 | } |
| 591 | |
| 592 | /* |
| 593 | ** COMMAND: test-hash-passwords |
| 594 |
| --- src/user.c | |
| +++ src/user.c | |
| @@ -583,11 +583,12 @@ | |
| 583 | ** The "JX" column is intended to hold a JSON object containing optional |
| 584 | ** key-value pairs. |
| 585 | */ |
| 586 | void user_update_user_table(void){ |
| 587 | if( db_table_has_column("repository","user","jx")==0 ){ |
| 588 | db_multi_exec("ALTER TABLE repository.user" |
| 589 | " ADD COLUMN jx TEXT DEFAULT '{}';"); |
| 590 | } |
| 591 | } |
| 592 | |
| 593 | /* |
| 594 | ** COMMAND: test-hash-passwords |
| 595 |