def METHOD_NAME(self, name, project_name):
    # check exists
    trigger = self.get_trigger_record(name, project_name)
    if trigger is None:
        raise Exception(f"Trigger doesn't exist: {name}")
    task = db.Tasks.query.filter(
        db.Tasks.object_type == self.OBJECT_TYPE,
        db.Tasks.object_id == trigger.id,
        db.Tasks.company_id == ctx.company_id,
    ).first()
    if task is not None:
        db.session.METHOD_NAME(task)
    db.session.METHOD_NAME(trigger)
    db.session.commit()