Project

General

Profile

Actions

Feature #33136

closed

Implement Exclude Tables from Compare DB feature in Installtool and Extension installation

Added by Kay Strobach almost 13 years ago. Updated over 4 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2012-01-11
Due date:
% Done:

0%

Estimated time:
PHP Version:
5.3
Tags:
Complexity:
Sprint Focus:

Description

Hello guys,

during my work for EXT:piwikintegration and other software integrations with TYPO3 i struggled at the point, that the installtool always asked me to drop related tables, which are dynamically created by thirdparty tools.

This way i would like to have the chance to define an array of prefixes for tables which should be completly ignored by sql compare as long as the related extension is installed ;)

Starting point for patch:

t3lib/t3lib_install_sql.php or
sysext/install/Classes/Sql/SchemaMigrator.php ;) --> Thanks Christian

Regards
Kay


Related issues 2 (0 open2 closed)

Related to TYPO3 Core - Feature #14338: Database table prefixClosedSteffen Gebert2004-09-26

Actions
Related to TYPO3 Core - Feature #16034: table-prefixingClosed2006-04-12

Actions
Actions #1

Updated by Georg Ringer almost 13 years ago

from the docs

It's highly recommended to prepend all custom fields and tables with the prefix “user_”. Not only will this prefix never be used for any default tables and fields, but the prefix is also recognized by the Install Tool thus warning you that this table or field is apparently a user-added field or table and thus should not be removed during updates of the database structure:

IMO this is the way to go

Actions #2

Updated by Kay Strobach almost 13 years ago

ich tried that, but in 4.5 / 4.6, the installtool still suggests me to prepend the tablename with "zzz_deleted_" and remove the tables afterwards:

e.g.

(USER) ALTER TABLE user_piwikintegration_user_language RENAME zzz_deleted_user_piwikintegration_user_language;

Actions #3

Updated by Kay Strobach almost 13 years ago

my goal is to hide specific tables in the "database compare" dialogue!

Actions #5

Updated by Steffen Ritter almost 13 years ago

  • Target version changed from 4.7.0-alpha3 to 4.7.0-beta1
Actions #6

Updated by Steffen Ritter over 12 years ago

  • Target version deleted (4.7.0-beta1)
Actions #7

Updated by Gregor Agnes about 10 years ago

  • Target version set to next-patchlevel

This problem still exists in 6.2.x

If I prepend tables from 3rd-party tools with "user_", the compare in the install tool still suggests to rename with zzz_deleted.

Thus there is noch possibility to exclude tables.

The result is: no proper database because the risk of renaming unwanted tables is immanent and you will not want to use the compare anymore.

Actions #8

Updated by Mathias Schreiber almost 10 years ago

  • Target version changed from next-patchlevel to 7.4 (Backend)
Actions #9

Updated by Aimeos no-lastname-given over 9 years ago

Furthermore, not all 3rd party applications allow renaming tables to "user_*" and it would be great if extensions can configure prefixes of excluded tables in ext_tables.php or a similar file, e.g.

array('mshop_', 'madmin_' );

to exclude all tables that start with "mshop_" or "madmin_".

Actions #10

Updated by Susanne Moog over 9 years ago

  • Category changed from Install Tool to 1601
Actions #11

Updated by Susanne Moog over 9 years ago

  • Target version changed from 7.4 (Backend) to 7.5
Actions #12

Updated by Benni Mack about 9 years ago

  • Target version deleted (7.5)
Actions #13

Updated by Benni Mack about 9 years ago

  • Category changed from 1601 to Install Tool
Actions #14

Updated by Christian Kuhn over 7 years ago

  • Status changed from New to Rejected

imho, you shouldn't mix entirely different table sets of different applications into one db. instead, you you really need to low-level query something from a 3rd party app, put this into an own db and configure doctrine in typo3 for those table to use a second connection.

Actions #16

Updated by Aimeos no-lastname-given over 7 years ago

Most integrators already do this but for tables that have foreign key contstraints to fe_users this doesn't work.

Actions #17

Updated by Andreas Kießling about 5 years ago

Hi all,

i needed this for a 8.7 setup now, and this seems to do the trick in my ext_localconf.php

\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ConnectionPool::class)
    ->getConnectionByName(\TYPO3\CMS\Core\Database\ConnectionPool::DEFAULT_CONNECTION_NAME)
    ->getConfiguration()->setFilterSchemaAssetsExpression('/^(?!(prefix1|prefix2)\_).*$/');

In newer versions, the regex is deprecated and replaced by a callback based filter https://github.com/doctrine/dbal/pull/3308

HTH
Andreas

Actions #18

Updated by Christian Eßl almost 5 years ago

The solution in unfortunately #17 is not perfect. It tells doctrine to ignore these tables, but makes TYPO3 then try to newly create this tables, because it couldn't be "found" in the schema. Which will then lead to another error:
Base table or view already exists: 1050 Table 'tx_ifoobar' already exists

Actions #19

Updated by Nicole Cordes over 4 years ago

Christian Eßl wrote:

The solution in unfortunately #17 is not perfect. It tells doctrine to ignore these tables, but makes TYPO3 then try to newly create this tables, because it couldn't be "found" in the schema. Which will then lead to another error:
Base table or view already exists: 1050 Table 'tx_ifoobar' already exists

This does mean that TYPO3 knows the tables that you ignore for that connection, doesn't it? IHMO you shouldn't define any SQL in your extension for the tables you are using in your other connection.

Actions

Also available in: Atom PDF