On Mon, Jun 8, 2009 at 12:33 PM, Catherine<[email protected]> wrote:
>
> 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
> however, Oracle doesn't support the
> I just filed a SQLAlchemy ticket, requesting that the fail be more
> explicit in SQLAlchemy
> http://www.sqlalchemy.org/trac/ticket/1438

That totally is a SA bug. Seems like Mike is already on it.

I guess you can get around the bug for now by removing the cascade
clauses for the M-M tables.

--~--~---------~--~----~------------~-------~--~----~
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