We have been experiencing the issue of My SQL Gone Away while doing the setup:upgrade of Magento. We have been seeing this error on while doing setup:upgrade and the occurrence of this, is happening when there is ALTER command happening.
MySQL server has gone away in /var/www/html/vendor/magento/zendframework1/library/Zend/Db/Statement/Pdo.php on line 228
Our observation is when ever we do a Setup:Upgrade after we change anything in db_schema.xml, it starts doing ALTER in almost of every pre built tables, even if there are no changes in those changes from our code.
What my question is
- What is the use of ALTER query on not changed tables everytime we do a setup:upgrade?
- Can we push our DB changes without doing setup:upgrade and what is the impact of this in Magento?
- What exact changes needs Setup:upgrade? Is it only DB changes or something else?