changeset 100:bb5bcf5939f6

Adapt table creation to Trac [http://projects.edgewall.com/trac/changeset/1995 r1995].
author cmlenz
date Tue, 19 Jul 2005 07:23:32 +0000
parents efc1eed69ba8
children 0ae9a10f9d88
files bitten/trac_ext/main.py
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/bitten/trac_ext/main.py
+++ b/bitten/trac_ext/main.py
@@ -40,12 +40,16 @@
         db = self.env.get_db_cnx()
         cursor = db.cursor()
         for table in schema:
-            cursor.execute(db.to_sql(table))
+            for stmt in db.to_sql(table):
+                cursor.execute(stmt)
 
+        # Insert a global version flag
+        cursor.execute("INSERT INTO system (name,value) "
+                       "VALUES ('bitten_version',%s)", (schema_version,))
+
+        # Create the directory for storing snapshot archives
         tarballs_dir = os.path.join(self.env.path, 'snapshots')
 
-        cursor.execute("INSERT INTO system (name,value) "
-                       "VALUES ('bitten_version',%s)", (schema_version,))
         db.commit()
 
     def environment_needs_upgrade(self, db):
Copyright (C) 2012-2017 Edgewall Software