ZennerIoT / ex_audit

Ecto auditing library that transparently tracks changes and can revert them.
MIT License
368 stars 108 forks source link

Tracking schema with associations #29

Open bbb95 opened 4 years ago

bbb95 commented 4 years ago

Hello,

I track schemas items, reservations, and items_reservations. I want to show all Item changes, including the item reservations, when any item_reservation is inserted or deleted.

I start the query from versions and searching for entity_schema is items, and entity_id is the current item id. After that I need to join all 'items_reservations' versions to know when item was reserved or deleted from reservation.

Do you have any solution or idea, how can I make this?

Thanks

narrowtux commented 4 years ago

Tracking of many-to-many associations is not supported at the moment

fantypants commented 3 years ago

Tracking of many-to-many associations is not supported at the moment

Does the above apply to embeds, particularly embeds_many?

narrowtux commented 3 years ago

@fantypants Embeds are tracked as part of the diff of the enclosing schema, embeds_one and embeds_many both work.