Change where custom fields are stored #38658
Replies: 8 comments 22 replies
-
An alternative would be to add an additional field to the #__content table at install/upgrade and to store all the field data as json in that field |
Beta Was this translation helpful? Give feedback.
-
Nice idea |
Beta Was this translation helpful? Give feedback.
-
Historically the content table is designed for articles. Now you want to place there the content from all other entities including extensions that support custom fields. Does not sound so good. |
Beta Was this translation helpful? Give feedback.
-
You need to remember that Joomla is updated separately, and third - party extensions are updated separately. If the change happens in Joomla, and the third - party extension developers do not make changes to their extensions in advance, then there will be a lot of negativity. |
Beta Was this translation helpful? Give feedback.
-
Sorry Brian, this is a bad idea, it will give a lot of headaches for maintain CMS, I mean maintaining DB structure. This is the reason why other CMS use dedicated table for custom fields. |
Beta Was this translation helpful? Give feedback.
-
It would be a great idea to get rid of EAV, and it would give a huge performance boost, but this is only possible if the field values are stored in JSON. And in order to work normally with JSON, you need to increase the requirements for databases to Mysql 8.0.21 Well, as for compatibility with the old structure, this is solved with the help of legacy and the update script. But no one listens to me anyway, so this is just my opinion. |
Beta Was this translation helpful? Give feedback.
-
joomla already manage JSON "in some way" from the core so imho it's not matter of WHERE much more of "WHAT" we need to store/retriieve |
Beta Was this translation helpful? Give feedback.
-
Using your reasoning, we should store field content to "destination tables", so if it's a field linked to Category, you have the field content in the categories table, if you have a field for contacts, you have the content stored in the contact table. |
Beta Was this translation helpful? Give feedback.
-
Today
The current database structure for custom fields is
#__field_values has three fields
field_id ->what type of field is it links to #__fields
item_id->which article is this for
value -> content of the field
This has several well known limitations
Tomorrow
This idea is just an idea. I don't know if its feasible but it sounds like it should be.
When you create a field is would still save the field structure in #__fields
BUT and this is the critical part
When you create the field it also adds a field to the #__content table
So now the field data is stored inside the content item. This would immediately resolve the 4 limitations above.
Backwards compatibility
Probably zero
but you could easily have a script that would add the fields to #__content and then move the data from #__field_values
Beta Was this translation helpful? Give feedback.
All reactions