On Jun 6, 2006, at 5:27 PM, Randall Smith wrote:

> I see that foreign key properties (delete-orphan, etc) are defined  
> when
> a mapper is created.  So I would think that the database options ON
> DELETE CASCADE, ON UPDATE CASCADE, etc. can't be defined in my table
> definitions such that when I issue the command metadata.create_all 
> () the
> foreign keys on the server are configured.  True?
>
> I don't want to make my tables rely on my application.  For  
> example, if
> I manually (outside of SA) delete a parent record, the child records
> should also be deleted.  So is my only option for configuring my  
> foreign
> keys on the backend to do so manually after metadata.create_all()?
>
> It seems to me that the foreign key properties should be defined with
> the ForeignKey column in the table definition.  Maybe there is a good
> reason it isn't.  Please correct me if I've got the wrong idea about
> these things.
>

only that this is a pending TODO item:

http://www.sqlalchemy.org/trac/ticket/75

the patch in this ticket is most likely functional, pending the  
addition of some fields to ForeignKey, and can be added pretty  
easily. its just hunting down which DB's support which features and  
properly reporting "not implemented" which is the main effort, as  
well as some unit tests being added.



_______________________________________________
Sqlalchemy-users mailing list
Sqlalchemy-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sqlalchemy-users

Reply via email to