Coder Social home page Coder Social logo

Comments (3)

dieppa avatar dieppa commented on May 29, 2024 1

Hello @EfreetSK , this seem an important one. We'll take a look shortly.

from mongock.

osantana85 avatar osantana85 commented on May 29, 2024 1

Hello @EfreetSK , after review your provided project and the Mongock's current behaviour, the fix for your project is setting the order in the legacy @ChangeLog annotation, this way:

@ChangeLog(order = "0001")
public class DatabaseChangeLog {
    @ChangeSet(order = "0001", id = "0001", author = "test")
    public void myFirstChangeLog(MongoDatabase db) {
        db.createCollection("helloMongock");
    }
}

Note that the order should be lower than the order of your new @ChangeUnit classes (alphabetical order).

If you have multiple ChangeLog classes, please ensure that you set the order attribute in all of them.

Please let us know if it works for you.

We will update documentation to clarify the upgrade to v5 guide.

Many thanks.

from mongock.

EfreetSK avatar EfreetSK commented on May 29, 2024

@osantana85 Thank you for your reply. You're right, setting the order of @ChangeLog solves my issue, thank you!

Maybe for others who are reading this, I was wondering what should be the order of @ChangeUnit if there are multiple @ChangeSets. So f.e. let's have a @ChangeLog like this

@ChangeLog(order = "0001")
public class DatabaseChangeLog {
    @ChangeSet(order = "0001", id = "0001", author = "test")
    public void myFirstChangeSet(MongoDatabase db) {
        db.createCollection("helloMongock");
    }

    @ChangeSet(order = "0002", id = "0002", author = "test")
    public void mySecondChangeSet(MongoDatabase db) {
        db.createCollection("mySecondCollection");
    }
}

And I was wondering what should be the @ChangeUnit order now, 0002 (as a second class to be executed) or 0003 (as a third 'change set' to be executed). I tried it and the answer is 0003

@ChangeUnit(id="0003", order = "0003", author = "test")
public static class MyFirstChangeUnit {

from mongock.

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.