Task #29581

Clever way of adding uuid column

Added by Xavier Perseguers about 8 years ago. Updated over 7 years ago.

Status:
Accepted
Priority:
Must have
Assignee:
-
Start date:
2011-09-09
Due date:
% Done:

0%


Description

At the moment, a whole bunch of code taken from Extension Manager and/or Install Tool has been duplicated in EXT:identity to be able to add the 'uuid' column to all relevant tables.

Besides that duplicating such code is far from being optimal, the way it is currently implemented leads to problems as described in related issues (#29554, #29560).

So the goal is:

  • Avoid duplicating code
  • Do not perform SQL queries on non-existing columns
  • Be consistent and make the Install Tool "know" about those columns

My idea would be to forget the concept of UPDATE! and use an EM hook instead (available since 4.5):

$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['typo3/mod/tools/em/index.php']['checkDBupdates']

I think that if EXT:identity implements it and dynamically (re-)generates its own ext_tables.sql file by specifying that the 'uuid' column should be added to all relevant tables then it will be much more stable (columns are there and not candidate for removal any more!) and the existing "native" TYPO3 methods will be executed without having to reinvent the wheel to add the missing column.

Furthermore, in order to prevent a possible unwanted commit to EXT:identity's repository, easiest way will be to put ext_tables.sql in the SVN ignore list and hard-code the table that is currently specified.

29581.diff View - Skeleton (4.93 KB) Xavier Perseguers, 2011-09-09 08:34


Related issues

Related to Identity - Bug #29554: The UPDATE! script performs lots of invalid queries Closed 2011-09-08
Related to Identity - Bug #29560: Fields uuid are candidates for removal in Install Tool Closed 2011-09-08

History

#1 Updated by Xavier Perseguers about 8 years ago

#2 Updated by Thomas Maroschik about 8 years ago

  • Status changed from New to Accepted
  • Priority changed from Should have to Must have

This looks great, but has 2 issues in my opinion:

  • I would rather put the ext_tables.sql somehow to typo3temp or typo3conf. This would make ext:identity inclusion through svn:externals easier.
    • I'll see what I can do.
  • If you install a new extension you have to check either ext:identity or the install tool for updates. The current way tried to make it as transparent as possible, although I didn't succeed too much.
    • Will try to think about this one.

Thanks,

Tom

#3 Updated by Thomas Maroschik about 8 years ago

Just noticed that the install tool uses the $GLOBALS['TYPO3_LOADED_EXT'] array and the according extension paths in there. This is something I could manipulate to get the ext_tables.sql paths configured for install tool.

The EM should use this path information too in tx_em_install->checkDBupdates as it builds the path by itself. Or is the extension not inside this array upon installation?

#4 Updated by Thomas Maroschik over 7 years ago

Do you think we solved it "OK" now?

Lots of XClasses and code duplication has been removed and integration solved by hooks introduced in 4.6.

The only way we use the duplicate code right now is in the update message. I think it's fine there, as it does just triggered upon calling the extensions configuration page.

#5 Updated by Xavier Perseguers over 7 years ago

Did not check in depth but yes, I think it's OK now :)

Also available in: Atom PDF