Best practice for conversion of plugin db schema code

26 views
Skip to first unread message

Steffen Hoffmann

unread,
Oct 3, 2012, 4:30:10 PM10/3/12
to trac...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dear developers,

I've been transforming TagsPlugin's old, not versioned db schema to
adapt to the preferred Trac-style system with version entries in system
db table and incremental upgrade modules.

This way it's possible to overcome version tests, that rely on raising
an exception by querying for existence of certain some db table. This is
not only an ugly hack, but repeatedly proofed to break upgrades to
Trac-1.0 as well [1][2].

Now, Jun Omae came up with a patch [3] to aim at finally obsoleting
these kind of db table existence tests for all supported database
backends by db backend-specific code for querying the db table catalog
directly.

It is a quest for best-practice regarding this particular issue, and a
good number of other plugins could profit from the result as well, but
still unfinished yet.

Anyone else up to join in for completing the task? I think, that we're
already close to a good solution.

Thanks for your consideration.

Steffen Hoffmann


[1] http://trac-hacks.org/ticket/9521
[2] http://trac.edgewall.org/ticket/10451
[3]
http://trac-hacks.org/attachment/ticket/9521/t9521-use-system-catalog.diff
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAlBsoE8ACgkQ31DJeiZFuHeAAQCgsADTYYdOIGey69x+3nf0myhr
reoAn3jWzXCf+SDD2h4sbY9V7R7KvS/v
=/GjL
-----END PGP SIGNATURE-----

Roberto Longobardi

unread,
Oct 15, 2012, 5:21:55 AM10/15/12
to trac...@googlegroups.com
Hi Steffen,
I used your approach (among other things) in my effort to make the Test Manager plugin compatible with Trac 1.0.

I have updated the set of utility functions that help plugin developers (like myself :D) cope with db upgrades.

This code, as well as the TracGenericClass [1] plugin itself, may be useful to other developers needing to implement a robust upgrade mechanism. BTW, this plugin offers a completely declarative approach to build persistence objects into Trac.

If anyone wishes to take a look at the code, the relevant changes to TracGenericClass are here [2], and the code in Test Manager using them is here [3].

Your function has been added here [4].

I released just yesterday the Trac 1.0-compatible stuff [5].

Thanks, ciao.
Roberto





--
You received this message because you are subscribed to the Google Groups "Trac Development" group.
To post to this group, send email to trac...@googlegroups.com.
To unsubscribe from this group, send email to trac-dev+u...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/trac-dev?hl=en.


Reply all
Reply to author
Forward
0 new messages