Commits

Ada Young committed e1ea98d

Added index to descriptions table, added Note to additional descriptions on the same name.

Comments (0)

Files changed (1)

         description TEXT
     )""")
     cursor.execute("""
+    CREATE INDEX IF NOT EXISTS desc_index ON descriptions (name, race, gender, description)
+    """)
+    cursor.execute("""
     CREATE VIRTUAL TABLE IF NOT EXISTS desc_fts USING fts4 (
         content="descriptions",
         name,
     cursor.execute("SELECT name, description FROM descriptions WHERE name=? AND description=?", (name, description))
     results = cursor.fetchall()
     if not len(results) > 0:
+
+        cursor.execute("SELECT name FROM descriptions WHERE name=?", (name, ))
+        results = cursor.fetchall()
+        if len(results) > 0:
+            Note("Added new description for: %s" % name)
+
         cursor.execute("INSERT INTO descriptions (name, race, gender, description) VALUES (?, ?, ?, ?)", (name, race, gender, description))
         db.commit()
 ]]>