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

Enhancement: Write only one blame entry for one flush call #37

Open
SimonHeimberg opened this issue Jan 23, 2018 · 1 comment
Open

Enhancement: Write only one blame entry for one flush call #37

SimonHeimberg opened this issue Jan 23, 2018 · 1 comment

Comments

@SimonHeimberg
Copy link

SimonHeimberg commented Jan 23, 2018

Currently a blame entry is written to the audit_association table for every changed table. (Example: when one table and two associated ones are changed, the blaming user is written 3 times with the same info.) All of this blame entries contain the same data. (Because DataDogAudit is called at the very end, the user entity can not change while writing the log.)
Writing the same data multiple times bloats the database unnecessary.
This should not break backward compatibility (reading is the same as before).

ToDo:

  • Adapt the entity: ManyToOne instead of OneToOne for blame (does not change the database)
  • write blame only once in one flush() call, all written AuditLog entries point to this one.
@l3pp4rd
Copy link
Member

l3pp4rd commented Feb 6, 2018

it may make sense if that will save you much of data, but in my opinion, it just makes it harder to deal with, if that is an issue, fork and adapt, or just use the logic in this library, to implement your custom case specific audit log, since still, you may need archiving and all. I do not plan to evolve this project

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

No branches or pull requests

2 participants