Feature: #85160 - Auto create management DB fields from TCA ctrl
See forge#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_
, 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_
file can be stripped down to business fields.
For example, if a TCA
definition of a table specifies
$GLOBALS
,
the core will automatically add the column sorting
with an appropriate
definition.
Field definitions in ext_
take precedence over automatically
generated fields, so the core never overrides a manually specified column definition
from an ext_
file.
These columns below are automatically added if not defined in ext_
for database tables that provide a $GLOBALS
definition:
uid
andPRIMARY KEY
- If removing the uid field from ext_tables.sql, the
PRIMARY KEY
must be removed, too. pid
andKEY parent
- Column pid is
unsigned
if the table is not workspace aware, the default indexparent
includespid
andhidden
as well asdeleted
if the latter two are specified inTCA
ctrl
. The parent index creation is only applied if columnpid
is auto generated, too. ['ctrl']
['tstamp'] = 'field Name' - Often set to
tstamp
orupdatedon
['ctrl']
['crdate'] = 'field Name' - Often set to
crdate
orcreatedon
['ctrl']
['cruser_ id'] = 'field Name' - Often set to
cruser
orcreatedby
['ctrl']
['delete'] = 'field Name' - Often set to
deleted
['ctrl']
['enablecolumns'] ['disabled'] = 'field Name' - Often set to
hidden
ordisabled
['ctrl']
['enablecolumns'] ['starttime'] = 'field Name' - Often set to
starttime
['ctrl']
['enablecolumns'] ['endtime'] = 'field Name' - Often set to
endtime
['ctrl']
['enablecolumns'] ['fe_ group'] = 'field Name' - Often set to
fe_
group ['ctrl']
['sortby'] = 'field Name' - Often set to
sorting
['ctrl']
['description Column'] = 'field Name' - Often set to
description
['ctrl']
['editlock'] = 'field Name' - Often set to
editlock
['ctrl']
['language Field'] = 'field Name' - Often set to
sys_
language_ uid ['ctrl']
['trans Orig Pointer Field'] = 'field Name' - Often set to
l10n_
parent ['ctrl']
['translation Source'] = 'field Name' - Often set to
l10n_
source l10n_
state - Column added if
language
andField trans
are setOrig Pointer Field ['ctrl']
['orig Uid'] = 'field Name' - Often set to
t3_
origuid ['ctrl']
['trans Orig Diff Source Field'] = 'field Name' - Often set to
l10n_
diffsource ['ctrl']
-['versioning WS'] = true t3ver_*
columns- Columns that make a table workspace aware. All those fields are prefixed with
t3ver_
, for examplet3ver_
andoid t3ver_
. A default index namedid t3ver_
to fieldsoid t3ver_
andoid t3ver_
is added, too.wsid
Impact
Extension developers can skip tons of "general" fields from extensions
ext_
files.