Changes between Version 15 and Version 16 of GenericTrac
- Timestamp:
- Apr 13, 2010, 2:40:41 PM (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
GenericTrac
v15 v16 53 53 - (-) only flexibility is to not use some fields (e.g. severity) 54 54 - (-) no multiple values per field possible 55 - (+) faster 56 - (+) straightforward code (`for field1,field2, ... in cursor: ...`) 55 - (+) faster (?) 56 - (+) straightforward code (`for field1,field2, ... in cursor: ...`) (?) 57 57 2. properties in name/value columns 58 58 - (+) highest flexibility, add or remove fields at will 59 59 - (+) allow for multiple values per name, provided we don't use a primary key 60 60 as we currently do for the `ticket_custom` table (#918) 61 - (+) a slight extension would allow ordered multiple values (sequences), otherwise we have no control over the order in which those multiple values are retrieved, which might introduce confusion as this order will vary when new values are added; 62 while primarily useful for `int` fields, this could also be useful to implement `text` fields for Oracle (working around the limits on varchars and not having to use CLOBs) 61 63 - (-) slower, less memory efficient (?) 62 64 - (-) more complex code (?) 65 (?) means ''yet to be verified'' 63 66 64 67 In order to reduce the overall complexity, the idea would be to pick only one approach, instead of having to support both. … … 74 77 75 78 '''ticket''' 76 || ''id'' || ''name'' || ''value'' || 79 ||= id ||= name ||= value ||= seq || 80 81 //seq// is the sequence number in case of multiple entries with the same name. 77 82 78 83 or even: 79 84 80 85 '''resource_prop''' 81 || ''realm'' || ''id'' || ''name'' || ''value''||86 ||= realm ||= id ||= name ||= value ||= seq || 82 87 (if we use one mega table for all resources) 88 89 83 90 84 91 Note by the way that newer "resources", like `repository` in MultiRepos already have this `(id,name/value)` form. … … 134 141 135 142 This suggests that using surrogate keys would be preferable. 143 144 136 145 Now if this is the case, the '''resource_prop''' table could as well become: 137 || ''id'' || ''name'' || ''value'' ||138 and the ''realm'' information could simply be store as another name/value entry.146 ||= id ||= name ||= value ||= //seq// 147 and the ''realm'' information could simply be stored as another name/value entry. 139 148 140 149 … … 168 177 169 178 '''ticket_change''' 170 || ''id'' || ''changeid'' || ''name'' || ''value''||179 ||= id ||= changeid ||= name ||= value ||= seq || 171 180 172 181 '''milestone_change''' 173 || ''id'' || ''changeid'' || ''name'' || ''value''||182 ||= id ||= changeid ||= name ||= value ||= seq || 174 183 175 184 or: 176 185 177 186 '''resource_change''' 178 || ''id'' || ''changeid'' || ''name'' || ''value''||187 ||= id ||= changeid ||= name ||= value ||= seq || 179 188 (surrogate key approach) 180 189 … … 209 218 210 219 '''resource_schema''' 211 || ''realm'' || ''prop'' || ''name'' || ''value''||212 || string || string || string || text||220 ||= realm ||= prop ||= name ||= value || 221 || string || string || string || text || 213 222 214 223 '''resource_prop''' 215 || ''id'' || ''name'' || ''value''||216 || int || string || text||224 ||= id ||= name ||= value ||= seq || 225 || int || string || text || int || 217 226 218 227 '''resource_revprop''' 219 || ''changeid'' || ''name'' || ''value''||220 || int || string || text||228 ||= changeid ||= name ||= value ||= seq || 229 || int || string || text || int || 221 230 222 231 '''resource_change''' 223 || ''id'' || ''changeid'' || ''name'' || ''value''||224 || int || int || string || text||232 ||= id ||= changeid ||= name ||= value ||= seq || 233 || int || int || string || text || int || 225 234 }}} 226 235 {{{ … … 230 239 231 240 '''resource_schema''' 232 || ''realm'' || ''prop'' || ''name'' || ''value''||241 ||= realm ||= prop ||= name ||= value || 233 242 || ticket || summary || type || text || 234 || ticket || description || type || wiki ||243 || ticket || description || type || wiki || 235 244 || ticket || reporter || type || text || 236 245 237 246 '''resource_prop''' 238 || ''id'' || ''name'' || ''value''||239 || 0 || id || 130||240 || 0 || summary ||Multiple Project Support||241 || 0 ||description||One day...||242 || 0 || reporter || joe||247 ||= id ||= name ||= value ||= seq || 248 || 0|| id || 130 || 0|| 249 || 0|| summary ||Multiple Project Support|| 0|| 250 || 0||description||One day... || 0|| 251 || 0|| reporter || joe || 0|| 243 252 244 253 '''resource_revprop''' 245 || ''changeid'' || ''name'' || ''value''||246 || 1 || author || joe||247 || 1 || date ||5 years ago||248 || 2 || author || joe||249 || 2 || date ||2 years ago||250 || 2 || comment || come on...||251 || 3 || author || cboos||252 || 3 || date ||1 year ago||253 || 3 || comment || sure...||254 ||= changeid ||= name ||= value ||= seq || 255 || 1|| author || joe || 0|| 256 || 1|| date ||5 years ago|| 0|| 257 || 2|| author || joe || 0|| 258 || 2|| date ||2 years ago|| 0|| 259 || 2|| comment || come on...|| 0|| 260 || 3|| author || cboos || 0|| 261 || 3|| date ||1 year ago || 0|| 262 || 3|| comment || sure... || 0|| 254 263 255 264 '''resource_change''' 256 || ''id'' || ''changeid'' || ''name'' || ''value''||257 || 0 || 1 || id ||130||258 || 0 || 1 || summary ||Multiple Project Support||259 || 0 || 1 ||description||Should be easy...||260 || 0 || 1 || reporter ||joe||261 || 0 || 2 ||description||Should be easy... Redmine has it!||262 || 0 || 3 ||description||One day...||265 ||= id ||= changeid ||= name ||= value ||= seq || 266 || 0|| 1|| id ||130|| 0|| 267 || 0|| 1|| summary ||Multiple Project Support|| 0|| 268 || 0|| 1||description||Should be easy...|| 0|| 269 || 0|| 1|| reporter ||joe|| 0|| 270 || 0|| 2||description||Should be easy... Redmine has it! || 0|| 271 || 0|| 3||description||One day...|| 0|| 263 272 }}} 264 273 … … 278 287 === Complete Model === 279 288 - surrogate keys for all resources 280 - int, short and long text fields289 - int, bigint, short and long text fields 281 290 282 291 Not absolutely necessary to go that far, this could nevertheless help a lot for the MySQL backend (#6986), possibly also for a future Oracle backend. Don't know about PostgreSQL, but for SQLite this should be indifferent. 292 293 `bigint` is needed since we use this to store microsecond precision timestamps (#6466). 283 294 284 295 {{{ … … 286 297 287 298 ==== Schema ==== 299 **FIXME** need to add the `seq` columns here as well 288 300 289 301 '''resource_schema''' … … 335 347 336 348 ==== Example Dataset ==== 349 350 **FIXME** add example of multivalued property 337 351 338 352 '''resource_schema'''