If you create a TG2 project (rev. 6582) with authentication, model/
auth.py includes
user_group_table = Table('tg_user_group', metadata,
Column('user_id', Integer, ForeignKey('tg_user.user_id',
onupdate="CASCADE", ondelete="CASCADE")),
Column('group_id', Integer, ForeignKey('tg_group.group_id',
onupdate="CASCADE", ondelete="CASCADE"))
)
then, paster setup-app dies with
File "/usr/local/lib/python2.6/dist-packages/SQLAlchemy-0.5.4p2-
py2.6.egg/sqlalchemy/engine/base.py", line 931, in
_handle_dbapi_exception
raise exc.DBAPIError.instance(statement, parameters, e,
connection_invalidated=is_disconnect)
sqlalchemy.exc.DatabaseError: (DatabaseError) ORA-00907: missing right
parenthesis
'\nCREATE TABLE tg_user_group (\n\tuser_id INTEGER, \n\tgroup_id
INTEGER, \n\t FOREIGN KEY(group_id) REFERENCES tg_group (group_id) ON
DELETE CASCADE ON UPDATE CASCADE, \n\t FOREIGN KEY(user_id) REFERENCES
tg_user (user_id) ON DELETE CASCADE ON UPDATE CASCADE\n)\n\n' {}
because SQLAlchemy generated
CREATE TABLE tg_user_group (
user_id INTEGER,
group_id INTEGER,
FOREIGN KEY(group_id) REFERENCES tg_group (group_id) ON
DELETE CASCADE ON UPDATE CASCADE,
FOREIGN KEY(user_id) REFERENCES tg_user (user_id) ON DELETE
CASCADE ON UPDATE CASCADE
)
... and Oracle does not support the ON UPDATE CASCADE phrase. There
is, in fact, no particularly sane way to get ON UPDATE CASCADE
behavior in Oracle. See a discussion at
http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:5773459616034
Is it particularly necessary to specify onupdate="CASCADE" for the
authentication tables? If not, the easiest way to fix this is to
simply drop those keywords from the table definitions, at least when
Oracle is the database.
I just filed a SQLAlchemy ticket, requesting that the fail be more
explicit in SQLAlchemy:
http://www.sqlalchemy.org/trac/ticket/1438 .
Thanks!
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---