Change to:

```python
redirect_to = EventRedirect(name=old_name, profile=profile, event=event)
db.session.add(redirect_to)
```