Feature #33136
closedImplement Exclude Tables from Compare DB feature in Installtool and Extension installation
0%
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
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
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;
Updated by Kay Strobach almost 13 years ago
my goal is to hide specific tables in the "database compare" dialogue!
Updated by Steffen Ritter almost 13 years ago
- Target version changed from 4.7.0-alpha3 to 4.7.0-beta1
Updated by Steffen Ritter over 12 years ago
- Target version deleted (
4.7.0-beta1)
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.
Updated by Mathias Schreiber almost 10 years ago
- Target version changed from next-patchlevel to 7.4 (Backend)
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_".
Updated by Susanne Moog over 9 years ago
- Category changed from Install Tool to 1601
Updated by Susanne Moog over 9 years ago
- Target version changed from 7.4 (Backend) to 7.5
Updated by Benni Mack about 9 years ago
- Category changed from 1601 to Install Tool
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.
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.
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
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
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.