Diff
Not logged in

Differences From:

File src/rebuild.c part of check-in [fb358ca492] - Progress toward getting ticketing working. We can enter a new ticket and display it. Cannot yet edit a ticket. by drh on 2007-11-24 19:33:46. [view]

To:

File src/rebuild.c part of check-in [62f37c9722] - Begin porting the CVSTrac ticket reporting code over to fossil. The new code is not yet connected into the system. The port is incomplete. by drh on 2007-11-26 01:33:50. [view]

@@ -27,8 +27,35 @@
 #include "rebuild.h"
 #include <assert.h>
 
 /*
+** Schema changes
+*/
+static const char zSchemaUpdates[] =
+@ -- Index on the delta table
+@ --
+@ CREATE INDEX IF NOT EXISTS delta_i1 ON delta(srcid);"
+@
+@ -- Artifacts that should not be processed are identified in the
+@ -- "shun" table.  Artifacts that are control-file forgeries or
+@ -- spam can be shunned in order to prevent them from contaminating
+@ -- the repository.
+@ --
+@ CREATE TABLE IF NOT EXISTS shun(uuid UNIQUE);
+@
+@ -- An entry in this table describes a database query that generates a
+@ -- table of tickets.
+@ --
+@ CREATE TABLE IF NOT EXISTS reportfmt(
+@    rn integer primary key,  -- Report number
+@    owner text,              -- Owner of this report format (not used)
+@    title text,              -- Title of this report
+@    cols text,               -- A color-key specification
+@    sqlcode text             -- An SQL SELECT statement for this report
+@ );
+;
+
+/*
 ** Core function to rebuild the infomration in the derived tables of a
 ** fossil repository from the blobs. This function is shared between
 ** 'rebuild_database' ('rebuild') and 'reconstruct_cmd'
 ** ('reconstruct'), both of which have to regenerate this information
@@ -44,12 +71,9 @@
   int errCnt = 0;
   char *zTable;
   int cnt = 0;
 
-  db_multi_exec(
-    "CREATE INDEX IF NOT EXISTS delta_i1 ON delta(srcid);"
-    "CREATE TABLE IF NOT EXISTS shun(uuid UNIQUE);"
-  );
+  db_multi_exec(zSchemaUpdates);
   for(;;){
     zTable = db_text(0,
        "SELECT name FROM sqlite_master"
        " WHERE type='table'"