I think what you're looking for is trac.env.IEnvironmentSetupParticipant: http://trac.edgewall.org/wiki/TracDev/PluginDevelopment/ExtensionPoints/trac.env.IEnvironmentSetupParticipant
Here's an example of using it, both to detect whether an upgrade is needed, and to perform that upgrade: https://github.com/boldprogressives/trac-MultiRepoSearchPlugin/blob/master/multireposearch/sqlindexer.py#L92 (My code uses an database abstraction API that's provided by another plugin, which is what those execute_non_query, get_scalar, etc function calls are.) Hope this helps, Ethan On Wed, Aug 22, 2012 at 8:56 PM, Christopher Nelson < [email protected]> wrote: > I'm working on adding a ticket change listener to the TracPM plugin so > that schedules are continuously updated. On an ongoing basis, I find > that changing one ticket changes dozens or even a hundred others and > that can be done in "UI time". But the very first time a ticket > change is made after the rescheduler is enabled, *every* ticket in the > system needs to be updated. > > I'm not yet 100% sure that I don't have a performance bottleneck in my > code but it occurs to me that it would be nice to do the initial > scheduling outside the ticket change listener. I know some plugins > hook into Trac in a way that when they are first activated a database > upgrade is required and I assume I could do my initial scheduling in > such an upgrade script. But I don't know where that hook is. I found > http://trac.edgewall.org/wiki/TracDev/DatabaseUpgrades but that > doesn't seem to be right. > > Can someone point me at an example? Thanks. > > > Chris > -- > A: Top-posting. > Q: What is the most annoying thing in e-mail? > > -- > You received this message because you are subscribed to the Google Groups > "Trac Development" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/trac-dev?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Trac Development" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.
