Database of TYPO3 - Is there a relation between tables?
I don't have much knowledge about a database of TYPO3. So I have a question.
Has a database of TYPO3 some relation between tables?
I can see a primary key and indexing my database, but there are no foreign key. So I can't find a relation anywhere else in my database, if I check it using phpMyAdmin. Does it mean that all tables are independent and the tables are searched just using index? Is it a so-called b-tree?
If I create a diagramm of "database model" using these tables:
fe_group, how can I give a relation in a diagramm? Is it just a line and no relation (Cardinality)?
Can I express so a diagramm with these relation, if I make a diagramm using tables of these four tables? The tables pages and be_users have m:n relation, so fe_froups and pages have 1:n and fe_groups and be_users have 1:n relation. Is that right?
And if I write a primary and foreign key, where should I write them in each tables? Or is it not possible in this case, maybe?
Thank you for your help.
There are a lot of relations, but most are not visible in the database.
for an understanding of the relations you need to understand the TCA of TYPO3 which defines the kind of relation, which is handled in the datahandler and which is shown in the formhandler which enables the editors to manage relations.
there are some relations which exists for (nearly) every record in TYPO3:
Each record has some fields with basic relations:
pid= parent/page Id = the page (table:
pages) where a record is stored
even pages are stored in pages and so a tree is build (similar to folders on your disk)
uid= unique ID = unique identification of a record and which is the reference for relations to this record
If you have activated
language supportyou get further fields as they identify variants of that record and contain a reference to the
original(relations to the same table)
These fields mostly are single valued which enables it to store just an int. but also there are m:n-relations. in older versions those were stored in a string with comma separated ints, but today they mostly are stored in a mm-table which builds the connection between two different records.
For identification in those records remains an int field which holds the count of relations. in this way the diagram of the core tables (which are more than 40) and their relations would be very large.
regarding the tables you mentioned:
pagesbuilds the elemetary page tree
tt_contentcontains the basic content visible on the website
(be_? = BackEnd-?, fe_? = FrontEnd-?)
be_usersholds the data about editors working with TYPO3 (there is a right management which user can access which kind of information in TYPO), there also is logging and each record contains a (relation) field which be_user created it.
The access-rights can be stored in the
be_usersrecord, but mostly they are stored in
be_groupswhich are related to
be_usersand so the be_user inherited all the rights from the be_groups.
In the same way there exist a pair for the frontend:
fe_groupscan be assigned to records and so the visibility in front end can be controlled (only logged in members of that group can see the information)
In this way there are relations from
tt_content. more lines in your diagram of those few tables.