views:

118

answers:

2

On a project I work I have sometimes have to deal with changes on the table structure, like adding fields. Is there a script that can I use for generate a migration SQL file with only the changes?

PHP, bash or Perl would be nice. The database is postgresql.

+3  A: 

I only know this - Another PostgreSQL Diff Tool (it's java, though), but personally I don't trust computers that much and prefer hand-crafted update scripts.

Michael Krelin - hacker
+3  A: 

Looking on CPAN there is this module which appears to fit the bill: DBIx::Migration::Directories.

/I3az/

draegtun
Interesting. But for what I can tell by the list of packages, `postgresql` may not be supported.
Michael Krelin - hacker
Under Features section it says "Works with Postgres, MySQL, and SQLite2". The list of packages you're referring to is to "handle quirks" in MySQL and SQLite2 ;-)
draegtun
draegtun. Good to know. It just didn't occur to me that there's a single SQL that has no quirks to handle ;-) But then if it was a reference platform... +1 then ;-)
Michael Krelin - hacker