Flyway and Arcade #1864
Replies: 2 comments 5 replies
-
Very cool. |
Beta Was this translation helpful? Give feedback.
-
This should get you started. Untested; I had to remove personal details and passwords and don't have the DBs set up as spares. The yaml-files should set up the relevant docker containers. I flattened the package structure, but it should work as is. Let me know if anything is unclear or doesn't work; I'll be happy to try and fix or provider further information. |
Beta Was this translation helpful? Give feedback.
-
I did mention this elsewhere and thought I'd leave instructions here:
I have a working setup for managed database migrations with flyway. Flyway itself uses a postgresDB to store its metadata. It might be possible to integrate that into ArcadeDB itself - but I didn't want to manually create the structures for that. (I came close to making it work by recreating the flyway_schema_history table as a document in arcade, but hat no real use for this, so I didn't pursue it further.)
I am running postgres from docker as follows:
Dependencies:
application.properties:
I am not certain if this is strictly necessary, at some stage I had to include the following in the main application:
The config file contains the path to the migrations. I have chosen the JavaRoute, I'm not certain if pure SQL files would also work.
FlywayConfig.java
The following pulls the connection data from a config file, it should be straight forward to include your own data. I am omitting my GraphDbConfig class here. The interface makes the individual migrations easy to implement and read.
MigrationWrapper.java
Finally, under the path specifid in the config (integration/flyway/migrations), I have the versioned setup for arcade DB:
V1__CreateTest.java
All of this has been cobbled together with a lot of trial and error; not everything will be optimal, I am sure I have a few pointless steps in here still. It seems to work for me; and if you want to use your graph DB with a schema, it's a big help.
Beta Was this translation helpful? Give feedback.
All reactions