-
Notifications
You must be signed in to change notification settings - Fork 19
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
Removing database columns results in inability to restore/reify. #58
Comments
I think that |
Would appreciate a PR for this. |
@westonganger |
This is tough I dont want this gem to silently ignore this issue. When this issue is encountered this it means that you have made a breaking change to your backup and restore system. But we also need restore to continue to work after this situation. Just need to figure our what the best way to notify the developer when this situation is encountered. Some ideas:
|
I've added #66 which looks to solve this. Took the approach of readme updates and silently ignoring the data. |
v0.5.1 is now released which contains the changes which now ignores data which cannot be assigned to the model instance |
When a database column is removed, restoring or reifying existing items that still reference that column will result in an "unknown attribute" error.
For instance I removed the price field from my products table and tried to reify an old snapshot:
This happens in both
Snapshot#fetch_reified_items
andSnapshotItem#restore_item!
I'm not sure what the best solution would be.
SnapshotItem#object
) and remove all fields that are no longer present in (in this example)Product.attribute_names
, which would fix both casesSnapshot#fetch_reified_items
andSnapshotItem#restore_item!
individually so that #object stays "pure"The text was updated successfully, but these errors were encountered: