Foreign key delete cascade on OAuth2Token user_id doesn't work
Deleting a user with an entry in the OAuth2Token table results in an error:
Failed to delete record. (MySQLdb._exceptions.OperationalError) (1048, "Column 'user_id' cannot be null") [SQL: UPDATE oauth2token SET user_id=%s WHERE oauth2token.id = %s] [parameters: (None, 8)] (Background on this error at: https://sqlalche.me/e/14/e3q8)
I think this is fixed by adding
cascade="all, delete-orphan",
passive_updates=True,
to the OAuth2Token.user backref.