Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Output to sql file instead of commiting against the DB #87

Closed
flyway opened this issue Jun 25, 2013 · 62 comments
Closed

Output to sql file instead of commiting against the DB #87

flyway opened this issue Jun 25, 2013 · 62 comments

Comments

@flyway
Copy link
Collaborator

flyway commented Jun 25, 2013

Original author: sylvain....@gmail.com (March 18, 2013 05:59:16)

HI,

We're just starting to use flyway in our project and so far it looks really good. It's gonna help us a lot automatically upgrade all of our different environments.

One thing that would be nice is way to combine all or specific sql versions into one sql file. We would use this because we can't tell our client's IT department (big client) to use flyway for upgrading the prod database and we obviously don't have access to that database.
Currently the only way we can get the database upgraded is by sending them an SQL file (which they run on their stage before prod).

In theory we could manually combine all the relevant files ourselves but that could be a bit cumbersome and error-prone. Also things like placeholders would need to be replaced manually (search & replace but still) with the proper value, again error-prone.

We use maven so a new goal should do it.

That said thanks for the great work!

Original issue: http://code.google.com/p/flyway/issues/detail?id=452

@flyway
Copy link
Collaborator Author

flyway commented Jun 25, 2013

From axel.fontaine.business@gmail.com on March 18, 2013 17:13:10
Hi Sylvain,

thanks for your suggestion! This is the current state of affairs: http://stackoverflow.com/questions/15447276/previewing-the-sql-statements-before-migration-using-flyway

Cheers
Axel

@flyway
Copy link
Collaborator Author

flyway commented Jun 25, 2013

From sylvain....@gmail.com on March 18, 2013 19:32:43
Thanks Axel, very excited about this. I wish I had time to help.

@aldas
Copy link
Contributor

aldas commented Jun 25, 2013

+1

2 similar comments
@kerryland
Copy link

+1

@RalphEng
Copy link

+1

@pimlottc
Copy link

+1

1 similar comment
@ghost
Copy link

ghost commented Oct 8, 2013

+1

@imsandli
Copy link

imsandli commented Dec 4, 2013

any news about this?
This feature would be really nice to have.

@danijelst
Copy link

+1

@jezs
Copy link

jezs commented Feb 6, 2014

I'd love to have this feature as well.

@axelfontaine axelfontaine added this to the Flyway 3.1 milestone Apr 15, 2014
@roboll
Copy link

roboll commented Jul 22, 2014

is this still on the roadmap somewhere?

@edgedalmacio
Copy link

+1

2 similar comments
@manikantag
Copy link

+1

@abhinavrau
Copy link

+1

@axelfontaine axelfontaine modified the milestones: Flyway 3.2, Flyway 3.1 Oct 12, 2014
@jmisur
Copy link

jmisur commented Oct 13, 2014

+1.
btw why is this 1 year old issue (having so many +1s and 3 closed duplicates) preceded by some less "popular" issues in the milestone planning?

@trautonen
Copy link

+1

This is also relevant when you have a lot of migrations. Running 100+ migrations to run an integration test is just too slow. Flyway should be able to check the current version of the db to be updated and then combine the remaining migrations to run at once in single transaction. This of course might get tricky if you are using also programmatic migrations. Maybe sneaking in to the jdbc driver what sql clauses are getting executed and grab them. Or some other solution that is not this hackish. This would also allow proper reporting features of the migrations.

@axelfontaine
Copy link
Contributor

I just wanted to give you a heads up that this issue is still on the roadmap.
Implementing it requires introducing some new abstractions to decouple execution from jdbc.

The reason it hasn't been prioritized higher than it was, is simply that other features were more relevant and that as a general rule bugs get fixed before new features.

P.S.: If this feature is an urgent need for your organisation, you do also have to option to sponsor its development to get it done much sooner: http://flywaydb.org/support/sponsor.html

@PeeZu
Copy link

PeeZu commented Nov 26, 2014

+1

3 similar comments
@vbazagad
Copy link

+1

@neylorsousa
Copy link

+1

@alxmrtn
Copy link

alxmrtn commented Feb 27, 2015

+1

@deusaquilus
Copy link

+1

1 similar comment
@trumpetx
Copy link

+1

@chris03
Copy link

chris03 commented Oct 20, 2016

+42

@trumpetx
Copy link

trumpetx commented Oct 20, 2016

Hey everyone with a +1, I could use some help validating my implementation of "Dry Run". Did I miss anything?

#1458

@cleverdeveloper
Copy link

I would be happy to test it, but so far having difficulties to build it with or without your pull request.

@trumpetx
Copy link

@cleverdeveloper - that was my biggest challenge when changing the code, here's how to build by skipping tests:

mvn install -P-CommercialDBTest -P-CommandlinePlatformAssemblies -DskipTests=true

Once built, the version will be 0-SNAPSHOT if I recall correctly...

@cleverdeveloper
Copy link

I am in the process of trying it out, but I wonder if it does output to file as it says in the title or this would be a next step to implement?

@trumpetx
Copy link

You know what, I didn't implement the fix to this issue exactly... interesting. I found another issue which was closed as a duplicate of this issue and I guess I sort of just implemented the other one. This quite simply runs a "dry run" (using transactions) against a database to test upgrades before they happen. I guess maybe I should open a new issue that's distinct from this one (or reopen the other one)

@dennisjansen
Copy link

+1

@axelfontaine axelfontaine modified the milestones: Flyway 5.0, Flyway 4.1 Feb 6, 2017
@who
Copy link

who commented Feb 7, 2017

+1

2 similar comments
@thebhushanp
Copy link

+1

@myhau
Copy link

myhau commented Mar 31, 2017

+1

@akikhtenko
Copy link

+1

3 similar comments
@lichnost
Copy link

lichnost commented Jun 5, 2017

+1

@odinsy
Copy link

odinsy commented Jun 24, 2017

+1

@ligasgr
Copy link

ligasgr commented Jun 28, 2017

+1

@shoutcool
Copy link

this issue is a show-stopper for using flyway in production environments

@zeidlermicha
Copy link

+1

2 similar comments
@marbon87
Copy link

+1

@rvillars
Copy link

rvillars commented Oct 3, 2017

+1

@agusmba
Copy link

agusmba commented Oct 23, 2017

Maybe using log4jdbc or one of its more recent forks?.

You'd need a copy of the staging/production database though (at least its schema and flyway tables...)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests