Feature: #85160 - Auto create management DB fields from TCA ctrl

See Issue #85160

Description

The database schema analyzer automatically creates TYPO3 "management" related database columns by reading a tables TCA and checking the ctrl section for table capabilities.

Note this affects only basic columns like uid, deleted and language handling related fields like sys_language_uid, but not a tables main business fields like a "title" field for a news extension. Those still have to be defined by extension authors. No column definitions are created from the columns section of a tables TCA.

However, ext_tables.sql file can be stripped down to business fields. For example, if a TCA definition of a table specifies $GLOBALS['TCA']['myTable']['ctrl']['sortby'] = 'sorting', the core will automatically add the column sorting with an appropriate definition.

Field definitions in ext_tables.sql take precedence over automatically generated fields, so the core never overrides a manually specified column definition from an ext_tables.sql file.

These columns below are automatically added if not defined in ext_tables.sql for database tables that provide a $GLOBALS['TCA'] definition:

uid and PRIMARY KEY
If removing the uid field from ext_tables.sql, the PRIMARY KEY must be removed, too.
pid and KEY parent
Column pid is unsigned if the table is not workspace aware, the default index parent includes pid and hidden as well as deleted if the latter two are specified in TCA ctrl. The parent index creation is only applied if column pid is auto generated, too.
['ctrl']['tstamp'] = 'fieldName'
Often set to tstamp or updatedon
['ctrl']['crdate'] = 'fieldName'
Often set to crdate or createdon
['ctrl']['cruser_id'] = 'fieldName'
Often set to cruser or createdby
['ctrl']['delete'] = 'fieldName'
Often set to deleted
['ctrl']['enablecolumns']['disabled'] = 'fieldName'
Often set to hidden or disabled
['ctrl']['enablecolumns']['starttime'] = 'fieldName'
Often set to starttime
['ctrl']['enablecolumns']['endtime'] = 'fieldName'
Often set to endtime
['ctrl']['enablecolumns']['fe_group'] = 'fieldName'
Often set to fe_group
['ctrl']['sortby'] = 'fieldName'
Often set to sorting
['ctrl']['descriptionColumn'] = 'fieldName'
Often set to description
['ctrl']['editlock'] = 'fieldName'
Often set to editlock
['ctrl']['languageField'] = 'fieldName'
Often set to sys_language_uid
['ctrl']['transOrigPointerField'] = 'fieldName'
Often set to l10n_parent
['ctrl']['translationSource'] = 'fieldName'
Often set to l10n_source
l10n_state
Column added if languageField and transOrigPointerField are set
['ctrl']['origUid'] = 'fieldName'
Often set to t3_origuid
['ctrl']['transOrigDiffSourceField'] = 'fieldName'
Often set to l10n_diffsource
['ctrl']['versioningWS'] = true - t3ver_* columns
Columns that make a table workspace aware. All those fields are prefixed with t3ver_, for example t3ver_oid and t3ver_id. A default index named t3ver_oid to fields t3ver_oid and t3ver_wsid is added, too.

Impact

Extension developers can skip tons of "general" fields from extensions ext_tables.sql files.