74281[FEATURE] Auto creation of database fields for TCA "datetime"
Commit message
Review
-
Code review CR +2 Done
- Benni Mack +2
- Stefan Bürk +1
- Nikita Hovratov +1
-
Verified V +2 Done
- Benni Mack +2
- Stefan Bürk +1
- Nikita Hovratov +1
- core-ci +1 CI
Issues 3
Files 11
- typo3/sysext/core/Classes/Database/Schema/DefaultTcaSchema.php19+33 −0
- typo3/sysext/core/Documentation/Changelog/12.0/Breaking-97358-RemovedEvalintFromTCATypeDatetime.rst2+12 −0
- typo3/sysext/core/Documentation/Changelog/12.0/Feature-97232-NewTCATypeDatetime.rst+13 −1
- typo3/sysext/core/ext_tables.sql+0 −3
- typo3/sysext/extbase/Tests/Functional/Fixtures/Extensions/blog_example/ext_tables.sql+3 −6
- typo3/sysext/extensionmanager/ext_tables.sql+0 −1
- typo3/sysext/filemetadata/ext_tables.sql+0 −2
- typo3/sysext/frontend/ext_tables.sql+0 −2
- typo3/sysext/indexed_search/ext_tables.sql+0 −2
- typo3/sysext/redirects/ext_tables.sql+0 −1
- typo3/sysext/workspaces/ext_tables.sql+0 −1
Review log 3341
Show 1016 earlier messages
-
Oli Bartsch uploaded patch set 1 04/12/22, 12:48
-
core-ci voted on patch set 1 V +1 04/12/22, 13:00 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25954
-
Oli Bartsch uploaded patch set 2 04/12/22, 21:19
-
core-ci voted on patch set 2 V +1 04/12/22, 21:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25962
-
Oli Bartsch uploaded patch set 3 04/12/22, 21:54
-
core-ci voted on patch set 3 V +1 04/12/22, 22:04 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25963
-
Oliver Klee commented on patch set 3 04/13/22, 08:19
-
Stefan Bürk commented on patch set 4 04/13/22, 08:58
Published edit on patch set 3. -
Stefan Bürk commented on patch set 4 04/13/22, 08:58
Breaking-97358-RemovedEvalintFromTCATypeDatetime.rst:27ReplyDone -
core-ci voted on patch set 4 V -1 04/13/22, 09:13 Core CI is not happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25970
-
core-ci voted on patch set 4 V +1 04/13/22, 09:30 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25970
-
Oliver Klee wrote 04/13/22, 10:10
Removed cc Oliver Klee. -
Stefan Bürk voted on patch set 4 V +1 CR +1 04/13/22, 13:20
-
Nikita Hovratov uploaded patch set 5 04/13/22, 16:18
-
core-ci voted on patch set 5 V +1 04/13/22, 16:34 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/25992
-
Stefan Bürk voted on patch set 5 V +1 CR +1 04/13/22, 16:59
-
Nikita Hovratov voted on patch set 5 V +1 CR +1 04/13/22, 17:40
-
Benni Mack commented on patch set 5 04/14/22, 11:10
If we really go this way, we should start also use the change from @georgringer to auto-create other TCA fields dynamically. -
Stefan Bürk commented on patch set 5 04/14/22, 11:28
Reply
@benny Which one do you mean ? Should we do a patch with more auto tca generation. There is an issue from Oliver Hader for auto creating "slug" fields from tca. Wanted to do that in a dedicated patch on the weekend - should we combine them ? I think rather not .. or ? -
Benni Mack commented on patch set 5 04/14/22, 11:29
-
Oli Bartsch commented on patch set 5 04/14/22, 12:36
Reply
Pleas note that this patch is not about auto TCA generation but about auto database field generation, based on TCA. -
Benni Mack commented on patch set 5 04/14/22, 12:48
sorry, different idea from Georg. -
Benni Mack commented on patch set 5 04/14/22, 21:02
DefaultTcaSchema.php:497should we use the 'default' from TCA? -
Daniel Windloff commented on patch set 5 04/15/22, 10:06
DefaultTcaSchema.php:51I suggest to rename "enrichSingleTableFields" to "enrichSingleTableFieldsByCtrl" and add something like "enrichSingleTableFieldsByColumn" to carify the source and add the new code there.DefaultTcaSchema.php:206The field generation of starttime and endtime could be removed.DefaultTcaSchema.php:499'unsigned' => true? It is unsigned in generated endtime fields. The removed lines in .sql file are also unsigned. -
Stefan Bürk commented on patch set 5 04/15/22, 10:18
DefaultTcaSchema.php:51ReplyYeah, sounds resonable. However not part or job of this patch. Please create a dedicated patch for it if you want to change this.DefaultTcaSchema.php:206ReplyCan you explain why they should be removed ? However, not related or part of this patch. Please create a dedicated patch where this can be discussed than. We should try to stay in the context of a patch and which is directly related.DefaultTcaSchema.php:497ReplyI think we should not use the TCA default here, but not sure in both directions * it's kind of unusual to have default values other then 0 for time/date fields on dbms level * TCA default should be more used in the backend * changes on TCA default, through other extensions or instances requires a database compare afterwards (and eventually update wizards) Maybe I'm wrong, but I would take the TCA default for DataHander/FORMS default only. And there can be more default changes anyway.DefaultTcaSchema.php:499ReplyNope, that's correct. 'unsigned' => false is needed to support negative values, thus date/time values before 1970. We are talking here about default field generation - so extension developers do not need to define fields in 'ext_tables.sql' but have the best suitable field definition for this. Thus opening values before 1970. Granted, removed fields has been unsigned, which are now changed to signed. Mostly eventually not needed, but still does not hurt in any way. Removing them from core 'ext_table.sql' files and using the default will remove a small maintenance burden. -
Daniel Windloff commented on patch set 5 04/15/22, 10:44
DefaultTcaSchema.php:51ReplyIt is the first field creation based on columns here (excluding MM tables). That's why I think it could be part of this change.DefaultTcaSchema.php:206ReplyThe relation is, that starttime and endtime are of type datetime. There is no need for an additional creation with this patch included. -
Nikita Hovratov commented on patch set 5 04/15/22, 11:03
DefaultTcaSchema.php:206ReplyIt's not 100% sure the fields are defined as datetime by the user. Custom fields can be defined for ['ctrl']['enablecolumns']['starttime'], which might as well be simple number fields and are not filled in the backend, but from another data source. -
Stefan Bürk commented on patch set 5 04/15/22, 11:09
DefaultTcaSchema.php:51ReplyIf it would be the first one, ack. But it's not: https://review.typo3.org/c/Packages/TYPO3.CMS/+/74281/5/typo3/sysext/core/Classes/Database/Schema/DefaultTcaSchema.php#b444DefaultTcaSchema.php:206ReplyFor core, ack. As long they stay defined as this. But the DefaultTCA generation is not only for core definitions. Additional this part creates the database definition only based on the ctrl definition, the colume do not have to exists with a proper "column" type definitions. So if there would be no "column" definition, field would not be auto created. I think we should: * keep them * add check that it is not defined as datetime as tca table column So, if it is a datetime column definition, let the new code create the database definition. If only enablecolumns is defined without column tca type datetime, use this code here. What do you think ? -
Daniel Windloff commented on patch set 5 04/15/22, 11:12
DefaultTcaSchema.php:499ReplyYes, there are different use cases for datetime fields. The signed / unsigned could be set based on the ['config']['range']['lower'] setting. If it is greater or equal 0, it should be unsigned. -
Daniel Windloff commented on patch set 5 04/15/22, 11:21
DefaultTcaSchema.php:51ReplyOk, missed the categories :) -
Daniel Windloff commented on patch set 5 04/15/22, 11:36
DefaultTcaSchema.php:206ReplySounds good. I didn't have different configured columns in mind. I think, the main thing here is, that it should be clear, if column config overwrites ctrl or not. -
Oli Bartsch uploaded patch set 6 04/19/22, 10:48
-
Oli Bartsch commented on patch set 6 04/19/22, 10:53
DefaultTcaSchema.php:206ReplyThe columns config should not override ctrl config, which is kind of special and might not be defined in $TCA[columns] at all. I adjusted the corresponding comment.DefaultTcaSchema.php:497ReplyThis TCA option is not reliable here, because the option can be overridden "dynamically" e.g. with `columnsOverrides`. If the proposed schema definition does not match, extension authors add the suited definition manually.DefaultTcaSchema.php:499ReplyThis TCA option is not reliable here, because the option can be overridden "dynamically" e.g. with `columnsOverrides`. If the proposed schema definition does not match, extension authors add the suited definition manually. -
Stefan Bürk voted on patch set 6 V +1 CR +1 04/19/22, 10:53
-
core-ci voted on patch set 6 V +1 04/19/22, 10:57 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26181
-
Nikita Hovratov uploaded patch set 7 04/19/22, 13:06
-
Nikita Hovratov voted on patch set 7 V +1 CR +1 04/19/22, 13:12
-
core-ci voted on patch set 7 V +1 04/19/22, 13:18 Core CI is happy: https://git.typo3.org/typo3/CI/cms/-/pipelines/26187
-
Stefan Bürk commented on patch set 7 V +1 CR +1 04/19/22, 13:29
Thx Nikita for the nullable correction. -
Benni Mack voted on patch set 7 V +2 CR +2 04/19/22, 18:54
-
Benni Mack merged patch set 8 04/19/22, 18:54
Breaking-97358-RemovedEvalintFromTCATypeDatetime.rst:27