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
This is more an FYI for others and maybe a feature request.
When you change the column name of a logidze backed model, the history won't change the keys to reflect the new column name (I'm not sure it should). It took me a bit of time to figure out a good way to rewrite history so I thought I'd share.
Configuration is an interesting approach. However, column names could change many times so a key pair feels insufficient to fully deliver on that approach.
I don't think migrating the data oneself is a big deal but a readme section showcasing it. A section like "how Logidze handles table changes". This could also help clarify what kinds of logidze triggers accommodate new column changes and which ones don't. e.g. all columns excluding X seamlessly handles additional columns and renames but note the key change.
One bug to note, in the case where a Logidze user wanted the keys to be immutable, when you change column names but call it on old versions like
post.log_versions.eachdo |post|
post.new_titleend
the versions with only values from post.old_title will return the latest version values for post.new_title.
This is more an FYI for others and maybe a feature request.
When you change the column name of a logidze backed model, the history won't change the keys to reflect the new column name (I'm not sure it should). It took me a bit of time to figure out a good way to rewrite history so I thought I'd share.
One might expect history to be immutable so it may not be worth adding functionality to make the above simpler.
The text was updated successfully, but these errors were encountered: