Magento 2: Add a Product Attribute Programmatically With a Data Patch (Not InstallData)
InstallData is dead. This is the data patch pattern I ship to client stores: one class, dropdown options, attribute set assignment, and a patch_list war story from a live deploy.