Skip to content

Conversation

lleicher-sg
Copy link

@lleicher-sg lleicher-sg commented Oct 1, 2025

When using typo3/testing-framework with Postgres, you get the following error for tables with foreign keys:

PDOException: SQLSTATE[0A000]: Feature not supported: 7 ERROR:  cannot truncate a table referenced in a foreign key constraint
DETAIL:  Table "tx_groups_members_mm" references "fe_users".
HINT:  Truncate table "tx_groups_members_mm" at the same time, or use TRUNCATE ... CASCADE.

(I am using Postgres 15)

This is caused by \TYPO3\TestingFramework\Core\Testbase::truncateAllTablesForOtherDatabases, because the cascade argument is false by default.

This PR simply sets cascade to true.
Given that only the PostgreSQLPlatform uses the parameter atm, I don't think there will be any side effects.

@sbuerk
Copy link
Collaborator

sbuerk commented Oct 2, 2025

Note

TYPO3 does not support/guarentee foreign key support, neither
in the database analyzer stack nor in any API like datahandler,
extbase and so forth. Something not easily doable anyway.

Looking into the pr later, I guess we may take it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants