I have two tables, A and B:
A: id, counter_1
B: id, counter_2
Let's assume that some data migration has proceeded, so that B.counter_2
becomes B.counter_2 + A.counter_1
(id's matching), that is, B.counter_2 = B.counter_2 + A.counter_1
Is there any way to check this using pgTAP after the migration proceeded? Can we add something to the data migration script to 'freeze' the state of B table before running the migration so that we could compare the values from the both tables later, during the tests?
The point is that data migrations and unit tests run in specified order within the pipeline and there's no possibility to affect this circumstance.
I've succeeded with checking if all the rows from A table were really proceeded. But I don't have any idea how to check if the new value in B table is really B.old_counter_value + A.counter_value
and if it is possible at all.