I did two things:
- I filled the TeamMembers table with the contents from:
SELECT Users.TeamId, Users.Id, Users.Roles WHERE Users.TeamId = $HERE_COMES_THE_TEAM_ID_THAT_THE_UPGRADE_PROCESS_COMPLAINS_ABOUT - I set DeleteAT for every entry in the TeamMembers table to 0 (zero)
- ALTER TABLE TeamMembers DROP COLUMN DeleteAt
I'm not sure the first step was necessary, however, after that the upgrade command worked.