The best way to explain why you need to do it the Liquibase way is to show you 
an example which will likely answer your question.

Lets say I have a table and it has two columns.

Table A
  a varchar
  b varchar

I put this into production and I have 10,000 rows of data with a and b 
populated.

During development we realise b isn't a good name for the column, so we change 
it to c. That fits much better with the code but its going to need a database 
upgrade when it comes to the new release in production. Time goes on and then 
when it gets to rolling out production someone looks at the testing database 
and sees the following:

Table A
  a varchar
  c varchar

The database guy doesn't know what you did but he looks at the data and works 
out that this must be what b was in the old schema. So he writes an alter 
statement that he runs on the database to do the upgrade. Alas Liquibase 
doesn't have the AI engine you would hope in order to do this. All it can see 
is that b is gone and c is created, but you really don't want it to drop column 
b and create column c! So you have to define each increment.

So to answer your question - yes you need to define each increment. That is 
until someone works out how to write an expert DBA into the liquibase code 
base. I wouldn't hold my breath, its a fair way off yet. What you can do is use 
the diff functionality to show you the differences and even generate the 
beginnings of a changelog to get you started. You'll still need to modify it by 
hand and check everything its done and test your upgrade process before doing 
it to production, but at least then you would have a testable upgrade process!

I hope that helps.

Paul Keeble



________________________________
From: Evan Ross <[email protected]>
To: [email protected]
Sent: Friday, 20 February, 2009 17:32:07
Subject: [Liquibase-user] Using Liquibase in simple mode?

Sorry for the newbie question, but...

In my application I just need to take a snapshot of the schema on my
development machine and then replicate it on production machines.

The Liquibase documentation talks about doing incremental updates and
keeping track of each one, but my needs are much simpler.
I just need a way to make sure that columns get added, dropped, or have
their types changed while retaining their data.


Can I set this up easily? To do full copies instead of incrementals?


      
------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Liquibase-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/liquibase-user

Reply via email to