SetupNodrop — is a Magento module that disables drop operations of
disabled modules during setup:upgrade command. Enabled modules can still drop
elements they removed from their db_schema.xml.
This module is useful when working with numerous third-party modules, allowing you to disable some periodically, without possibility to drop their data.
composer require swissup/module-setup-nodrop
bin/magento module:enable Swissup_SetupNodropThat's all. Magento will no longer drop tables, columns, indexes, and
constraints listed in db_schema_whitelist.json of currently disabled modules.