1. Fix a bug when init the database
authorhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 6 Mar 2008 09:00:29 +0000 (09:00 +0000)
committerhche10x <hche10x@7335b38e-4728-0410-8992-fb3ffe349368>
Thu, 6 Mar 2008 09:00:29 +0000 (09:00 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@1047 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/Ecc/Database.py

index 48032a8..682eea6 100644 (file)
@@ -46,6 +46,8 @@ DATABASE_PATH = "Database/Ecc.db"
 #\r
 class Database(object):\r
     def __init__(self, DbPath):\r
+        if os.path.exists(DbPath):\r
+            os.remove(DbPath)\r
         self.Conn = sqlite3.connect(DbPath, isolation_level = 'DEFERRED')\r
         self.Conn.execute("PRAGMA page_size=4096")\r
         self.Conn.execute("PRAGMA synchronous=OFF")\r
@@ -67,11 +69,11 @@ class Database(object):
         #\r
         # Drop all old existing tables\r
         #\r
-        self.TblDataModel.Drop()\r
-        self.TblFile.Drop()\r
-        self.TblFunction.Drop()\r
-        self.TblPcd.Drop()\r
-        self.TblIdentifier.Drop()\r
+#        self.TblDataModel.Drop()\r
+#        self.TblFile.Drop()\r
+#        self.TblFunction.Drop()\r
+#        self.TblPcd.Drop()\r
+#        self.TblIdentifier.Drop()\r
         \r
         #\r
         # Create new tables\r