http://www.perlmonks.org?node_id=319927


in reply to Automatically altering tables from different schema's

If and only if they are different, then a method taking a database handle should make the necessary changes to the table in question in a transparent manner.
Do you mean you don't want to make the table defintions idenfical if they are already identical? Why not just assume the table definitions are different. Once you have a perl script that can produce the SQL to recreate the table, safe off the data drop table and recreate it and then reload the data.
  • Comment on Re: Automatically altering tables from different schema's

Replies are listed 'Best First'.
Re: Re: Automatically altering tables from different schema's
by liz (Monsignor) on Jan 08, 2004 at 19:51 UTC
    ...Why not just assume the table definitions are different...

    I would let that be up to the developer: either she uses the current table definition, as retrieved from the database, as the "original", or an "original" definition that was stored somewhere else.

    The latter would allow you to keep hidden fields in a table, invisible from your application. This could be handy if you have two "views" on the same table.

    Liz