in reply to DBI -- Synchronize table diffs?

I rolled my own for this a while ago because I couldn't find anything. I did it on client time so I can't post it, but I've considered re-writing it from scratch on my own and uploading to CPAN. But that's another story.

I did get some invaluable help from the Algorithm::Diff module. There are facilities in newer DBI versions for retrieving schemas and types but they didn't seem to do what I wanted. (I wrote mine against Sybase, and I know how to mine its catalogs.)

As to actual design tips: it's trickier than it looks at first. Begin by deciding what you mean by "different". Certainly new tables or new columns qualify, but what about column order? Do you want to consider indexes and index characteristics? What about other object types, like views or trigger? Finally, what do you want the code to do once it finds a difference: just report it, or actually generate some SQL to make the change?

The general approach I used is like this:

Similar considerations for views, procedures, triggers, etc.

Anyways, I hope this helps a little.