3

I have disable MSI M 2.4.0 and now I try run upgrade but I get:

SQLSTATE[HY000]: General error: 1829 Cannot drop column 'source_code': needed in a foreign key constraint 'INVENTORY_SOURCE_ITEM_SOURCE_CODE_INVENTORY_SOURCE_SOURCE_CODE' of table ``.`inventory_source_item`, query was: ALTER TABLE `inventory_source` DROP COLUMN `source_code`, DROP COLUMN `name`, DROP COLUMN `enabled`, DROP COLUMN `description`, DROP COLUMN `latitude`, DROP COLUMN `longitude`, DROP COLUMN `country_id`, DROP COLUMN `region_id`, DROP COLUMN `region`, DROP COLUMN `city`, DROP COLUMN `street`, DROP COLUMN `postcode`, DROP COLUMN `contact_name`, DROP COLUMN `email`, DROP COLUMN `phone`, DROP COLUMN `fax`, DROP COLUMN `use_default_carrier_config`, DROP PRIMARY KEY
3

1 Answer 1

11

SOLVED.

If someone is looking for a solution, with this instruction not all modules have been disabled, so it returns an error when s: up Then run:

php bin/magento module:status | grep Magento_Inventory | grep -v List | grep -v None | grep -v -e '^$' | xargs php bin/magento module:disable
php bin/magento s:upgrade
php bin/magento s:s:deploy -f
php bin/magento c:flush
php bin/magento i:reindex
1
  • This isn't a solution if you want to use the modules, but +1 for the 1 liner
    – Joel Davey
    Jan 13, 2022 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.