You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-- case 1) update hstore column (works!)-- "changed_fields": ""hprops"=>"\"x\"=>\"30\", \"y\"=>\"fred\""" -- Works if entire column changed UPDATE audit_test SET hprops = hstore('"x"=>"30", "y"=>"fred"') WHERE id =1-- case 2) add a key or update existing key in hstore column (does not work)-- "changed_fields": ""hprops"=>"\"x\"=>\"30\", \"y\"=>\"bob\"""UPDATE audit_test SET hprops = hprops || hstore('"y"=>"bob"') WHERE id =1-- case 3) delete a key in hstore (does not work)-- "changed_fields": ""hprops"=>"\"x\"=>\"30\"""UPDATE audit_test SET hprops =delete(hprops, 'y') WHERE id =1
In scenario 2, changed_fields should not contain 'x' key as it has not changed
In scenario 3, changed key should be 'y'
The text was updated successfully, but these errors were encountered:
Now that I had more time to think about this, this is probably not an issue...
The mechanics of how hstore (and json(b) perhaps?) column is updated affects the "whole" colum.
The fact that some key in hstore was added/changed/deleted would still result in entire column being updated.
If this is correct, then this issue can be closed...
Can anyone confirm this?
If a table you wish to audit has an hstore column the changes recorded in
changed_fields
is not tracking properly.consider a table with hstore column
hprops
with these initial valuesConsider following 3 scenarios
The text was updated successfully, but these errors were encountered: