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

@ghost
Copy link
Collaborator

@ghost ghost 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

@ghost
Copy link
Collaborator Author

@ghost ghost 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

@ghost
Copy link
Collaborator Author

@ghost ghost 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 aldas commented Jun 25, 2013

+1

2 similar comments
@kerryland
Copy link

@kerryland kerryland commented Jun 28, 2013

+1

@RalphEng
Copy link

@RalphEng RalphEng commented Jul 25, 2013

+1

@pimlottc
Copy link

@pimlottc pimlottc commented Aug 28, 2013

+1

1 similar comment
@r-giskard-reventlov
Copy link

@r-giskard-reventlov r-giskard-reventlov commented Oct 8, 2013

+1

@imsandli
Copy link

@imsandli imsandli commented Dec 4, 2013

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

@danijelst
Copy link

@danijelst danijelst commented Dec 5, 2013

+1

@jezs
Copy link

@jezs 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 roboll commented Jul 22, 2014

is this still on the roadmap somewhere?

@edgedalmacio
Copy link

@edgedalmacio edgedalmacio commented Sep 15, 2014

+1

2 similar comments
@manikantag
Copy link

@manikantag manikantag commented Sep 16, 2014

+1

@abhinavrau
Copy link

@abhinavrau abhinavrau commented Oct 12, 2014

+1

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

@jmisur 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

@trautonen trautonen commented Oct 14, 2014

+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

@axelfontaine axelfontaine commented Oct 14, 2014

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 PeeZu commented Nov 26, 2014

+1

3 similar comments
@vbazagad
Copy link

@vbazagad vbazagad commented Feb 21, 2015

+1

@neylorsousa
Copy link

@neylorsousa neylorsousa commented Feb 24, 2015

+1

@alxmrtn
Copy link

@alxmrtn alxmrtn commented Feb 27, 2015

+1

@deusaquilus
Copy link

@deusaquilus deusaquilus commented Sep 23, 2016

+1

1 similar comment
@trumpetx
Copy link

@trumpetx trumpetx commented Oct 18, 2016

+1

@chris03
Copy link

@chris03 chris03 commented Oct 20, 2016

+42

@trumpetx
Copy link

@trumpetx 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

@cleverdeveloper cleverdeveloper commented Nov 10, 2016

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

@trumpetx
Copy link

@trumpetx trumpetx commented Nov 10, 2016

@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

@cleverdeveloper cleverdeveloper commented Nov 11, 2016

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

@trumpetx trumpetx commented Nov 11, 2016

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

@dennisjansen dennisjansen commented Jan 4, 2017

+1

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

@who who commented Feb 7, 2017

+1

2 similar comments
@thebhushanp
Copy link

@thebhushanp thebhushanp commented Mar 27, 2017

+1

@myhau
Copy link

@myhau myhau commented Mar 31, 2017

+1

@akikhtenko
Copy link

@akikhtenko akikhtenko commented May 24, 2017

+1

3 similar comments
@lichnost
Copy link

@lichnost lichnost commented Jun 5, 2017

+1

@odinsy
Copy link

@odinsy odinsy commented Jun 24, 2017

+1

@ligasgr
Copy link

@ligasgr ligasgr commented Jun 28, 2017

+1

@shoutcool
Copy link

@shoutcool shoutcool commented Jul 18, 2017

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

@zeidlermicha
Copy link

@zeidlermicha zeidlermicha commented Jul 30, 2017

+1

2 similar comments
@marbon87
Copy link

@marbon87 marbon87 commented Aug 18, 2017

+1

@rvillars
Copy link

@rvillars rvillars commented Oct 3, 2017

+1

@agusmba
Copy link

@agusmba 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
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
You can’t perform that action at this time.