jpos / jPOS-EE

jPOS Extended Edition
http://jpos.org
GNU Affero General Public License v3.0
107 stars 152 forks source link

feat: Support for Environment to flyway service #245

Closed aVolpe closed 2 years ago

aVolpe commented 2 years ago

The FlywayService qbean is helpful to integrate flyway into the life cycle of the server.

Normally we can migrate the schema automatically in development or local environments, but in production normally we use a database user with limited permissions (for example the user can't perform DDL -CREATE, DROP-).

With this commit you can specify a property as the child of the tag:

<flyway class="org.jpos.flyway.FlywayService" logger="Q2">
    <property name="out-of-order" value="true" />
    <commands>${flyway_commands:validate}</commands>
</flyway>

This will allow setting an environment variable to local/dev environments to perform migrations automatically (flyway_commands=migrate).

Signed-off-by: Arturo Volpe arturovolpe@gmail.com