ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ludwig, Michael" <>
Subject RE: How to script database upgrade using ANT script
Date Thu, 04 Nov 2010 16:44:24 GMT
> I need to write an ant script which upgrades a database version from
> base level 1.00 to a given version number by running a series of mysql
> (ver 5.1.45) scripts.
> Using ANT script I need to:
> 1) create a database
> 2) import mysql database(s) dump to a new schema
> 3) check current database version


> 4) then check if sql script1 exists
> 4.1) if "No" then check for next sql script until it has checked for
> all scripts then "end"
> 4.2) if "yes" then run first sql script then check if second sql
> script exists - if "yes" then run second sql script and so on until
> the required database version is reached.

So, basically, loop over all scripts in order.

> 5) check database version is at correct level then “end” or else start
> the loop again 

If it didn't succeed the first time around, why expect a different
outcome on the next iteration? And how many times would you retry?

I think that regardless of the driver you choose - Ant, shell, VBS, or
whatever - this will boil down to calling the mysql command line client.
Using ant, you can do that by means of the <exec/> task.

View raw message