ZeroORM::save() throws RecordMissingException when its UPDATE found no row (MySQL reports changed rows, so a zero count is checked against the table). A JSON column whose property is null is written as NULL, not []; JSON is recognised by the property's array type, so MariaDB's longtext JSON columns decode; an unreadable JSON value is logged and read as null or [] instead of failing every read of the table. The unique rule counts soft-deleted rows, as the UNIQUE key does, and an unknown validation rule (the unused exists:) throws. TeamService takes the team row's lock and reads the role again before counting admins in changeRole(), removeMember() and leaveTeam().
Fixed changes to a deleted record reporting success, and a team losing its last admin
Saving a change to something another person deleted a moment before now says the change could not be saved, instead of saying it was. Two admins changing each other's roles at once can no longer leave a team with no admin.