fixes #782

You'd think that ``cascade='delete'`` would work here, but a careful reading of their documentation indicates that this MUST be set on the backref rather than on the main relationship.  But regardless, setting it on the ForeignKey accomplishes the same thing but is more efficient, so I just did that.  Which is what we're doing elsewhere anyway, because we ran into this exact same bug with shifts, but I forgot to update this table at the time.  Alas.