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
This is not really a bug report but a discussion post. I would like to know how are you reverting the update op.
For update operation a proper revert will restore the initial value and not just empty it. For e.g. a = 20 and now after update a = 100. To revert means a should be set to 20 only (the previous value) and not 0 or "".
I looked at the README and the example specified there is not really reverting but just overwriting the value:
In down we are just setting blacklisted to false blindly. What if the original value before the update was true for some records? This is not a true revert.
So, how do you revert the update op?
One approach I can think of is:
In up, read the db first before updating and save the data read in a new .json file as a backup. Then in down, just read that newly created backup json file and update the db.
Is it okay if we create the file on-the-fly after reading the db? Is this approach correct?
The text was updated successfully, but these errors were encountered:
Hello all!
This is not really a bug report but a discussion post. I would like to know how are you reverting the update op.
For update operation a proper revert will restore the initial value and not just empty it. For e.g.
a = 20
and now after updatea = 100
. To revert meansa
should be set to20
only (the previous value) and not0
or""
.I looked at the README and the example specified there is not really reverting but just overwriting the value:
In
down
we are just settingblacklisted
tofalse
blindly. What if the original value before the update wastrue
for some records? This is not a true revert.So, how do you revert the update op?
One approach I can think of is:
In
up
, read the db first before updating and save the data read in a new .json file as a backup. Then indown
, just read that newly created backup json file and update the db.Is it okay if we create the file on-the-fly after reading the db? Is this approach correct?
The text was updated successfully, but these errors were encountered: