From af0584651c14112a60e45ff187535fd5a3138517 Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Thu, 7 May 2020 00:37:21 -0400 Subject: [PATCH] sqlExport: Truncate the transactions table every pull to avoid duplication issues --- memberPlumbing/sqlExport.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/memberPlumbing/sqlExport.py b/memberPlumbing/sqlExport.py index 6dde25c..46d6ee2 100755 --- a/memberPlumbing/sqlExport.py +++ b/memberPlumbing/sqlExport.py @@ -44,6 +44,8 @@ def do_import(config): ml.delete_instance() print("Getting/Updating transactions...") + # Deduping these is hard, so just recreate the data every time + Transaction.truncate_table(); now = datetime.now() start_date = datetime(2010, 1, 1) transactions_csv = membershipworks.get_transactions(start_date, now)