|
|
@@ -110,7 +110,9 @@ if __name__ == '__main__':
|
|
|
if broadcast:
|
|
|
view.broadcast(message)
|
|
|
# store new scratching
|
|
|
- query = "INSERT INTO horses(venue, race_date, race, horse) VALUES(%s, %s, %s, %s)"
|
|
|
+ query = """INSERT INTO horses(venue, race_date, race, horse)
|
|
|
+ VALUES(%s, %s, %s, %s)
|
|
|
+ ON CONFLICT(venue, race_date, race, horse) DO NOTHING;"""
|
|
|
cursor.execute(query, (scratching.venue, scratching.date,
|
|
|
scratching.race, scratching.horse))
|
|
|
db.commit()
|