Git Product home page Git Product logo

Comments (6)

andreascreten avatar andreascreten commented on July 19, 2024

Sounds like the easiest way to do it indeed.

from ruckusing-migrations.

ruckus avatar ruckus commented on July 19, 2024

When you say rollback do you mean that if during a deploy, the migrations complete but then the deploy fails after that, so you want to rollback any DB changes?

from ruckusing-migrations.

 avatar commented on July 19, 2024

yes, but also there is another case where the deploy succeeds, but you then want to roll it back anyway. In that case, you need to read the version from the schema.txt file of the OLD deploy. It is not currently written to the schema.txt so this would not be possible.

from ruckusing-migrations.

salimane avatar salimane commented on July 19, 2024

is this issue still valid ? if you want to rollback, you can do php ruckus.php db:migrate VERSION=-1 . Or may be I'm misunderstanding something
Thanks

from ruckusing-migrations.

RichardBradley avatar RichardBradley commented on July 19, 2024

@salimane -- db:migrate VERSION=-1 isn't sufficient, as there is no guarantee that each Capistrano deploy added only one new migration to the live database. The feature request here seems to be for Capistrano to remember the schema version of each deploy, so that Capistrano "rollbacks" can integrate with ruckus.

from ruckusing-migrations.

RichardBradley avatar RichardBradley commented on July 19, 2024

One way to implement this might be to add a new ruckus command which rolls back any migrations which are found in the schema_migrations table, but which do not have corresponding migrations in the codebase.
Say ruckus.php db:rollback_to_codebase

Then, in capistrano, after reverting the current link to the old codebase dir, you would cd into that version of the code and run the new rollback command.

( "you need to read the version from the schema.txt file of the OLD deploy" -- this approach would work in projects where the DB history is completely linear, but not on projects which have branches + merges. The version number is not sufficient to uniquely identify a DB version in those cases. )

from ruckusing-migrations.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.