fix updating rcid

This commit is contained in:
Markus-Rost 2020-08-11 18:45:08 +02:00
parent 8a545bc23e
commit 00f7ec9b1d

View file

@ -17,7 +17,7 @@ class UpdateDB:
def update_db(self): def update_db(self):
for update in self.updated: for update in self.updated:
if update[2] is None: if update[2] is None:
sql = "UPDATE rcgcdw SET rcid = ? WHERE wiki = ? AND rcid != -1" sql = "UPDATE rcgcdw SET rcid = ? WHERE wiki = ? AND ( rcid != -1 OR rcid IS NULL )"
else: else:
sql = "UPDATE rcgcdw SET postid = ? WHERE wikiid = ?" sql = "UPDATE rcgcdw SET postid = ? WHERE wikiid = ?"
db_cursor.execute(sql, (update[1], update[0],)) db_cursor.execute(sql, (update[1], update[0],))