magento / merchdocs

[Deprecated] Magento User Guide
Open Software License 3.0
33 stars 278 forks source link

Extension fails to install if the database has a PREFIX #1747

Closed adrianbsystems closed 2 years ago

adrianbsystems commented 2 years ago

Steps to replicate: composer require magento/module-amazon composer require magento/services-connector php bin/magento setup:upgrade

Expected result: setup completes normally Actual Result: Unable to apply patch Magento\Amazon\Setup\Patch\Schema\DropUnnecessaryIndexesLeftFromOldSchema for module Magento_Amazon. Original exception message: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento2.channel_amazon_account' doesn't exist, query was: SHOW INDEX FROM channel_amazon_account

If the database does not have a PREFIX, the extension installs normally.

Environment: Fresh install Magento CE 2.4.4 No other third party extensions, default Luma theme Debian 11 Bullseye, Kernel: Linux 5.10.0-16-amd64 PHP8.1, Nginx 1.23, MariaDB 10.7, ElasticSearch 7.16, Composer 2.1.4

m2-assistant[bot] commented 2 years ago

Hi @adrianbsystems. Thank you for your report. To speed up processing of this issue, make sure that you provided sufficient information.

Add a comment to assign the issue: @magento I am working on this


adrianbsystems commented 2 years ago

If the database PREFIX is manually added the the files below, setup completes successfully, But this seems not the correct procedure ?

/vendor/magento/module-amazon/Setup/Patch/Schema/DropUnnecessaryIndexesLeftFromOldSchema.php

/**

/vendor/magento/module-amazon/Setup/Patch/Schema/DropLegacyPreV4Columns.php

/**
 * @var ModuleDataSetupInterface $moduleDataSetup
 */
private $moduleDataSetup;

private $columnsToDrop = [
    ['table' => 'nY3g_channel_amazon_account', 'column' => 'setup_step'],
    ['table' => 'nY3g_channel_amazon_action', 'column' => 'api_group'],
    ['table' => 'nY3g_channel_amazon_action', 'column' => 'api_action'],
    ['table' => 'nY3g_channel_amazon_action', 'column' => 'api_content'],
];
dobooth commented 2 years ago

Hi @adrianbsystems Thanks for writing. As this doesn't appear to be a docs issue, but a codebase issue, we suggest you open a bug in the magento2 codebase. Thanks.