SQLALCHEMY на DELETE SET NULL

category_id = db.Column(db.Integer, db.ForeignKey('category.id', ondelete='SET NULL'))
CBT fan club