Open ktal90 opened 6 years ago
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.
Thanks for the suggestions @dkellner ! I will check this out and update this ticket with my findings.
Document versioning, as described in Eve, does not work in Eve-SQLAlchemy. I tried this with the "simple" example by setting
VERSIONING = true
insettings.py
. The app starts fine, but when IPUT
against an item, I receive an error: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 onGET
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!