简体   繁体   English

TYPO3 的数据库 - 表之间是否存在关系?

[英]Database of TYPO3 - Is there a relation between tables?

I don't have much knowledge about a database of TYPO3.我对 TYPO3 的数据库了解不多。 So I have a question.所以我有一个问题。

Has a database of TYPO3 some relation between tables? TYPO3 的数据库有一些表之间的关系吗?

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.因此,如果我使用 phpMyAdmin 检查它,我无法在我的数据库中的其他任何地方找到关系。 Does it mean that all tables are independent and the tables are searched just using index?这是否意味着所有表都是独立的,并且仅使用索引来搜索表? Is it a so-called b-tree?是不是所谓的b-tree?

If I create a diagramm of "database model" using these tables: pages , tt_content , be_users and fe_group , how can I give a relation in a diagramm?如果我使用以下表格创建“数据库模型”图表: pagestt_contentbe_usersfe_group ,我如何在图表中给出关系? 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.表 pages 和 be_users 有 m:n 关系,所以 fe_froups 和 pages 有 1:n 并且 fe_groups 和 be_users 有 1:n 关系。 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.要了解关系,您需要了解 TYPO3 的 TCA,它定义了在数据处理程序中处理的关系类型,并显示在使编辑器能够管理关系的表单处理程序中。

there are some relations which exists for (nearly) every record in TYPO3: TYPO3 中的(几乎)每条记录都存在一些关系:

Each record has some fields with basic relations:每条记录都有一些具有基本关系的字段:
pid = parent/page Id = the page (table: pages ) where a record is stored pid = parent/page Id = 存储记录的页面(表: pages
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 uid = 唯一 ID = 记录的唯一标识,它是与该记录的关系的参考

If you have activated versioning or language support you get further fields as they identify variants of that record and contain a reference to the original (relations to the same table)如果您已激活versioninglanguage support ,您将获得更多字段,因为它们标识该记录的变体并包含对original的引用(与同一表的关系)

These fields mostly are single valued which enables it to store just an int.这些字段大多是单值的,这使得它可以只存储一个 int。 but also there are m:n-relations.但也有 m:n 关系。 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.在旧版本中,它们存储在一个用逗号分隔的整数的字符串中,但今天它们大多存储在一个 mm 表中,该表在两个不同的记录之间建立了连接。
For identification in those records remains an int field which holds the count of relations.对于这些记录中的标识,仍然是一个包含关系计数的 int 字段。 in this way the diagram of the core tables (which are more than 40) and their relations would be very large.这样,核心表(超过 40 个)及其关系的图表将非常大。

regarding the tables you mentioned:关于您提到的表格:
pages builds the elemetary page tree tt_content contains the basic content visible on the website pages构建基本页面树tt_content包含网站上可见的基本内容

(be_? = BackEnd-?, fe_? = FrontEnd-?) (be_? = BackEnd-?, fe_? = FrontEnd-?)
be_users holds 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. be_users保存有关使用 TYPO3 的编辑器的数据(用户可以访问 TYPO 中的哪种信息的权限管理),还有日志记录,每条记录都包含一个由 be_user 创建的(关系)字段。

The access-rights can be stored in the be_users record, but mostly they are stored in be_groups which are related to be_users and so the be_user inherited all the rights from the be_groups.访问权限可以存储在be_users记录中,但主要存储在与be_groups相关的be_users ,因此 be_user 继承了 be_groups 的所有权限。

In the same way there exist a pair for the frontend: fe_users fe_groups .同样,前端也存在一对: fe_users fe_groups The fe_groups can 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) fe_groups可以分配给记录,因此可以控制前端的可见性(只有登录该组的成员才能看到信息)

In this way there are relations from fe_groups to pages and tt_content .这样就存在从fe_groupspagestt_content的关系。 more lines in your diagram of those few tables.在这几张表格的图表中添加更多线条。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM