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.

george 2021-04-04 15:42 trunk
Commit ca175c615109b48f3035263c47b4eea06f98ffe243831719566a00adb3a36791
1 file changed +6
+6
--- src/tkt.c
+++ src/tkt.c
@@ -378,10 +378,13 @@
378378
** schema for the ticketing system. Only allow
379379
**
380380
** CREATE TABLE
381381
** CREATE INDEX
382382
** CREATE VIEW
383
+** DROP TABLE
384
+** DROP INDEX
385
+** DROP VIEW
383386
**
384387
** And for objects in "main" or "repository" whose names
385388
** begin with "ticket" or "fx_". Also allow
386389
**
387390
** INSERT
@@ -403,10 +406,12 @@
403406
const char *z1,
404407
const char *z2,
405408
const char *z3
406409
){
407410
switch( eCode ){
411
+ case SQLITE_DROP_VIEW:
412
+ case SQLITE_DROP_TABLE:
408413
case SQLITE_CREATE_VIEW:
409414
case SQLITE_CREATE_TABLE: {
410415
if( sqlite3_stricmp(z2,"main")!=0
411416
&& sqlite3_stricmp(z2,"repository")!=0
412417
){
@@ -417,10 +422,11 @@
417422
){
418423
goto ticket_schema_error;
419424
}
420425
break;
421426
}
427
+ case SQLITE_DROP_INDEX:
422428
case SQLITE_CREATE_INDEX: {
423429
if( sqlite3_stricmp(z2,"main")!=0
424430
&& sqlite3_stricmp(z2,"repository")!=0
425431
){
426432
goto ticket_schema_error;
427433
--- 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

Keyboard Shortcuts

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