Skip to content

Commit

Permalink
fix CASCADE DELETE with Postgres
Browse files Browse the repository at this point in the history
  • Loading branch information
uralbash committed May 20, 2014
1 parent 380a43f commit 4654acb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sqlalchemy_mptt/mixins.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,8 @@ def tree_id(cls):
@declared_attr
def parent_id(cls):
return Column("parent_id", Integer,
ForeignKey('%s.id' % cls.__tablename__))
ForeignKey('%s.id' % cls.__tablename__,
ondelete='CASCADE'))

@declared_attr
def parent(cls):
Expand Down

0 comments on commit 4654acb

Please sign in to comment.