]> git.cworth.org Git - turbot/commitdiff
Add find_puzzle_for_puzzle_id
authorCarl Worth <cworth@cworth.org>
Tue, 12 Jan 2021 01:53:36 +0000 (17:53 -0800)
committerCarl Worth <cworth@cworth.org>
Tue, 12 Jan 2021 02:02:18 +0000 (18:02 -0800)
This exists so that the puzzle-creation code can ensure that it's not
creating a puzzle with the same puzzle_id as an existing
puzzle. Previously, Turbot was just relying on Slack to guarantee
uniqueness, (which worked when channel names were just made from
hunt_id and puzzle_id).

But more recently, the channel names have round names in them as
well. This set up a possible collision where two puzzle with the same
puzzle_id could be created but with different channel names, (if the
two puzzles were placed in different rounds). To be able to fix this
bug we need this query to be able to find a puzzle by means of using
the puzzle_id.

This does require a new index on the database, so that's here too,
(and we're nuking our database to be able to roll this out).


No differences found