Are migrations supposed to run during a fresh installation?

I am having some problems with my setup using docker compose (as detailed here Errors while starting a docker compose project with postgreSQL) and while troubleshooting, I noticed that the migration files were getting executed. Is this intended during a fresh installation of Nextcloud?

If that’s the case, are all migration files supposed to run (from Version13000Date20170705121758.php to Version23000Date20210930122352.php) or only a subset of them runs?

In my case, I noticed that my oc_migrations table contains only 3 records before it starts erroring out.

I was hoping to know about the intended functionality so that I can troubleshoot my way out of this mess.