Skip to content

Cannot run "php bin/magento setup:upgrade" command when 2 stores with different table prefixes are installed in one database. #33320

Open
@fedorovych

Description

@fedorovych

Preconditions (*)

Magento have a default option to use a database with prefix or without prefix. Same is true that you can install multiple Magento instances into one database.
We installed one default Magento with prefix and one default Magento without prefix into one MySQL database. So we had 2 default Magento installations within one MySQL database, one with a prefix and another one without any prefix:

Store_1
Magento 2.4.2p1
PHP 7.4
Store_1/app/etc/env.php
'db' => ['table_prefix' => 'sp2_','connection' => ['default' => ['host' => '192.168.0.31:3306','dbname' => 'magento237','username' => 'root','password' => 'root','model' => 'mysql4','engine' => 'innodb','initStatements' => 'SET NAMES utf8;','active' => '1','driver_options' => [1014 => false]]

Store_2
Magento 2.3.7
PHP 7.4
Store_2/app/etc/env.php
'db' => ['table_prefix' => '','connection' => ['default' => ['host' => '192.168.0.31:3306','dbname' => 'magento237','username' => 'root','password' => 'root','model' => 'mysql4','engine' => 'innodb','initStatements' => 'SET NAMES utf8;','active' => '1','driver_options' => [1014 => false]]

Steps to reproduce (*)

  1. Connect to Store_1(magento with prefix) through command-line.
  2. Execute the "php bin/magento setup:upgrade" command.

Expected result (*)

It must complete the operation of the command without any error.

Actual result (*)

Table error message:
SQLSTATE[42S02]: Base table or view not found: 1146 Table 'magento237.sp2_catalogsearch_fulltext_scope1' doesn't exist, query was: SHOW CREATE TABLE sp2_catalogsearch_fulltext_scope1


Please provide Severity assessment for the Issue as Reporter. This information will help during Confirmation and Issue triage processes.

  • Severity: S0 - Affects critical data or functionality and leaves users without workaround.
  • Severity: S1 - Affects critical data or functionality and forces users to employ a workaround.
  • Severity: S2 - Affects non-critical data or functionality and forces users to employ a workaround.
  • Severity: S3 - Affects non-critical data or functionality and does not force users to employ a workaround.
  • Severity: S4 - Affects aesthetics, professional look and feel, “quality” or “usability”.

Metadata

Metadata

Assignees

Labels

Component: Framework/SetupUSE ONLY for FRAMEWORK RELATED BUG! E.g If bug occurs during Catalog Setup use just CatalogIssue: ConfirmedGate 3 Passed. Manual verification of the issue completed. Issue is confirmedPriority: P3May be fixed according to the position in the backlog.Progress: dev in progressReproduced on 2.4.xThe issue has been reproduced on latest 2.4-develop branchSeverity: S1Affects critical data or functionality and forces users to employ a workaround.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions