Project

General

Profile

Actions

Bug #84213

open

Working with alternative database, extension manager and BD comparison wrong analyse

Added by Florian Rival about 6 years ago. Updated almost 4 years ago.

Status:
Needs Feedback
Priority:
Must have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2018-03-12
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
8
PHP Version:
7.0
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

Install extension

Working with alternative database, extension manager and BD comparison wrong analyse

When working with an alternate database, LocalConfiguration.php :

'DB' => [
    'Connections' => [
        'Default' => [
            'charset' => 'utf8',
            'dbname' => 'db-typo3',
            'driver' => 'mysqli',
            'host' => 'localhost',
            'password' => '123456',
            'port' => 3306,
            'user' => 'user-t3',
        ],
        'alternativeDb' => [
            'charset' => 'utf8',
            'dbname' => 'db-alternative',
            'driver' => 'mysqli',
            'host' => 'localhost',
            'password' => '123456',
            'port' => 3306,
            'user' => 'user-alt',
        ],
    ],
    'TableMapping' => [
        'My_Table1' => 'alternativeDb',
        'My_Table2' => 'alternativeDb',
        ]
    ]

and trying to install an extension or compare database with Install Tool result in an error saying that the table from alternative database already exists.

#20: The table with name 'alt-db.My_Table1' already exists. (More information)

Note : same result if 'My_Table1' is not in 'TableMapping'.

The tables from alternative database are created with an external application and they are unknown from Typo3.


Files

External-database.png (190 KB) External-database.png Florian Rival, 2018-03-12 15:39
Actions #1

Updated by Florian Rival about 6 years ago

  • Project changed from 9 to TYPO3 Core
  • Category set to Database API (Doctrine DBAL)
  • TYPO3 Version set to 8
  • PHP Version set to 7.0
Actions #2

Updated by Susanne Moog about 4 years ago

  • Status changed from New to Needs Feedback

Just tested on a clean installation in v10 with

    'DB' => [
        'Connections' => [
            'Default' => [
                'charset' => 'utf8',
                'driver' => 'pdo_mysql',
            ],
        ],
        'alternativeDb' => [
            'charset' => 'utf8',
            'dbname' => 'other',
            'driver' => 'mysqli',
            'host' => 'db',
            'password' => 'root',
            'port' => 3306,
            'user' => 'root',
        ],
        'TableMapping' => [
            'My_Table1' => 'alternativeDb',
            'My_Table2' => 'alternativeDb',
        ],
    ],

Database Analyzer and extension installation work fine without errors. Can you recheck if you have set any more configuration options or if this bug also happens in newer TYPO3 versions?

Actions #3

Updated by Stephan Großberndt almost 4 years ago

Does your ext_tables.sql also contain the alternative db part making it alt-db.My_Table1 instead of My_Table1?

Actions #4

Updated by Florian Rival almost 4 years ago

Susanne, Stephan, no I have nothing relative to alternative DB tables in ext_tables.sql, however, in ext_typoscript_setup.txt there is the following code for table mapping :

plugin.tx_myplugin {
   persistence {
      classes {
         Oktopuce\MyPlugin\Domain\Model\MyTable1 {
            mapping {
               tableName = My_Table1
               recordType = \Oktopuce\MyPlugin\Domain\Model\MyTable1
               columns {
                  Col1.mapOnProperty = uid
                  Col2.mapOnProperty = mySecondColumn
               }
            }
         }
      }
   }
}
Actions

Also available in: Atom PDF