Updated Flyway configuration.

Change-Id: Id32ef35f47bc190220688086c50be2a7a36a88c4
diff --git a/full/src/main/resources/default-config.xml b/full/src/main/resources/default-config.xml
index c1da94b..0883b8e 100644
--- a/full/src/main/resources/default-config.xml
+++ b/full/src/main/resources/default-config.xml
@@ -107,17 +107,20 @@
 	</bean>
 
 	<!-- to configure database for sqlite, mysql, etc. migrations -->
-	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
+	<bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
 		<property name="baselineOnMigrate" value="true" />
 		<!-- <property name="validateOnMigrate" value="false" /> -->
 		<!-- <property name="cleanOnValidationError" value="true" /> -->
-		<property name="locations" value="${jdbc.schemaPath}" />
+		<property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
 		<!-- <property name="dataSource" ref="dataSource" /> -->
 		<property name="dataSource" ref="sqliteDataSource" />
 		<!-- <property name="dataSource" ref="c3p0DataSource" /> -->
 		
 	</bean>
-
+	
+	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
+		<constructor-arg ref="flywayConfig"/>
+	</bean>
 
 	<bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
 		<constructor-arg index="0" ref="dataSource" />
@@ -126,7 +129,8 @@
 	</bean>
 
 	<bean id="entityManagerFactory"
-		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
+		class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
+		depends-on="flyway">
 		<!-- <property name="dataSource" ref="dataSource" /> -->
 		<property name="dataSource" ref="sqliteDataSource" />
 		<!-- <property name="dataSource" ref="c3p0DataSource" /> -->
diff --git a/full/src/main/resources/properties/jdbc.properties b/full/src/main/resources/properties/jdbc.properties
index 7025240..026ad0e 100644
--- a/full/src/main/resources/properties/jdbc.properties
+++ b/full/src/main/resources/properties/jdbc.properties
@@ -22,4 +22,4 @@
 jdbc.username=pc
 jdbc.password=pc
 # db.insert contains test data, omit it in production setting
-jdbc.schemaPath=db.sqlite, db.predefined
+jdbc.schemaPath=db/sqlite, db/predefined
diff --git a/full/src/test/resources/test-config.xml b/full/src/test/resources/test-config.xml
index b9f5e07..d17718c 100644
--- a/full/src/test/resources/test-config.xml
+++ b/full/src/test/resources/test-config.xml
@@ -97,16 +97,20 @@
 	</bean>
 
 	<!-- to configure database for sqlite, mysql, etc. migrations -->
-	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
+	<bean id="flywayConfig" class="org.flywaydb.core.api.configuration.ClassicConfiguration">
 		<!-- drop existing tables and create new tables -->
 		<property name="validateOnMigrate" value="true" />
 		<property name="cleanOnValidationError" value="true" />
-
 		<property name="baselineOnMigrate" value="false" />
-		<property name="locations" value="${jdbc.schemaPath}" />
+		<property name="locations" value="#{'${jdbc.schemaPath}'.split(',')}"/>
 		<property name="dataSource" ref="sqliteDataSource" />
 		<!-- <property name="dataSource" ref="dataSource" /> -->
 	</bean>
+	
+	<bean id="flyway" class="org.flywaydb.core.Flyway" init-method="migrate">
+	    <constructor-arg ref="flywayConfig"/>
+	</bean>
+	
 
 	<bean id="kustvakt_db" class="de.ids_mannheim.korap.handlers.JDBCClient">
 		<!-- <constructor-arg index="0" ref="dataSource" /> -->
diff --git a/full/src/test/resources/test-jdbc.properties b/full/src/test/resources/test-jdbc.properties
index da5fd57..48f51f5 100644
--- a/full/src/test/resources/test-jdbc.properties
+++ b/full/src/test/resources/test-jdbc.properties
@@ -7,4 +7,4 @@
 #jdbc.url=jdbc:sqlite:testDB.sqlite
 jdbc.username=pc
 jdbc.password=pc
-jdbc.schemaPath=classpath:db.sqlite, db.test, db.predefined
\ No newline at end of file
+jdbc.schemaPath=classpath:db/sqlite,db/predefined,db/test
\ No newline at end of file