|
|
@@ -150,9 +150,9 @@ def send_messages(scratches, source, start=0):
|
|
|
|
|
|
|
|
|
def store_scratched_horses(db, full_scratches):
|
|
|
- query = """INSERT INTO horses(venue, race_date, race, horse_no, horse_display_name)
|
|
|
- VALUES(%s, %s, %s, %s, %s)
|
|
|
- ON CONFLICT(venue, race_date, race, horse_no) DO NOTHING;"""
|
|
|
+ query = """INSERT INTO horses(venue, race_date, race, horse_no, horse_display_name, utctime)
|
|
|
+ VALUES(%s, %s, %s, %s, %s, %s)
|
|
|
+ ON CONFLICT(race, horse_no, utctime) DO NOTHING;"""
|
|
|
|
|
|
scratches_to_return = []
|
|
|
regex = r'^INSERT \d+ (\d+)$'
|
|
|
@@ -160,7 +160,8 @@ def store_scratched_horses(db, full_scratches):
|
|
|
for this_scratching in full_scratches:
|
|
|
database_entry = (this_scratching.venue, this_scratching.date,
|
|
|
this_scratching.race, this_scratching.horse_no,
|
|
|
- this_scratching.horse_display_name)
|
|
|
+ this_scratching.horse_display_name,
|
|
|
+ this_scratching.utc)
|
|
|
cur3.execute(query, database_entry)
|
|
|
match = re.match(regex, cur3.statusmessage)
|
|
|
status = 0
|