Hi all,

my database schema changed after I added a user (Catwalk).

1. Use tg-admin quickstart and enable identity support
2. start cherrypy development server
3. "tg-admin toolbox", add a "User" with the Catwalk
4. point your browser to "localhost:8080"

After that I get a 500 error page: "DatabaseError: database schema has changed"

Traceback is:
------------------------------------------------------------------------------------
Exception in thread VisitManager:
Traceback (most recent call last):
   File "/usr/lib64/python2.4/threading.py", line 442, in __bootstrap
     self.run()
   File "/usr/lib/python2.4/site-packages/turbogears/visit/api.py", line 256, 
in run
     self.update_queued_visits(queue)
   File "/usr/lib/python2.4/site-packages/turbogears/visit/sovisit.py", line 
73, in 
update_queued_visits
     conn.query( conn.sqlrepr(u) )
   File "/usr/lib/python2.4/site-packages/sqlobject/dbconnection.py", line 732, 
in query
     return self._dbConnection._query(self._connection, s)
   File "/usr/lib/python2.4/site-packages/sqlobject/dbconnection.py", line 300, 
in _query
     self._executeRetry(conn, conn.cursor(), s)
   File "/usr/lib/python2.4/site-packages/sqlobject/dbconnection.py", line 295, 
in 
_executeRetry
     return cursor.execute(query)
   File "/usr/lib64/python2.4/site-packages/sqlite/main.py", line 244, in 
execute
     self.rs = self.con.db.execute(SQL)
DatabaseError: database schema has changed
------------------------------------------------------------------------------------

Why does this happen? I did not expect a schema change after adding a user...

To diagnose the problem, I added the following code to "index(self)":
> connection = User._connection._dbConnection._conn
> cursor = connection.cursor()
> cursor.execute('SELECT name FROM sqlite_master WHERE type = "table"')
> print cursor.fetchall()

This is essentially a "SHOW TABLES" emulation in sqlite.

Before adding the user, the output is:
> [('visit',), ('tg_user',), ('tg_group',), ('user_group',), 
> ('group_permission',), ('permission',), ('tg_visit_identity',)]

Afterwards (after setp 4, restarted cherrypy), there *are* more tables:
> [('visit',), ('tg_user',), ('tg_group',), ('user_group',), 
> ('group_permission',), ('permission',), ('tg_visit_identity',), 
> ('tg_visit',), ('tg_permission',), ('visit_identity',)]

Especially the tables "permission"/"tg_permission", "visit"/"tg_visit" and 
"visit_identity"/"tg_visit_identity" seem odd to me.

Is there an error in the generated model? How can I fix this?

fs

--~--~---------~--~----~------------~-------~--~----~
 You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to