Skip to content

Documentation - How should database table and column names be written #269

Open
@shoulders

Description

@shoulders

Table names

In the Joomla database all the table names are in snake_case and by the looks of this is how it will always be, However this is not in the Joomla Documentation anywhere, at least not that I have found and I think it should be added for clarity.

Column Names

Most column names in joomla and 3rd party extension are snake_case but some are camelCase/dromedaryCase.

There is no official documentation on how one should name a column including how and when column comments should be added. This should be added to the documentation so I know which style to use for my database.

One thing to watch out for in fixing the snake_case to camelCase naming, is some of those are long-standing names in the database architecture. There has been resistance to fixing those since it will break 3rd party extensions.
https://issues.joomla.org/tracker/joomla-cms/13415

This is exactly the why I need clarity for the table names.

On the first post under the 4. Parameter Variable name I have written a small worked example of this:

Params

On a related issue, how would this change the names/keys of variables in $params, should they follow the same syntax as the table names for consistency? this needs to be addressed at the same time. And why this matters is you tend to define all of these parameters in your extensions XML files and you might have direct table names and values from parameters being looked up.

I can expand on this if anyone wants any further info from me.

This issue came about when I was making my reference extensions and found these standards missing.

thanks

Other Database related info for the database documentation

  • I know that date fields should now use Null value rather than 000:00:00 00:00 see here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions