Fixes consistency issues in tips table & take_over. #1706
Conversation
Fixes a bug in take_over that results in two entries in the tip table with the same (tipper, tippee, mtime) but different amount. Also removes unnecessary zero tips created in take_over when neither of the users currently tips the tippee. Further description in issue #1704.
I'm wrapping my head around this. I've got this PR locally and have added back the old queries in order to trigger a failing test with
|
Here's the show_table output for
|
So is it |
False! I changed the commented-out part of the SQL, and it's the
|
Bad:
Good:
|
We have separate queries for |
I'm not sure that |
But in |
That's my tentative explanation for why my hypothesis at #1706 (comment) was wrong. |
No (yes?). "Tips giving" means |
@@ -213,9 +241,14 @@ def take_over(self, account_elsewhere, have_confirmation=False): | |||
|
|||
INSERT INTO tips (ctime, tipper, tippee, amount) | |||
|
|||
SELECT DISTINCT ON (tippee) ctime, tipper, tippee, 0 AS amount | |||
FROM tips | |||
WHERE tipper=%s |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmmm ... these also changed, I guess.
Fixes consistency issues in tips table & take_over.
Fixes a bug in take_over that results in two entries in the tip table
with the same (tipper, tippee, mtime) but different amount.
Also removes unnecessary zero tips created in take_over when
neither of the users currently tips the tippee.
Further description in issue #1704.