| | @@ -35,14 +35,24 @@ |
| 35 | 35 | @ -- |
| 36 | 36 | @ CREATE INDEX IF NOT EXISTS delta_i1 ON delta(srcid); |
| 37 | 37 | @ |
| 38 | 38 | @ -- Artifacts that should not be processed are identified in the |
| 39 | 39 | @ -- "shun" table. Artifacts that are control-file forgeries or |
| 40 | | -@ -- spam can be shunned in order to prevent them from contaminating |
| 40 | +@ -- spam or artifacts whose contents violate administrative policy |
| 41 | +@ -- can be shunned in order to prevent them from contaminating |
| 41 | 42 | @ -- the repository. |
| 43 | +@ -- |
| 44 | +@ -- Shunned artifacts do not exist in the blob table. Hence they |
| 45 | +@ -- have not artifact ID (rid) and we thus must store their full |
| 46 | +@ -- UUID. |
| 42 | 47 | @ -- |
| 43 | 48 | @ CREATE TABLE IF NOT EXISTS shun(uuid UNIQUE); |
| 49 | +@ |
| 50 | +@ -- Artifacts that should not be pushed are stored in the "private" |
| 51 | +@ -- table. |
| 52 | +@ -- |
| 53 | +@ CREATE TABLE IF NOT EXISTS private(rid INTEGER PRIMARY KEY); |
| 44 | 54 | @ |
| 45 | 55 | @ -- An entry in this table describes a database query that generates a |
| 46 | 56 | @ -- table of tickets. |
| 47 | 57 | @ -- |
| 48 | 58 | @ CREATE TABLE IF NOT EXISTS reportfmt( |
| | @@ -50,20 +60,10 @@ |
| 50 | 60 | @ owner text, -- Owner of this report format (not used) |
| 51 | 61 | @ title text, -- Title of this report |
| 52 | 62 | @ cols text, -- A color-key specification |
| 53 | 63 | @ sqlcode text -- An SQL SELECT statement for this report |
| 54 | 64 | @ ); |
| 55 | | -@ |
| 56 | | -@ -- A cache for mapping baseline artifact ID + filename into file |
| 57 | | -@ -- artifact ID. Used by the /doc method. |
| 58 | | -@ -- |
| 59 | | -@ CREATE TABLE IF NOT EXISTS vcache( |
| 60 | | -@ vid integer, -- Baseline artifact ID |
| 61 | | -@ fname text, -- Filename |
| 62 | | -@ rid integer, -- File artifact ID |
| 63 | | -@ UNIQUE(vid,fname,rid) |
| 64 | | -@ ); |
| 65 | 65 | ; |
| 66 | 66 | |
| 67 | 67 | /* |
| 68 | 68 | ** Variables used for progress information |
| 69 | 69 | */ |
| | @@ -170,19 +170,24 @@ |
| 170 | 170 | db_multi_exec(zSchemaUpdates); |
| 171 | 171 | for(;;){ |
| 172 | 172 | zTable = db_text(0, |
| 173 | 173 | "SELECT name FROM sqlite_master" |
| 174 | 174 | " WHERE type='table'" |
| 175 | | - " AND name NOT IN ('blob','delta','rcvfrom','user','config','shun')"); |
| 175 | + " AND name NOT IN ('blob','delta','rcvfrom','user'," |
| 176 | + "'config','shun','private')" |
| 177 | + ); |
| 176 | 178 | if( zTable==0 ) break; |
| 177 | 179 | db_multi_exec("DROP TABLE %Q", zTable); |
| 178 | 180 | free(zTable); |
| 179 | 181 | } |
| 180 | 182 | db_multi_exec(zRepositorySchema2); |
| 181 | 183 | ticket_create_table(0); |
| 182 | 184 | |
| 183 | | - db_multi_exec("INSERT INTO unclustered SELECT rid FROM blob"); |
| 185 | + db_multi_exec( |
| 186 | + "INSERT INTO unclustered" |
| 187 | + " SELECT rid FROM blob EXCEPT SELECT rid FROM private" |
| 188 | + ); |
| 184 | 189 | db_multi_exec( |
| 185 | 190 | "DELETE FROM unclustered" |
| 186 | 191 | " WHERE rid IN (SELECT rid FROM shun JOIN blob USING(uuid))" |
| 187 | 192 | ); |
| 188 | 193 | db_multi_exec( |
| 189 | 194 | |