https://www.ask-sheldon.com/magento-change-attribute-scope-setup-script/
Magento change attribute scope in setup script