Project

General

Profile

Actions

Feature #103154

open

Ignore tables during database analysis

Added by Alexander Schnitzler 2 months ago. Updated 2 months ago.

Status:
New
Priority:
Could have
Assignee:
-
Category:
Install Tool
Target version:
-
Start date:
2024-02-19
Due date:
% Done:

0%

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

Description

Hey,
very often when integrating third party software, said software bypasses TYPO3 internals but also manages tables. For example if you want to implement doctrine migrations you need a table with a specific layout. But also when working with event stores. Most bring their schema and manage tables themselves. It's quite tedious replicating the schema through an ext_tables.sql. It would be much easier if we could tell the DatabaseAnalyzer to ignore certain tables or a pattern of tables. That would also ease shared hosting where TYPO3 wants to delete wp_ tables.

Actions #1

Updated by Georg Ringer 2 months ago

using xclass for that currently

class SchemaMigrator extends \TYPO3\CMS\Core\Database\Schema\SchemaMigrator
{
    private const TABLES = [

    ];

    public function getUpdateSuggestions(array $statements, bool $remove = false): array
    {
        $updateSuggestions = parent::getUpdateSuggestions($statements, $remove);
        foreach ($updateSuggestions as $connection => $modifications) {
            foreach ($modifications as $k => $modificationTypes) {
                foreach ($modificationTypes as $t => $modification) {
                    foreach (self::TABLES as $table) {
                        if (is_string($modification) && str_contains($modification, $table)) {
                            unset($updateSuggestions[$connection][$k][$t]);
                        }
                    }
                }
            }
        }
        return $updateSuggestions;
    }
}
Actions #2

Updated by Christian Kuhn 2 months ago

IIRC, the main issue is here that SchemaMigrator & friends are low level stuff used in install tool together with failsafeContainer, and I think this means we can't dispatch events to arbitrary extensions at this point.

I guess we need to investigate if the above statement is still true. If so, the only option to find a solution different than the xclass is probably a typo3-conf-var to blacklist tables (with some wildcards?) by configuration?

Actions

Also available in: Atom PDF