Open Yuri05 opened 8 months ago
@msevestre Any concerns?
nope. It's probably just because we always create foreign key based on name and we did not think about it
Note for self: need to add unique index in tab_event_conditions on (event_id, event_container_type, event_name) for that.
In the PK-Sim database we have the FK relationship between tab_event_changed_XXX and tab_event_conditions which includes the calculation_method:
While other columns in this FK-relationship make perfectly sense for me: I don't see why the calculation method should be the same. (with the current FK: "the calculation method of the new assigned formula must be the same as the calculation method of the event condition formula").
Because of this, we need to duplicate some formulas (e.g. when resetting a parameter to the original (fasted state) formula after a meal: we cannot reuse the old formula, because it has a different calculation method ("Lumen_PKSim") and must redefine the formula with the calculation method "Events"
So I suggest to remove the calculation_method column from this FK