i’m using flyway maven plugin to migrate a database:
<build>
[...]
<plugin>
<groupId>com.googlecode.flyway</groupId>
<artifactId>flyway-maven-plugin</artifactId>
<version>1.6.1</version>
<configuration>
<user>${hibernate.connection.username}</user>
<password>${hibernate.connection.password}</password>
<driver>${driver}</driver>
<url>${url}</url>
</configuration>
</plugin>
I have three environments (dev, pre, pro) and a profile for each. Every environment sets their own properties, so i can use flyway setting concrete profile and make my migrations to DB what i want.
Flyway has a clean goal, this goal allow drops all objects in the schema without dropping the schema itself.
There is some way to desactivate this goal only in one of my profiles? (in prod obviusly :P)
You can override call of the flyway plugin in the prod profile using the none phase: http://thomaswabner.wordpress.com/2010/02/16/howto-disable-inherited-maven-plugin/