On Tue, Mar 21, 2006 at 04:05:16PM -0500, James B. Byrne wrote:
> pg_log:
>
> > ERROR: relation "wiki_namespace" does not exist
> > ERROR: current transaction is aborted, commands ignored until end
> > of transaction block ERROR: relation "wiki_namespace" does not
> > exist ERROR: current transaction is aborted, commands ignored until
> > end of transaction block
Mmm, the saga continues.
Was there nothing in the Trac log?
Presumably this is occurring because of this method:
def _need_migration(self, db):
cursor = db.cursor()
try:
cursor.execute("select count(*) from wiki_namespace")
cursor.fetchone()
self.env.log.debug("tractags needs to migrate old data")
return True
except:
return False
This is a total guess, but try the attached patch.
--
Evolution: Taking care of those too stupid to take care of themselves.
Index: api.py
===================================================================
--- api.py (revision 180)
+++ api.py (working copy)
@@ -309,7 +309,7 @@
from trac.db import DatabaseManager
db_backend, _ = DatabaseManager(self.env)._get_connector()
except ImportError:
- db_backend = self.env.get_db_cnx()
+ db_backend = db
cursor = db.cursor()
for table in self.SCHEMA:
@@ -317,13 +317,15 @@
self.env.log.debug(stmt)
cursor.execute(stmt)
+ db.commit()
+
# Migrate old data
if self._need_migration(db):
+ cursor = db.cursor()
cursor.execute("INSERT INTO tags (tagspace, name, tag) SELECT
'wiki', name, namespace FROM wiki_namespace")
cursor.execute("DROP TABLE wiki_namespace")
+ cursor.commit()
except Exception, e:
db.rollback()
raise TracError(str(e))
- db.commit()
-
_______________________________________________
Trac mailing list
[email protected]
http://lists.edgewall.com/mailman/listinfo/trac