Changes between Version 43 and Version 44 of TracMultipleProjects/ComprehensiveSolution
- Timestamp:
- Jul 8, 2007, 4:56:16 AM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
TracMultipleProjects/ComprehensiveSolution
v43 v44 71 71 * We don't want our SQL to be dependent on the format of the `ticket` table, since that could change when you upgrade Trac or even when you install a plugin. 72 72 73 We ended up doing a bit of SQL metaprogramming: we wrote a function called `declare_multitrac_query`that declares the actual multiproject query function. If you call `declare_multitrac_query()` at the beginning of every query, you can then use `multitrac_query(`''WHERE-condition-as-string''`)` to get the actual table. Just make sure to add the project column to the beginning of the result. I know this sounds complicated, but it's actually a simple transformation of any of your existing queries. For example, here's what happened to report:1:73 We ended up doing a bit of SQL metaprogramming: we wrote a function called [http://trac.edgewall.org/attachment/wiki/TracMultipleProjects/ComprehensiveSolution/create_multitrac_db.sql#L61 declare_multitrac_query] that declares the actual multiproject query function. If you call `declare_multitrac_query()` at the beginning of every query, you can then use `multitrac_query(`''WHERE-condition-as-string''`)` to get the actual table. Just make sure to add the project column to the beginning of the result. I know this sounds complicated, but it's actually a simple transformation of any of your existing queries. For example, here's what happened to report:1: 74 74 75 75 {{{