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
It appears that even if you're using a TriggerVersionField, the version is still incremented on the Python side on save. Wouldn't this cause an UPDATE, triggering the trigger, causing it to be incremented on the database (e.g. Postgres) side as well? Would this cause the effective version to increment by 2, rather than 1?
I suppose from a version comparison perspective, this isn't a huge problem; it would still satisfy the requirement that someone saving from the Django side compares the version they're editing to the version in the database, and if it's been increased at all, sound the alarms! But it seems like duplicative work, yea?
Is the reason perhaps because triggers might be uninstalled at any time, and it's just a safeguard to ensure that even if triggers go down the core Django functionality at least increments versions?
The text was updated successfully, but these errors were encountered:
Looking at:
django-concurrency/src/concurrency/fields.py
Lines 260 to 276 in ff8eecf
It appears that even if you're using a TriggerVersionField, the version is still incremented on the Python side on save. Wouldn't this cause an UPDATE, triggering the trigger, causing it to be incremented on the database (e.g. Postgres) side as well? Would this cause the effective version to increment by 2, rather than 1?
I suppose from a version comparison perspective, this isn't a huge problem; it would still satisfy the requirement that someone saving from the Django side compares the version they're editing to the version in the database, and if it's been increased at all, sound the alarms! But it seems like duplicative work, yea?
Is the reason perhaps because triggers might be uninstalled at any time, and it's just a safeguard to ensure that even if triggers go down the core Django functionality at least increments versions?
The text was updated successfully, but these errors were encountered: