Feature #85160

Auto create management DB fields from TCA ctrl

Added by Christian Kuhn about 1 year ago. Updated 10 months ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
-
Target version:
Start date:
2018-06-05
Due date:
% Done:

100%

PHP Version:
Tags:
Complexity:
Sprint Focus:

Related issues

Related to TYPO3 Core - Feature #81234: TCA Schema Service Needs Feedback 2017-05-16
Related to TYPO3 Core - Bug #85195: Dynamically added fields are added to the end of a table Closed 2018-06-09
Precedes TYPO3 Core - Bug #85345: Cannot set "ready to publish" state anymore Closed

Associated revisions

Revision 7b2319ff (diff)
Added by Christian Kuhn about 1 year ago

[FEATURE] Auto create management DB fields from TCA ctrl

Adds a class that auto creates TYPO3 "management" related database
columns and indexes based on TCA 'ctrl' information without having
them specified in ext_tables.sql. The feature .rst file outlines
field details.

Goals:
  • Save extension developers time.
  • Less copy+paste issues and different general fields definitions.
  • Reduce number of boilerplate fields in ext_tables.sql.
  • Bring schema of management fields under core control.
Non goals:
  • No full substitution of ext_tables.sql by TCA: "Business"
    fields from 'columns' are NOT created automatically. This
    would require further thoughts and code disentangling.
  • No new extension API.
  • No "migration" approach or similar.
Notable patch details:
  • The patch is a revamped version of issue #81234 that has been
    abandoned. As requested in the review of #81234, the code now
    hooks in after ext_tables.sql has been parsed into the doctrine
    schema.
  • Field defintions of ext_tables.sql take precedence, auto fields
    are only added if ext_tables.sql does not define a column or index.
    This makes the patch fully backwards compatible.
  • No deprecation for obsolete field definitions in ext_tables.sql
    is logged.
  • Many core fields are aligned to a central definition and slightly
    change. For instance "uid" is now always an unsigned int.
  • Reduce all core's ext_tables.sql files as well as the functional
    testing related ext_tables.sql files down to the business fields
  • A relatively huge series of test adaptions: Especially the
    ext:impexp related functionals now create dumps with differently
    sorted fields - This is no problem during import.
  • Field t3_origuid of sys_file_reference has never been registered
    in TCA as ['ctrl']['origUid'], is thus unused and removed as obsolete.
  • The extension manager no longer applies possible destructive changes,
    it only adds missing columns and tables when loading / updating
    extensions. It however considers all ext_tables.sql files, not only
    the one the extension in question provides. See the important .rst
    file for details.

Change-Id: I640a7c7da3b63bac21a71102f253aa2d1bef4391
Resolves: #85160
Related: #81234
Releases: master
Reviewed-on: https://review.typo3.org/57121
Tested-by: TYPO3com <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Wouter Wolters <>
Reviewed-by: Benni Mack <>
Tested-by: Benni Mack <>

Revision 87f4395f (diff)
Added by Benni Mack about 1 year ago

[BUGFIX] Ensure dynamically added TCA DB fields are added first

The new functionality introduced in #85160 adds TCA control
database fields dynamically.
However, newly created extensions add these fields (except "uid"
which is a primary column) at the end after the content-related
fields.

The patch re-orders the columns to be added to move them to the
very beginning.

Resolves: #85195
Related: #85160
Releases: master
Change-Id: Ibcf77ae3fea41f067dca0f247bef50d00bdd014f
Reviewed-on: https://review.typo3.org/57155
Tested-by: TYPO3com <>
Reviewed-by: Anja Leichsenring <>
Tested-by: Anja Leichsenring <>
Reviewed-by: Susanne Moog <>
Tested-by: Susanne Moog <>

History

#1 Updated by Gerrit Code Review about 1 year ago

  • Status changed from New to Under Review

Patch set 43 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57121

#2 Updated by Gerrit Code Review about 1 year ago

Patch set 44 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/57121

#3 Updated by Christian Kuhn about 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#4 Updated by Armin Vieweg about 1 year ago

#5 Updated by Benni Mack about 1 year ago

  • Related to Bug #85195: Dynamically added fields are added to the end of a table added

#6 Updated by Oliver Hader about 1 year ago

  • Precedes Bug #85345: Cannot set "ready to publish" state anymore added

#7 Updated by Benni Mack 10 months ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF