[1.7.x] Fixed #23855 -- Removed unnecessary all() in tutorial 3.

Backport of 8fce7978307058f9bc7d9f815858f27fdd954409 from master
[1.7.x] Reordered condition to avoid calling allow_migrate() if unneeded.

Backport of 82aca216e130973d142473ebb4b22d1eae146ec7 from master
[1.7.x] Avoided unneeded calls to state.render() in migrations.

Backport of 19ae13d9ed76208b29bb40aec1bfff8196aa7331 from master
[1.7.x] Fixed #23859 -- Fixed a migration crash when a field is renamed that is part of an index_together

Backport of 7b4a994599b75a07cb07d1e0cc26b3bbf25ab7a6 from master.
[1.7.x] Fix malformed note directive.