Hello and welcome @Nanovitruvius
There have been a couple of reports of failed upgrades in the past hour or so, and a couple of fixes have now been put in place for those which seemed to have worked for most.
The error "alter schema public owner to discourse;"
in your second codeblock cropped up the other day too, and the advice was: