11

I found this comparing databases and genrating sql script using liquibase

and I was wondering if how I can do the same with Flyway. 1.- Generating sql script from the differences between tow databases.

Thanks!

Community
  • 1
  • 1
chemipot
  • 252
  • 2
  • 7

4 Answers4

10

There is an option if you use IntelliJ IDEA. Install JPA Buddy and follow this video:

enter image description here

aleksey.stukalov
  • 706
  • 4
  • 16
5

There is no built-in functionality to do this at this point.

Axel Fontaine
  • 34,542
  • 16
  • 106
  • 137
  • Thanks very much. It would be nice to have such a thing in Flyway. I guess I would have to integrate both LiquiBase and Flyway in my project to automate some proceses. – chemipot Feb 10 '15 at 09:27
  • @chemipot Making a database diff tool is a *very* large and complicated challenge. Not at all appropriate to *Flyway*. For me, the entire point of using *Flyway* is that I will *never need* a database diff tool. I always know the current state of each database by looking at the list of applied migrations. – Basil Bourque May 30 '17 at 19:49
  • Hi Axel, is it possible in 2019? – The Coder Aug 01 '19 at 15:08
  • 1
    @BasilBourque the thing is that if you change your JPA entities, you should be able to get a ballpark idea of the changes in underlying schema, rather than manually figure them out. – mjs Jan 17 '21 at 09:49
1

You can use any tool able to do database comparison and generate SQL: Oracle SQL Developer, TOAD, Squirrel SQL, etc.

G Quintana
  • 4,556
  • 1
  • 22
  • 23
  • that's true but what I need it is a build-in functionality with a Java APi to integrate with my project and automate a process and those are just Datasources clients that does not provide what I need. Thanks for the answer! – chemipot Feb 10 '15 at 09:25
0

Liquibase could make the diff from current database (e.g: product) and reference database (e.g: development), but unfortunately, it only works in the same database type, not cross databases with problems: Java Hibernate, Liquibase supports cross databases and SQLite?

Bằng Rikimaru
  • 1,512
  • 2
  • 24
  • 50