Comments (3)
Hello @EfreetSK , this seem an important one. We'll take a look shortly.
from mongock.
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.
@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)
- Unable to specify/override ReadConcern for transactional ChangeUnits HOT 1
- Mongock migration for MongoDB on CosmosDB fails HOT 2
- MongoCK ChangeUnit doesn't auto wire other spring beans as dependency HOT 3
- Not supporting @ConditionalOnExpression or @ConditionalOnProperty HOT 2
- ChangeUnits containing Unnamed Variables (JEP443) are not found by Mongock. HOT 7
- Configuration error when using multiple transaction managers HOT 1
- BOM not published for version 5.3.5 HOT 2
- State that the order of a ChangeUnit is alphabetically (documentation/website issue) HOT 1
- Overwriting index of a collection fails HOT 6
- Error Creating bean getBuilder when deploying on docker HOT 5
- When using @ChangeUnit, if @Execution fails, and then @RollbackExecution fails, the original execution failure is not logged anywhere HOT 8
- Proxies are not created in GraalVM HOT 5
- Change units are re-executed unnecessarily HOT 6
- Mongock use the wrong class loader when used with Quarkus HOT 10
- MongoCK 5.4.0 does not execute change sets by order HOT 1
- Exception com.mongodb.MongoCommandException: Command failed with error 26 (NamespaceNotFound) thrown sometimes. HOT 1
- OffsetDateTime support on DateUtils class HOT 7
- Feature request: Skipping particular changeunit
- Feature request: Provide more Metadata on particular change unit run
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongock.