Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Skip persisting empty commits (with 0 snapshots) in SQL repository #505
Hi, please follow the https://github.com/javers/javers/blob/master/CONTRIBUTING.md
Bug Reports have to contain:
As you can see in the following example, the second commit creates an entry in jv_commit and no entries in jv_snapshots. When we auto-audit repositories this leads to a lot of entries in jv_commit that are not referenced from other tables because usually we don't check if the entity has been updated before calling repository.save(entity).
Javers javers = JaversBuilder.javers().build(); Person robert = new Person("bob", "Robert Martin"); javers.commit("user", robert); //creates an entry in jv_commit even though nothing has changed on the object javers.commit("user", robert);
The expected behavior would be that commits are persisted only when the commit has snapshots.
Sorry, I couldn't come up with a runnable test case.