Fossil SCM
Allow to DROP some specific tables, views and indices that could be introduced into the database schema of a repository through customization of ticketing subsystem. For example, DROP may be required due to the need to update tickets configuration of the already deployed repository. See the forum thread [forum:/forumthread/c9b8322fdedc8fa9|c9b8322fde] for discussion.
Commit
ca175c615109b48f3035263c47b4eea06f98ffe243831719566a00adb3a36791
Parent
63ed857ad86ad0f…
1 file changed
+6
+6
| --- src/tkt.c | ||
| +++ src/tkt.c | ||
| @@ -378,10 +378,13 @@ | ||
| 378 | 378 | ** schema for the ticketing system. Only allow |
| 379 | 379 | ** |
| 380 | 380 | ** CREATE TABLE |
| 381 | 381 | ** CREATE INDEX |
| 382 | 382 | ** CREATE VIEW |
| 383 | +** DROP TABLE | |
| 384 | +** DROP INDEX | |
| 385 | +** DROP VIEW | |
| 383 | 386 | ** |
| 384 | 387 | ** And for objects in "main" or "repository" whose names |
| 385 | 388 | ** begin with "ticket" or "fx_". Also allow |
| 386 | 389 | ** |
| 387 | 390 | ** INSERT |
| @@ -403,10 +406,12 @@ | ||
| 403 | 406 | const char *z1, |
| 404 | 407 | const char *z2, |
| 405 | 408 | const char *z3 |
| 406 | 409 | ){ |
| 407 | 410 | switch( eCode ){ |
| 411 | + case SQLITE_DROP_VIEW: | |
| 412 | + case SQLITE_DROP_TABLE: | |
| 408 | 413 | case SQLITE_CREATE_VIEW: |
| 409 | 414 | case SQLITE_CREATE_TABLE: { |
| 410 | 415 | if( sqlite3_stricmp(z2,"main")!=0 |
| 411 | 416 | && sqlite3_stricmp(z2,"repository")!=0 |
| 412 | 417 | ){ |
| @@ -417,10 +422,11 @@ | ||
| 417 | 422 | ){ |
| 418 | 423 | goto ticket_schema_error; |
| 419 | 424 | } |
| 420 | 425 | break; |
| 421 | 426 | } |
| 427 | + case SQLITE_DROP_INDEX: | |
| 422 | 428 | case SQLITE_CREATE_INDEX: { |
| 423 | 429 | if( sqlite3_stricmp(z2,"main")!=0 |
| 424 | 430 | && sqlite3_stricmp(z2,"repository")!=0 |
| 425 | 431 | ){ |
| 426 | 432 | goto ticket_schema_error; |
| 427 | 433 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -378,10 +378,13 @@ | |
| 378 | ** schema for the ticketing system. Only allow |
| 379 | ** |
| 380 | ** CREATE TABLE |
| 381 | ** CREATE INDEX |
| 382 | ** CREATE VIEW |
| 383 | ** |
| 384 | ** And for objects in "main" or "repository" whose names |
| 385 | ** begin with "ticket" or "fx_". Also allow |
| 386 | ** |
| 387 | ** INSERT |
| @@ -403,10 +406,12 @@ | |
| 403 | const char *z1, |
| 404 | const char *z2, |
| 405 | const char *z3 |
| 406 | ){ |
| 407 | switch( eCode ){ |
| 408 | case SQLITE_CREATE_VIEW: |
| 409 | case SQLITE_CREATE_TABLE: { |
| 410 | if( sqlite3_stricmp(z2,"main")!=0 |
| 411 | && sqlite3_stricmp(z2,"repository")!=0 |
| 412 | ){ |
| @@ -417,10 +422,11 @@ | |
| 417 | ){ |
| 418 | goto ticket_schema_error; |
| 419 | } |
| 420 | break; |
| 421 | } |
| 422 | case SQLITE_CREATE_INDEX: { |
| 423 | if( sqlite3_stricmp(z2,"main")!=0 |
| 424 | && sqlite3_stricmp(z2,"repository")!=0 |
| 425 | ){ |
| 426 | goto ticket_schema_error; |
| 427 |
| --- src/tkt.c | |
| +++ src/tkt.c | |
| @@ -378,10 +378,13 @@ | |
| 378 | ** schema for the ticketing system. Only allow |
| 379 | ** |
| 380 | ** CREATE TABLE |
| 381 | ** CREATE INDEX |
| 382 | ** CREATE VIEW |
| 383 | ** DROP TABLE |
| 384 | ** DROP INDEX |
| 385 | ** DROP VIEW |
| 386 | ** |
| 387 | ** And for objects in "main" or "repository" whose names |
| 388 | ** begin with "ticket" or "fx_". Also allow |
| 389 | ** |
| 390 | ** INSERT |
| @@ -403,10 +406,12 @@ | |
| 406 | const char *z1, |
| 407 | const char *z2, |
| 408 | const char *z3 |
| 409 | ){ |
| 410 | switch( eCode ){ |
| 411 | case SQLITE_DROP_VIEW: |
| 412 | case SQLITE_DROP_TABLE: |
| 413 | case SQLITE_CREATE_VIEW: |
| 414 | case SQLITE_CREATE_TABLE: { |
| 415 | if( sqlite3_stricmp(z2,"main")!=0 |
| 416 | && sqlite3_stricmp(z2,"repository")!=0 |
| 417 | ){ |
| @@ -417,10 +422,11 @@ | |
| 422 | ){ |
| 423 | goto ticket_schema_error; |
| 424 | } |
| 425 | break; |
| 426 | } |
| 427 | case SQLITE_DROP_INDEX: |
| 428 | case SQLITE_CREATE_INDEX: { |
| 429 | if( sqlite3_stricmp(z2,"main")!=0 |
| 430 | && sqlite3_stricmp(z2,"repository")!=0 |
| 431 | ){ |
| 432 | goto ticket_schema_error; |
| 433 |