Project

General

Profile

Actions

Feature #97524

closed

Make it possible to run UPDATE sql statements within ext_tables_static+adt.sql in SqlReader and SchemaMigrator

Added by Simon Schaufelberger over 2 years ago. Updated over 2 years ago.

Status:
Rejected
Priority:
Should have
Assignee:
-
Category:
Database API (Doctrine DBAL)
Target version:
-
Start date:
2022-04-30
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
SqlReader, SchemaMigrator
Complexity:
easy
Sprint Focus:

Description

SqlReader can currently only read INSERT and CREATE TABLE statements, but not UPDATE statements from ext_tables_static+adt.sql.

SchemaMigrator can currently only run INSERT and CREATE TABLE statements, but not UPDATE statements.

The extension static_info_tables_* therefor need an own solution to update existing company records and add translations. Both, the static_info_tables_* extensions could profit from this feature but also the TYPO3 testing framework which also doesn't support run the UPDATE statements and therefor functional tests which read translated country names can't be tested like translated country names in fluid templates for example.

See: https://github.com/TYPO3/testing-framework/issues/359 and https://github.com/TYPO3/testing-framework/blob/d03dbaf10c680b74439fdb18ada31853bcda02b5/Classes/Core/Testbase.php#L765-L766

Actions #1

Updated by Christian Kuhn over 2 years ago

  • Status changed from New to Needs Feedback

The ext_tables_static+adt.sql API is pretty ugly and we shouldn't extend it any further. It's bad enough that it blindly runs the INSERT statements. extensionmanager already has this quirk to remember the state in registry to see if it should run or not. All in all, that's should mid-term probably vanish altogether in the core and substituted with some more reliable db-row-migration functionality, however it would look like.

Looking at static_info_tables and static_info_tables_de, the involved code does not look really reliable, either. Note class.tx_update.php from static_info_tables_de is no longer supported by core, either. I think these extensions would be better of by creating an upgrade wizard for this kind of rather complex db-priming stuff and to document people should call that wizard after installing the extension. At least for now.

I thus think we shouldn't add more headaches to this area for the moment, but instead look forward to a more solid overall solution. I'm actually unsure if core would have to provide an API for that at all: With composer, an extension could register a script do manage db state of these tables, for instance (just a thought).

I'd like to close this issue as rejected. Is this fine with you?

Actions #2

Updated by Stefan Bürk over 2 years ago

Ack. Let's reject this issue.

UpdateWizards opens the ability to handle this properly on your own and let you control all you need. No need to create an additional API again for it.

Actions #3

Updated by Christian Kuhn over 2 years ago

  • Status changed from Needs Feedback to Rejected
Actions

Also available in: Atom PDF