diff --git a/fftcgtool/card.py b/fftcgtool/card.py index b051c05..ad2cc90 100644 --- a/fftcgtool/card.py +++ b/fftcgtool/card.py @@ -136,12 +136,12 @@ class Card: def sqlite_save(self, cursor: sqlite3.Cursor) -> None: cursor.execute(""" - UPDATE INTO `cards_indices` (`code`, `index`) + INSERT OR IGNORE INTO `cards_indices` (`code`, `index`) VALUES (?, ?) """, (self.code.short, self.index)) cursor.executemany(""" - UPDATE INTO `cards_content` (`code`, `language`, `name`, `text`, `face`) + INSERT OR IGNORE INTO `cards_content` (`code`, `language`, `name`, `text`, `face`) VALUES(?, ?, ?, ?, ?) """, ( (self.code.short, language.short, content.name, content.text, content.face) @@ -149,7 +149,7 @@ class Card: )) cursor.executemany(""" - UPDATE INTO `cards_elements` (`code`, `element`) + INSERT OR IGNORE INTO `cards_elements` (`code`, `element`) VALUES (?, ?) """, ( (self.code.short, element) diff --git a/fftcgtool/carddb.py b/fftcgtool/carddb.py index 41124b3..c047026 100644 --- a/fftcgtool/carddb.py +++ b/fftcgtool/carddb.py @@ -137,7 +137,7 @@ class RWCardDB(CardDB): card.sqlite_save(cursor) cursor.executemany(""" - UPDATE INTO `faces_urls` (`face`, `url`) + INSERT OR IGNORE INTO `faces_urls` (`face`, `url`) VALUES(?, ?) """, self._face_to_url.items())