Domanda

I try to use Flyway to update my databases. In order to setup Flyway I need to get the current DDL. Normaly one would use EclipseLinks schema generation mechanism by configuring:

<property name="eclipselink.ddl-generation" value="drop-and-create-tables" />
<property name="eclipselink.ddl-generation.output-mode" value="sql-script" />

But I am unable to get this working using a GlassFish 3.1.2.

Is there any possibility to achieve what I want, or am I on the wrong track?

È stato utile?

Soluzione

Glassfish overrides the eclipselink DDL properties for its own DDL generation feature described here http://docs.oracle.com/cd/E18930_01/html/821-2418/gbwlh.html It will force writing out scripts that it then uses to create tables, and drop them if required. I don't have the location it has them written to, but check if you can control it through glassfish. Otherwise, try specifying the "eclipselink.create-ddl-jdbc-file-name" property to define the file name and location it ahold be written to. You can also access the persistence unit in a simple java main class outside glassfish if you need the script just once and want to store it with the persistence unit.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top