I don't see any documentation stating that upgrade_schema should return the new schema version.
It seems a bit awkward to return NotImplemented if there is nothing to do.
If we ever want to internationalize this it would be better to assign the value to a variable and log that and raise it as an exception rather than duplicating it.
Could this kind of logic end up being spread all over? Should there be a helper like "add_primary_key" that would centralize it?
Won't this leave non-running processes in self.processes?
The documentation for that is in the error. Since this is for developers I thought that would be fair enough, but I'll add a comment.
Note that this code is also ran after a downgrade, as the code only check whether _code_schema_version != current_schema_version. So having NotImplemented here will also fire if the current schema is newer than supported.
ACK