I have a script that migrates data in the database.
It copies property X to property Y.
If I want the script to be idempotent, what should it do on subsequent call if X changed?
X is 'a' ==> I run the script, then Y is 'a'. now X is 'b'
- What would subsequent call to the script do? set Y to be 'b' or leave it untouched?
For those who wanted me to clarify my question - I am trying to clarify the meaning of "idempotent" when a resource it references changes.
I was asked to write an idempotent script, and one of the comments I got on it were that I did not handle the scenario where Y changes. I had to know if I misunderstood something or if it was not specified in the requirement.
Please do not close this answer as I think future readers may benefit it.