Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to set parent Entity #266

Open
Bukashk0zzz opened this issue Jun 18, 2021 · 2 comments
Open

Ability to set parent Entity #266

Bukashk0zzz opened this issue Jun 18, 2021 · 2 comments
Labels
enhancement New feature or request

Comments

@Bukashk0zzz
Copy link

I have this Entity structure on the project:

Company -> Group -> Item

And I need the ability to show all changes inside the group or company.
So for getting all "Item" changes inside the Group now I need to select all Item ids and then select all records regarding them.
In my case, there can be thousands of Items inside the Group and there is no easy way to show all changes inside the Company.

I can propose to add the parentId field or even better add the ability to add custom fields to _audit Entities.

Thanks for awesome bundle.

@Bukashk0zzz Bukashk0zzz added the enhancement New feature or request label Jun 18, 2021
@DamienHarper
Copy link
Owner

@Bukashk0zzz Thanks for the feedback and sorry for this late reply (very busy lately) :)
I'm not sure to understand what you try to achieve exactly but I don't like the parentId field, seems to specific to your use case. Could you please elaborate on what you try to do?

@Bukashk0zzz
Copy link
Author

I already implemented everything using onAuditEvent.

However, my question was how to query few tables at the same time.

For example:
I have city_log, states_log tables.
I need to show changes of any city that are in the state "California" and changes of this state ordered by time.

Example output:
10:00 City name change Sun Francisco -> San Francisco
11:00 State name change California -> Ca
12:00 City name change San Francisco -> Sun Francisco
...

For now, I created a table called all_log and using onAuditEvent push all data to this table, which allows me to easily query few tables and sort them by time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants