Skip to content

Commit

Permalink
Index creation: fix a problem with the table not existing initially
Browse files Browse the repository at this point in the history
  • Loading branch information
gyohng committed Jul 3, 2024
1 parent 81ed31b commit d6831fb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library.py
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ def download(self):
self.logger.debug("Indexing parts table...")
wx.PostEvent(self.parent, UpdateGaugeEvent(value=0))
with contextlib.closing(sqlite3.connect(self.partsdb_file)) as con:
con.execute('DROP TABLE parts_by_lcsc;')
con.execute('DROP TABLE IF EXISTS parts_by_lcsc;')
con.execute('CREATE TABLE IF NOT EXISTS parts_by_lcsc (partsId INTEGER, lcsc TEXT);')
con.execute('DROP INDEX IF EXISTS LCSCpartIdx;')
cur = con.execute('SELECT rowid, `LCSC Part` FROM parts')
Expand Down

0 comments on commit d6831fb

Please sign in to comment.