-
Notifications
You must be signed in to change notification settings - Fork 486
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
"incompatible version data" -> migrate versions JSON, too ? #859
Comments
jedie
added a commit
to jedie/django-reversion
that referenced
this issue
Feb 24, 2021
jedie
added a commit
to jedie/django-reversion-compare
that referenced
this issue
Feb 24, 2021
work-a-round for: etianen/django-reversion#859
Revision databases are often far too large to migrate in any reasonable
timeframe, and hacking into the Django migration system is likely to be
very difficult and fragile.
I'm not sure it's possible, or even desireable, to do so.
…On Wed, 24 Feb 2021 at 07:53, Jens Diemer ***@***.***> wrote:
Now and then a user may see the error:
reversion.errors.RevertError: Could not load <Foo: bar> - incompatible version data.
e.g.:
- #739 <#739>
- #645 <#645>
- #613 <#613>
First thing to do is IMHO:
1. Add a clear note about the problem in the documentation.
2. Enhance the error message, so the user knows what happend
On the long run:
Why not hacked into Django migration system and "migrate" the saved JSON
data, too?
It is probably not easy. But it should be possible in theory, isn't it?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#859>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABEKCCJ2STB6JEDJJN2CL3TASWBDANCNFSM4YEAI6TQ>
.
|
jedie
added a commit
to jedie/django-reversion-compare
that referenced
this issue
Feb 24, 2021
work-a-round for: etianen/django-reversion#859
jedie
added a commit
to jedie/django-reversion-compare
that referenced
this issue
Feb 24, 2021
work-a-round for: etianen/django-reversion#859
jedie
added a commit
to jedie/django-reversion-compare
that referenced
this issue
Feb 24, 2021
work-a-round for: etianen/django-reversion#859 The test project creates a example. This compare must use the fallback: ![grafik](https://user-images.githubusercontent.com/71315/109011223-f57f1480-76b0-11eb-9055-2aad30cd566e.png) The fallback compare diff looks in this case like this: ![grafik](https://user-images.githubusercontent.com/71315/109011333-0f205c00-76b1-11eb-8a6c-6c439710d5b5.png)
Yes, you may be right, it won't be easy in any case. A work-a-round that works without migration might be something like that:
But this is not a really nice solution. But at least better than just to crash ;) |
That would require parsing all the different serialization formats Django
offers. I don't see a way of getting the deserialized field values using
their API.
https://docs.djangoproject.com/en/3.1/topics/serialization/
Really, to support this better, Django-reversion would have to standardize
on a serialization format, such as JSON. To support it in any performant
manner though, we'd really want to use a database table per model approach,
so that migrations can be applied to the version data using the Django
migrations framework. Either approach would effectively be a rewrite of
Django reversion though, with no clear migration path for existing users.
…On Wed, 24 Feb 2021 at 14:39, Jens Diemer ***@***.***> wrote:
Yes, you may be right, it won't be easy in any case.
A work-a-round that works without migration might be something like that:
- Load the current model.
- Change the values field by field from the history. Maybe call
clean() after each change. Skip fields that can be assigned or raise a
ValidationError
But this is not a really nice solution. But at least better than just to
crash ;)
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#859 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AABEKCBPNT47LI5PA2HER3LTAUFS3ANCNFSM4YEAI6TQ>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Now and then a user may see the error:
e.g.:
First thing to do is IMHO:
On the long run:
Why not hacked into Django migration system and "migrate" the saved JSON data, too?
It is probably not easy. But it should be possible in theory, isn't it?
The text was updated successfully, but these errors were encountered: