!!Wiclear database schema
((wiclear-schema.png|schema))
Here's the current schema.
I'll call a 'master content' a content written in the main language of the wiki.%%%
Those nodes are special as they are the one which define the parent relationship in the wiki.%%%
They are also referenced in the translation table.
!table wc_lang
Contains lang declared in the wiki.
!table wc_user
Contains users that have registered in the wiki.%%%
User id '1' is a special user. This is the anonymous user.
!table wc_groups
Contains the group created by administrators via admin panel.%%%
Groups enables the creation of ACL.
!table wc_user_group
Contains the list of user per group
!table wc_content
Contains the content of the wiki.%%%
Content id '1' is a special node. this is the root of the wiki.
!table wc_content_group
Contains the group authorized to edit a particular content.%%%
This is the ACL table.
!table wc_content_user_email
Contains the user that watch a content.%%%
This is the notification table.
!table wc_comment
contains the comment associated to a content.
!table wc_history
Contains the history
!table wc_content_hierarchy
Defines the relationship between the content.%%%
Only 'master content' get an entry there. Translations do not get one because they are linked to the translation.%%%
parent_content_fk/content_fk creates a parent relationship.%%%
(left_n/right_n) forms the nested set model. They get computed from the parent relationship and are here only to speed up recursive operations.
Basically, if you draw a tree like structure and perform a depth first tree exploration, with initially an integer n set to zero, then :
* left_n is set to 'n' before performing the depth first tree exploration, n is incremented
* each time you reach a leaf you set left_n=n, you increment n, you set right_n=n and you increment n
* right_n is set to n after having performed depth first tree exploration, n is incremented
!table wc_content_lang
Defines that content_fk is related to related_content_fk.%%%
It defines the translation available.%%%
A 'master content' get an entry as well with content_fk=related_content_fk.%%%

