Fix resource-data delete bug.

Bug 1201974.

Change-Id: I6c4692df71dc7188c0a9caf0ca6c26b67b4e168f
This commit is contained in:
Jason Dunsmore 2013-07-16 16:13:24 -05:00
parent 95191f07f5
commit 319d3e158f

View File

@ -252,8 +252,9 @@ class Resource(BASE, HeatBase):
sqlalchemy.ForeignKey('stack.id'),
nullable=False)
stack = relationship(Stack, backref=backref('resources'))
data = relationship(ResourceData, backref=backref('resources',
lazy='joined'))
data = relationship(ResourceData,
cascade="all,delete",
backref=backref('resource', lazy='joined'))
class WatchRule(BASE, HeatBase):