db-ddlutils-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From satz <satyam.bhatna...@gmail.com>
Subject Re: DDL Utils...
Date Thu, 11 Oct 2007 06:59:24 GMT

Hi Thomas,
Thanks for your reply, 
         I'd tried this option also, but since your method is overriden in
the Builder classes( MSSQL/ORACLE), it call the method of derived classes
and clears off the list before exits and it doesnt go back. It was initially
very easy to have requiresFullRebuild and canMigrateData field sets when one
recieved a ColumnRequiredChange, but this didnt help as explained above. So
I did was added UPDATE DML script just before any of the DDL is passed to
processChanges() method under alterDatabase() as I was not relying on the
table recreation process. Since this worked for me I've implemented it.
 By the way there is an getUpdateSql() method in SQLBuilder, which also
needs modification in case one needs to change/update value of the same
column, the map 'values' doesnt help :( discovered this in my
ColumnRequiredChange mdofication.

Thomas Dudziak wrote:
> On 10/7/07, satz <satyam.bhatnagar@gmail.com> wrote:
>>     Since no answer from the forums, I'm working at the code in the
>> SQLBuilder, where i'm trying to modify the approach to handle
>> ColumnRequiredChange. I'm handling this as a DML change by using
>> "generateUpdateSQL()" against the column with new default value,updating
>> the
>> table and applying columnRequiredChange. Hopefully there is a better
>> solution than this. BTW faced this problem on MSSQL n Oracle.
> Basically what you want to do is to force the platform to recreate the
> table instead. The easiest way to achieve this is to add a check for
> the exact condition to the processTableStructureChanges (which is
> typically redefined in concrete builder implementations).
> For an example of how to do this, have a look at the DerbyBuilder
> (which is probably the easiest to understand). There, the
> processTableStructureChanges method checks whether AddColumnChanges
> add or insert columns. Since Derby can only add columns, and only
> non-identity ones, it will use the ALTER TABLE ADD COLUMN statement
> only in these cases (by explicitly calling the corresponding
> processChange method). In all other cases, it will defer to the
> default behavior which is rebuilding the table.
> Tom

View this message in context: http://www.nabble.com/DDL-Utils...-tf4566113.html#a13150511
Sent from the Apache DdlUtils - User mailing list archive at Nabble.com.

View raw message