Always populate the Sort field in the SiteTree_Blocks table
For now, the Sort field always has a value of zero unless the user has performed some drag&drop actions. Usually this works good, as new blocks appear after old ones when they are created. However, my database seems to occasionally rearrange the order of how the Block records are stored in the database, which means that my blocks randomly jump around every now and then. The solution is to manually drag&drop them to correct positions, but it could be better if the Sort field would get a correct value at the very beginning :). I know this perhaps does not come up on all environments, so perhaps not everyone has noticed this.
Perhaps I will create a PR for this myself, but for now I will just raise an issue about it, as I don't have time atm to fix this and it's also good to hear opinions about this. Thanks! :)
Somehthing like this gist applied to your Block subclass will work for blocks on page. I haven't done it for blocksets yet.