Reputation: 51
In my Typo3 extension ,I want one of my table column as 'datetime' with type as'timestamp' and default as 'CURRENT_TIMESTAMP'. How can I create this in TCA file.
I have given my code below. But this is not creating the column with type timespamp and default value as CURRENT_TIMESTAMP.
'datetime' => array(
'exclude' => 0,
'label' => 'LLL:EXT:besi_jobs/locallang_db.xml:tx_jobs_messages.datetime',
'config' => array(
'type' => 'timestamp',
'size' => '12',
'max' => '20',
'eval' => 'datetime',
'checkbox' => '0',
'default' => 'CURRENT_TIMESTAMP'
)
),
Upvotes: 0
Views: 2422
Reputation: 8614
The type must be set to 'input':
'datetime' => array(
'exclude' => 0,
'label' => 'LLL:EXT:besi_jobs/locallang_db.xml:tx_jobs_messages.datetime',
'config' => array(
'type' => 'input',
'size' => '12',
'max' => '20',
'eval' => 'datetime',
'checkbox' => '0',
'default' => time(),
)
),
int(11) unsigned NOT NULL DEFAULT '0'
. The TCA definition neither creates nor alters the database. It only defines how the field is displayed in the forms.Upvotes: 2