openjpa:sql allows to create sql-scripts based on the project's jpa entities. The following sql actions are allowed:
We need an action which creates drop statements regardless if there is already an table/sequence/... with the same name in the database. The drop action currently removes columns from an existing table, if there is a table in the database with additional columns.
We created a patch (see attachment) which adds an additional action (dropSchema). This action creates drop statements regardless of the current database state.
Furthermore, buildSchema should create all create statements regardless of the current database state. JavaDoc of buildSchema:
Currently buildSchema checks if a table already exists in the database and adds missing columns. (like the add action) The attached patch changes the current behavior of buildSchema so that it generates the schema regardless of the current database state.