code:
queue_table = Table(
'QUEUES', metadata,
Column('QUEUEID', Integer, autoincrement=True, primary_key=True),
Column('JOBNUM', String(48), ForeignKey('JOBS.JOBNUM',
onupdate="CASCADE", ondelete="CASCADE")),
Column('SCHEDID', String(48), ForeignKey('SCHEDULES.SCHEDID')),
Column('DATE', DateTime),
Column('STATUS', Integer)) # 0 sched 1 Ignore 2 Evalling 3 Running 4
Unsched 5 Error
mapper(queue, queue_table, properties=dict(parent=relation(queue,
backref='job')))
In MSSQL the cascade entries for those tables are set to none and my app
also generate this:
"many-to-many relation, 'secondaryjoin' is needed as well." % (self))
sqlalchemy.exc.ArgumentError: Could not determine join condition between
parent/
child tables on relation queue.parent. Specify a 'primaryjoin' expression.
If
this is a many-to-many relation, 'secondaryjoin' is needed as well.
On Tue, Dec 23, 2008 at 10:52 PM, Michael Bayer <[email protected]>wrote:
> generates the "ON DELETE CASCADE" in the DDL, versus the cascade does not
> work, are two different issues. Which are you experiencing, and if the
> latter, how is the issue manifesting itself ? Can you produce sample code
> which reproduces your issue ?
>
>
>
> On Dec 23, 2008, at 10:19 PM, Michael Mileusnich wrote:
>
> Yea I do the ondelete and onupdate in ForeignKey, creates tables and all
> but does not do the cascade or at least not in MSSQL.
>
> On Tue, Dec 23, 2008 at 7:42 PM, [email protected] <
> [email protected]> wrote:
>
>>
>> I seem to be running into a problem with implementing cascades in
>> sqlalch. Next to my ForeignKey() I have ondelete and onupdate both
>> set to "CASCADE" and in my mapper I have this:
>>
>> mapper(queue, queue_table, properties=dict(parent=relation(queue,
>> backref='JOBS')))
>>
>> However the cascade is not being listed in MSSQL.
>>
>>
>
>
>
>
>
> >
>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" 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/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---