Skip to content
Snippets Groups Projects
Commit a25f8930 authored by Robert Goldmann's avatar Robert Goldmann
Browse files

Fixed #531 - database upgrade fails for repeating transactions with tags

parent 7b4f6ca8
No related branches found
No related tags found
No related merge requests found
Pipeline #3625 passed
...@@ -82,6 +82,10 @@ public class DateRepair ...@@ -82,6 +82,10 @@ public class DateRepair
for(Transaction transaction : transactions) for(Transaction transaction : transactions)
{ {
// avoid constraint violations
transaction.setTags(new ArrayList<>());
transactionRepository.save(transaction);
final Query nativeQuery = entityManager.createNativeQuery("DELETE FROM `transaction` WHERE id=:ID"); final Query nativeQuery = entityManager.createNativeQuery("DELETE FROM `transaction` WHERE id=:ID");
nativeQuery.setParameter("ID", transaction.getID()); nativeQuery.setParameter("ID", transaction.getID());
nativeQuery.executeUpdate(); nativeQuery.executeUpdate();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment