OSDN Git Service

classify : fix DB.
[rec10/rec10-git.git] / rec10 / dbMySQL.py
index 9f37bf5..7c862e0 100644 (file)
@@ -1244,7 +1244,8 @@ vim         ")
             title VARCHAR(1024),\
             frompath VARCHAR(1024),\
             topath VARCHAR(1024),\
-            do BOOLEAN\
+            do BOOLEAN,\
+            UNIQUE key (title),\
             )')
         except Exception, inst:
             if not ((type(inst)==MySQLdb.ProgrammingError and inst[0]==1007)or(type(inst)==MySQLdb.OperationalError and inst[0]==1050)):
@@ -1257,6 +1258,12 @@ vim         ")
         values (%s,%s,%s,0)', \
                       (title,frompath, topath))
         self.close_db(db)
+    def delete_refresh_auto_classify(self):
+        db = self.connect_db()
+        db[1].execute("\
+        DROP TABLE auto_classify")
+        self.close_db(db)
+        self.new_auto_classify()
     def delete_old_auto_classify(self, frompath):
         db = self.connect_db()
         db[1].execute("\