Sie sind auf Seite 1von 8

Joomla 1.

5 Entity Relationship Diagram


Based on Joomla 1.5.6
Copyright 2008, Jason A. Luttrell.
Also incorporates some elements from a diagram by Torkil Johnsen.

Revision History
Revision Date

Author

Description of Change

0.5

04/30/2006

Torkil Johnsen

Created an ER diagram for Joomla 1.5

1.0

8/27/2008

Jason Luttrell

Created an Entity Relationship Diagram


independently, but incorporated some concepts
from Johnsens. Updated for Joomla 1.5.6.

Copyright Notice
Since I was not a contributor in Joomla's development, and would not, therefore,
understand all the decisions involved in the database's design, I suspect that there may be
one or two mistakes in the schema that I developed. Thus, I compared mine with others,
such as Torkil Johnsens. However, since it appears that there are no current schemas, I
have made mine available here for public use and/or modifications, as long as you cite
me as the author. Although I have decided to share this, it took awhile to create this
version, so I would appreciate getting some credit for my work.
Please refer to the Creative Commons Attribution-Noncommercial-share Alike
license: http://creativecommons.org/licenses/by-nc-sa/3.0/us/
You are free to share and make derivatives (i.e. corrections or updates), as long as you
include the above Revision History, attribute the aforementioned contributors as authors,
you do not use it for commercial purposes, and you freely share the document.
If you re-post this to the Web, a reference to this copyright notice must appear with the
document.

Revision 1.0

Based on Joomla 1.5.6

Last update: 8/27/2008

Notes on the Entity Relationship Diagram


There are problems with the Joomla database schema that originate with the design of
Joomla's database. A problem with the database is that it evolved slowly over time and,
with many hands in the pot, incremental changes left a lot to be desired.
Unfortunately, there are many instances in which the column names and data types do not
match up, which confuses the ER diagramming software that I used. This also makes it
difficult to guess what are supposed to be the connections between table columns.
Therefore, I made some notations on the ER diagram itself, indicating where they do not
match exactly.
If I could make corrections myself, I would enforce a better naming convention for
columns. Instead of primary keys like id I would use table_name_pk, and make sure that
the same name is used between tables. The column name, table_name_pk, would
correspond with table_name_fk; that way, there's no question which foreign keys are
associated with a primary key.
Take, for example, the jos_banner and jos_bannertrack tables. Instead of bid as a
primary key in one table and banner_id as a foreign key in another, I would use
banner_pk and banner_fk respectively. Unfortunately, without using clear naming
conventions, it is confusing trying to reverse engineer a schema from the current database
setup.
Also, I would make sure that the same data type is used for primary and foreign keys.
Instead of having, for example, bid (the banner primary key) with a data type of
INT(11) and banner_id (the banner foreign key) with a data type of INT(10), I
would make sure that banner_pk and banner_fk are both of the same data type,
INT(11).
Furthermore, it appears that the data types for some foreign keys were chosen incorrectly.
For example, refer to the section_value foreign key in the
jos_core_acl_groups_aro_map table. Rather than performing lookups on a table using a
column with a data type of VARCHAR(230), it would be faster and more efficient to use
an integer-based artificial key. (In fact, in this particular case, I believe the wrong column
is used as a foreign key. The jos_core_acl_aro_sections table has an integer-based
artificial key, the id column, but it is not referenced to as a foreign key; the value column
is used instead.)
Lastly, it appears that one table is completely deprecated: jos_core_acl_aro_map. The
table may have been replaced by jos_core_acl_groups_aro_map. The reasons I suspect
this is based on clues from older ER diagrams, the similarities in names and columns
between the two tables, and because the former table is not populated by sample data in a
fresh install, nor is data ever stored there later.

Revision 1.0

Based on Joomla 1.5.6

Last update: 8/27/2008

1
Content
jos_content_frontpage
content_id: INT(11) (FK)
ordering: INT(11)

jos_content
id: INT(11) (FK)

content is assigned
to the front page

title: VARCHAR(255)

jos_content_rating

alias: VARCHAR(255)

content_id: INT(11) (FK)

title_alias: VARCHAR(255)

rating_sum: INT(11)

introtext: MEDIUMTEXT

rating_count: INT(11)

fulltext: MEDIUMTEXT

lastip: VARCHAR(50)
content is
given a rating

state: TINYINT(3)
sectionid: INT(11) (FK)

jos_sections

mask: INT(11)
catid: INT(11) (FK)
created: DATETIME

id: INT(11)
content item can
have a parent item

title: VARCHAR(255)
name: VARCHAR(255)

created_by: INT(11)

alias: VARCHAR(255)

created_by_alias: VARCHAR(255)

image: TEXT

modified: DATETIME

scope: VARCHAR(50)

modified_by: INT(11)

image_position: VARCHAR(30)

checked_out: INT(11)

description: TEXT

checked_out_time: DATETIME

published: TINYINT(1)

publish_up: DATETIME
content belongs
in a section

publish_down: DATETIME
images: TEXT

checked_out: INT(11)
checked_out_time: DATETIME
ordering: INT(11)

urls: TEXT

access: TINYINT(3)

attribs: TEXT

count: INT(11)

version: INT(11)

params: TEXT

parentid: INT(11) (FK)


ordering: INT(11)
metakey: TEXT

categories are
assigned to a section

metadesc: TEXT
access: INT(11) (FK)

jos_categories

hits: INT(11)

id: INT(11)

metadata: TEXT

parent_id: INT(11) (FK)


title: VARCHAR(255)
name: VARCHAR(255)
content is assigned
to a category

alias: VARCHAR(255)

categories can have


parent categories

image: VARCHAR(255)
section: INT(11) (FK)
image_position: VARCHAR(30)
description: TEXT

weblinks belong
in a category

published: TINYINT(1)
checked_out: INT(11)
content item is
created by user

checked_out_time: DATETIME

contacts belong
in a category

editor: VARCHAR(50)
ordering: INT(11)
access: TINYINT(3)

content is
mod. by user

count: INT(11)
content is assigned
to an access group

params: TEXT
section is now VARCHAR(50)

newsfeeds belong
in a category

2
Application Elements
jos_components
id: INT(11)
name: VARCHAR(50)

jos_modules

link: VARCHAR(255)

id: INT(11)

menuid: INT(11) (FK)

title: TEXT

parent: INT(11) (FK)

content: TEXT

admin_menu_link: VARCHAR(255)

ordering: INT(11)

components can belong


to a parent component

admin_menu_alt: VARCHAR(255)

position: VARCHAR(50)

option: VARCHAR(50)

checked_out: INT(11)
checked_out_time: DATETIME

ordering: INT(11)
admin_menu_img: VARCHAR(255)

published: TINYINT(1)
module: VARCHAR(50)
numnews: INT(11)
access: TINYINT(3)

jos_plugins

iscore: TINYINT(4)

id: INT(11)

params: TEXT

name: VARCHAR(100)

enabled: TINYINT(4)

element: VARCHAR(100)
folder: VARCHAR(100)

showtitle: TINYINT(3)

access: TINYINT(3)

params: TEXT

ordering: INT(11)

iscore: TINYINT(4)
client_id: TINYINT(4)

published: TINYINT(3)

components are
assigned to a menu

control: TEXT

iscore: TINYINT(3)
client_id: TINYINT(3)
menus are part
of a component

module is assigned
to menus

checked_out: INT(11)
checked_out_time: DATETIME
params: TEXT

Menus & Navigation


jos_menu

jos_migration_backlinks
itemid: INT(11)

id: INT(11)

jos_modules_menu
moduleid: INT(11) (FK)

menutype: VARCHAR(75) (FK)

menuid: INT(11) (FK)

name: VARCHAR(255)
menu is assigned
to modules

sefurl: TEXT
newurl: TEXT

link: TEXT

published: TINYINT(1)

jos_menu_types

url: TEXT

alias: VARCHAR(255)

type: VARCHAR(50)
ID is the PK

name: VARCHAR(100)

menus can have a


parent menu itema

parent: INT(11) (FK)

menutype: VARCHAR(75)

componentid: INT(11) (FK)

id: INT(10)

sublevel: INT(11)

template: VARCHAR(255)

title: VARCHAR(255)

ordering: INT(11)

menuid: INT(11) (FK)

description: VARCHAR(255)

checked_out: INT(11)

client_id: TINYINT(4)

menus have
a type

checked_out_time: DATETIME
pollid: INT(11)
browserNav: TINYINT(4)

jos_templates_menu

a menu is
assigned
to templates

access: TINYINT(3)
utaccess: TINYINT(3)
params: TEXT
lft: INT(11)
rgt: INT(11)
home: INT(1)

menu items are


assigned to polls

3
Statistics

jos_core_log_items
time_stamp: DATE
item_table: VARCHAR(50)
item_id: INT(11)
hits: INT(11)

jos_core_log_searches
search_term: VARCHAR(128)
hits: INT(11)

jos_stats_agents
agent: VARCHAR(255)
type : TINYINT(1)
hits: INT(11)

THIRD-PARTY COMPONENTS
Some Joomla extensions
require additional tables.
This space here is reserved
for such add-on tables.

JOOMLA ENTITY RELATIONSHIP DIAGRAM


Based on: Joomla 1.5.6
Date created: August 27, 2008
Copyright (c) 2008, Jason A Luttrell.
Also incorporates some elements
from a diagram by Torkil Johnsen.

7
User Management
jos_session
content item is
created by user

session_id: VARCHAR(200)

content is
mod. by user

userid: INT(11) (FK)


username: VARCHAR(150)
sessions belong
to a user

jos_users

time: VARCHAR(14)
guest: TINYINT(4)

id: INT(11)

usertype: VARCHAR(50)

name: VARCHAR(255)

gid: TINYINT(3) (FK)

contact details
are assigned
to a user

username: VARCHAR(150)
email: VARCHAR(100)

client_id: TINYINT(3)
data: LONGTEXT

password: VARCHAR(100)
usertype: VARCHAR(25)
messages are
sent from a user

block: TINYINT(4)
sendEmail: TINYINT(4)
gid: TINYINT(3) (FK)

messages are
sent to a user

registerDate: DATETIME
lastvisitDate: DATETIME

message config is
assigned to a user

activation: VARCHAR(100)
params: TEXT

jos_groups

users belong
to a group

id: TINYINT(3)
name: VARCHAR(50)

user assigned
to sections

jos_core_acl_aro_groups

jos_core_acl_aro

id: INT(11)

id: INT(11) (FK)

groups can belong


to a parent group

parent_id: INT(11) (FK)

section_value: VARCHAR(240) (FK)

name: VARCHAR(255)

value: VARCHAR(240)

lft: INT(11)

order_value: INT(11)

rgt: INT(11)

name: VARCHAR(255)

value: VARCHAR(255)

hidden: INT(11)
The value is a User ID.

section assigned
users

mappings are
assigned
to a group
mappings are
associated
with acl aro

jos_core_acl_aro_sections

jos_core_acl_groups_aro_map

value: VARCHAR(240)
id: INT(11)
order_value: INT(11)
name: VARCHAR(230)

aro_id: INT(11) (FK)


mappings are
assigned
to a section

section_value: VARCHAR(240) (FK)


group_id: INT(11) (FK)

hidden: INT(11)
The id column is the
"real" PK, as installed by
Joomla. However, the
value column is used
instead. Also, for some
reason, the value column
is VARCHAR(230).

jos_core_acl_aro_map
acl_id: INT(11)
section_value: VARCHAR(230)
value: VARCHAR(100)
This appears to be a
deprecated table.

8
Built-In Components
weblinks
belong to a
category

jos_contact_details
id: INT(11) (FK)
name: VARCHAR(255)

jos_weblinks

alias: VARCHAR(255)

id: INT(11)

con_position: VARCHAR(255)

catid: INT(11) (FK)

address: TEXT

sid: INT(11)

suburb: VARCHAR(100)

title: VARCHAR(250)

state: VARCHAR(100)

alias: VARCHAR(255)

contact details
belong to a
category

url: VARCHAR(250)
description: TEXT

country: VARCHAR(100)
postcode: VARCHAR(100)
telephone: VARCHAR(255)

date: DATETIME

fax: VARCHAR(255)

hits: INT(11)

misc: MEDIUMTEXT

published: TINYINT(1)

image: VARCHAR(255)

checked_out: INT(11)

imagepos: VARCHAR(20)

checked_out_time: DATETIME

email_to: VARCHAR(255)

ordering: INT(11)

default_con: TINYINT(1)

archived: TINYINT(1)

contact details
are assigned
to a user

approved: TINYINT(1)
params: TEXT

published: TINYINT(1)
checked_out: INT(11)
checked_out_time: DATETIME
ordering: INT(11)
params: TEXT

jos_newsfeeds

newsfeeds
belong to a
category

id: INT(11)

user_id: INT(11)

catid: INT(11) (FK)

catid: INT(11) (FK)

name: TEXT

access: TINYINT(3)

alias: VARCHAR(255)

mobile: VARCHAR(255)

link: TEXT

webpage: VARCHAR(255)

filename: VARCHAR(200)
published: TINYINT(1)
numarticles: INT(11)
cache_time: INT(11)
checked_out: TINYINT(3)
checked_out_time: DATETIME
ordering: INT(11)
jos_messages

rtl: TINYINT(4)

message_id: INT(10)
user_id_to: INT(11) (FK)

messages are
from a user

user_id_from: INT(11) (FK)


folder_id: INT(10)
date_time: DATETIME

messages are
sent to a user

state: INT(11)
priority: INT(1)

message configuration
settings are assigned
to a user

subject: TEXT
message: TEXT

jos_messages_cfg
user_id: INT(11) (FK)
cfg_name: VARCHAR(100)
cfg_value: VARCHAR(255)

For some reason,


the user_id is INT(10).

For some reason, the


user_id_from and
user_id_to were changed
to INT(10).

9
Built-In Components (continued)
jos_polls
id: INT(11)
title: VARCHAR(255)

menu items are


assigned to polls

alias: VARCHAR(255)
voters: INT(9)

a poll is assigned
to menu items

checked_out: INT(11)

jos_poll_menu

checked_out_time: DATETIME

pollid: INT(11) (FK)

published: TINYINT(1)

menuid: INT(11) (FK)

access: INT(11)
lag: INT(11)
dates are
assigned
to a poll
data is stored
for a poll

jos_poll_date
id: BIGINT(20)
date: DATETIME
vote_id: INT(11)

jos_poll_data

poll_id: INT(11) (FK)

id: INT(11)
pollid: INT(11) (FK)
text: TEXT
hits: INT(11)

jos_banner
bid: INT(11)
cid: INT(11) (FK)
type: VARCHAR(30)
name: VARCHAR(255)
alias: VARCHAR(255)
imptotal: INT(11)
impmade: INT(11)

jos_bannerclient

clicks: INT(11)
imageurl: VARCHAR(100)
clickurl: VARCHAR(200)

cid: INT(11)
banner belongs
to a client

name: VARCHAR(255)
contact: VARCHAR(255)

date: DATETIME

email: VARCHAR(255)

showBanner: TINYINT(1)

extrainfo: TEXT

checked_out: TINYINT(1)

checked_out: TINYINT(1)

checked_out_time: DATETIME

checked_out_time: TIME

editor: VARCHAR(50)

editor: VARCHAR(50)

custombannercode: TEXT
catid: INT(10)
description: TEXT
sticky: TINYINT(1)

data is tracked
for a banner
jos_bannertrack

ordering: INT(11)

track_date: DATE

publish_up: DATETIME

track_type: INT(10)

publish_down: DATETIME

banner_id: INT(11) (FK)

tags: TEXT
params: TEXT

For some reason, the


banner_ID was changed
to INT(10).