]> git.cworth.org Git - turbot/blobdiff - turbot/interaction.py
Add find_puzzle_for_puzzle_id
[turbot] / turbot / interaction.py
index 546e59a70a25728b1dcdee92d60f6d5730687fda..a3fe496c81adb8dc1ceca981c04d3d16a911058e 100644 (file)
@@ -572,7 +572,8 @@ def new_hunt_submission(turb, payload, metadata):
                 {'AttributeName': 'SK', 'AttributeType': 'S'},
                 {'AttributeName': 'channel_id', 'AttributeType': 'S'},
                 {'AttributeName': 'is_hunt', 'AttributeType': 'S'},
-                {'AttributeName': 'url', 'AttributeType': 'S'}
+                {'AttributeName': 'url', 'AttributeType': 'S'},
+                {'AttributeName': 'puzzle_id', 'AttributeType': 'S'}
             ],
             ProvisionedThroughput={
                 'ReadCapacityUnits': 5,
@@ -616,6 +617,16 @@ def new_hunt_submission(turb, payload, metadata):
                     'Projection': {
                         'ProjectionType': 'ALL'
                     }
+                },
+                {
+                    'IndexName': 'puzzle_id_index',
+                    'KeySchema': [
+                        {'AttributeName': 'hunt_id', 'KeyType': 'HASH'},
+                        {'AttributeName': 'puzzle_id', 'KeyType': 'RANGE'},
+                    ],
+                    'Projection': {
+                        'ProjectionType': 'ALL'
+                    }
                 }
             ]
         )