Open dmahapatro opened 8 years ago
Requirement:
@robertoschwald Let me know if you want me to send a PR. You mentioned you think about the table name column over the weekend, but if you want I can send the changes related to COLUMN_NAME column.
Would be great if you can form a PR.
Sure. Will work on it over the weekend.
I have a working solution for COLUMN_NAME as property name in my forked repo. I have an integration test which fails because I am unable to set the config property in integration test.
This test should pass because I have used it in a similar way in other applications with Grails 3.1.9. I will look into it more.
Any news on this? Will you provide a PR?
@dmahapatro I think setting in applicationContext config is too late at that point. See the new TruncateSpec how I change it directly in the listeners. https://github.com/robertoschwald/grails-audit-logging-plugin/blob/master/audit-test/src/integration-test/groovy/test/AuditTruncateSpec.groovy#L136
Please mark it the same way as I did to avoid people to do this nasty thing in real live. thx.
It will an useful enhancement if we can add configurations like
grails.plugin.auditLog.logTableName
andgrails.plugin.auditLog.logColumnName
to capture the actual table name and column name respectively.They (actual names and domain class property names) can be mutually exclusive or both inclusive if required. That can also be driven by a config item. That is, either we have one or the other or we can have both properties and actual names. Thoughts?
For example, considering the below
Book
domain class;We can have either
Book
as theCLASS_NAME
in theAUDIT_LOG
table orBOOK
(actual table name) asCLASS_NAME
inAUDIT_LOG
table. It would be nice if we capture both. That would need adding a new column to theAUDIT_LOG
table namedTABLE_NAME
. Same goes withPROPERTY_NAME
andCOLUMN_NAME