- cur.execute("TRUNCATE TABLE import_status")
- cur.execute("""INSERT INTO import_status (lastimportdate, sequence_id, indexed)
- VALUES (%s, %s, %s)""", (date, seq, indexed))
+ if date is None:
+ cur.execute("UPDATE import_status set sequence_id = %s, indexed = %s",
+ (seq, indexed))
+ else:
+ cur.execute("TRUNCATE TABLE import_status")
+ cur.execute("""INSERT INTO import_status (lastimportdate, sequence_id, indexed)
+ VALUES (%s, %s, %s)""", (date, seq, indexed))