Skip to content
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

Document versioning does not work #182

Open
ktal90 opened this issue Sep 6, 2018 · 2 comments
Open

Document versioning does not work #182

ktal90 opened this issue Sep 6, 2018 · 2 comments

Comments

@ktal90
Copy link

ktal90 commented Sep 6, 2018

Document versioning, as described in Eve, does not work in Eve-SQLAlchemy. I tried this with the "simple" example by setting VERSIONING = true in settings.py. The app starts fine, but when I PUT against an item, I receive an error:

"message": "An exception occurred: 'People_versions'"

I messed around with the models and tables and am able to get the app accepting PUTs and PATCHes. The people_versions table will even populate on these actions. However, the issue that I run into then is that on GET for the updated item, the _version and _latest_version attributes are left unchanged (always "1").

Here is my version of the "simple" app with my hacks at getting this to work: https://github.com/ktal90/eve-sqlalchemy/tree/versioning_debug/eve_sqlalchemy/examples/versioning. Notice the changes compared to "simple" in settings.py and tables.py.

My next step is to compare how Eve versions in its "update" and "replace" methods to how Eve-SQLAlchemy handles this (or doesn't, which is what I suspect). Initial ideas/guidance would be much appreciated!

@ktal90 ktal90 changed the title Versioning does not work Document versioning does not work Sep 6, 2018
@dkellner
Copy link
Collaborator

dkellner commented Sep 6, 2018

Thanks for looking into this!

It seems that we're not currently running Eve's test cases for versioning at all. One first step could be to include them and see where they break.

You're already writing example code, which is great. You then can easily use the models in that example code to write an integration test, too. This would be another way to make sure it will not break again someday.

@ktal90
Copy link
Author

ktal90 commented Sep 6, 2018

Thanks for the suggestions @dkellner ! I will check this out and update this ticket with my findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants