Welcome to the forum. ![]()
Few things come to mind:
- Do you have actual DB
CHECK CONSTRAINTs? They might be getting in the way. - Does the
StayPolicyPeriodcode touch a changeset where maybe the constraint itself is not mentioned and is only in the DB? You seem to imply that’s not the case, I would double check though (and I don’t have your context, hence the broad suggestion). - This might take you a bit of time but I would attempt to make a second variant of the code that utilizes
Ecto.Multiand see if the error manifests the same way there. - I tried searching for
{:error, :rollback}, even as a global GitHub search. Not many helpful leads butDBConnection’s docs have this to say about that return value:
All
transaction/3calls will return{:error, :rollback}if the transaction failed or connection closed androllback/2is not called for thattransaction/3.
…which, does not help much, does it.
- Finally, I’d put GitHub - akoutmos/ecto_dbg: A utility to format and output Ecto queries · GitHub in the project so I am able to see the exact SQL statements and run them directly against the DB (in its TUI or GUI) and see what it says.
Interesting problem. Hope you keep us posted.


















