Using session.merge instead of session.add to handle insert/update logic
This commit is contained in:
parent
3bb4c4434c
commit
77e302cd4b
1 changed files with 5 additions and 5 deletions
|
@ -77,7 +77,7 @@ class Covid19Backend(Backend):
|
|||
update_time=update_time,
|
||||
))
|
||||
|
||||
session.add(Covid19Update(country=summary['CountryCode'],
|
||||
session.merge(Covid19Update(country=summary['CountryCode'],
|
||||
confirmed=summary['TotalConfirmed'],
|
||||
deaths=summary['TotalDeaths'],
|
||||
recovered=summary['TotalRecovered'],
|
||||
|
|
Loading…
Reference in a new issue