# HG changeset patch # User cmlenz # Date 1121757812 0 # Node ID bb5bcf5939f6e3e667a72b4f5c82ebbe984c999c # Parent efc1eed69ba84feedc5671bdacec3914fc56218b Adapt table creation to Trac [http://projects.edgewall.com/trac/changeset/1995 r1995]. diff --git a/bitten/trac_ext/main.py b/bitten/trac_ext/main.py --- 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):