oci-oracle-xe icon indicating copy to clipboard operation
oci-oracle-xe copied to clipboard

Best practice to migrate DB : Flyway or putting scripts under certain directory ( for example: //container-entrypoint-initdb.d)

Open rajnishgupta11 opened this issue 2 years ago • 1 comments

  • How to Integrate flyway migrate to Oracle XE 18.4 image ?
  • What is better way: flyway or copy scripts under /container-entrypoint-initdb.d ? Consideration: use minimal space for images

rajnishgupta11 avatar Jul 12 '22 05:07 rajnishgupta11

Hi @rajnishgupta11,

Thanks for using these images!

Unfortunately, I have no experience with Flyway so I can't really comment on how to best integrate with it. Perhaps some users of these images do and can comment.

gvenzl avatar Jul 16 '22 17:07 gvenzl

Hi @gvenzl, Hi @rajnishgupta11,

In these days I was trying to build a pre-packed image, (so: already initialized), in order to reduce startup time. Since my aim was to to use that image with testcontainers for CI.

I added a comment here about how I implemented it: https://github.com/testcontainers/testcontainers-java/issues/1892#issuecomment-1363276807

In my case I'm not using flyway directly but I'm using it wrapped in a .jar file. But on the overall perspective it's not so different.

Inside testcontainer's thread we're discussing about the chance of add a working example in this project's documentation. What is your opinion @gvenzl about that?

Jacopo47 avatar Dec 23 '22 16:12 Jacopo47

I was wondering, would https://github.com/gvenzl/oci-oracle-xe/tree/main/examples be an appropriate location for this? But maybe the example outlined by @Jacopo47 here is already a bit too specific. What were the reasons why you did not use Flyway for this but went for a more custom solution?

@rajnishgupta11 Regarding the original question, just have Flyway interact with the container the same way it would with a more traditionally deployed database. There is no specific integration necessary.

kiview avatar Jan 06 '23 13:01 kiview

Hey @Jacopo47,

First of all, thanks for using these images! :)

I just read through the threads over at testcontainers and here and I wonder what kind of documentation works best here. As you already said over at the testcontainers issue, the *-faststart images already provide a ready-to-go database and thanks to the /container-entrypoint-initdb.d facility, initialization scripts can be run automatically.

Why is there a need to pull a jar file into the Docker container, I did not quite get that. Could you please elaborate more?

gvenzl avatar Feb 06 '23 02:02 gvenzl

Closing due to lack of activity.

gvenzl avatar Jul 08 '23 03:07 gvenzl