Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Nicolas Forney
Database schema
July 13, 2011 1:38 AM
Answer

Nicolas Forney

Rank: Junior Member

Posts: 78

Join Date: May 23, 2011

Recent Posts

Hello folks,

For better understanding over Liferay structure, I would like to get a database diagram of every tables and associations.

Unfortunately foreign keys are not part of the database (Hibernate handles this). So, I'm only able to reverse-engineer tables from SQL file and not the associations (I'm using MySQL Workbench).
Is there any official document or anything else useful which can give me a better view of the database structure?

Thank you,

Regards
David H Nebinger
RE: Database schema
July 13, 2011 7:46 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11304

Join Date: September 1, 2006

Recent Posts

No, there's no doco available.

I've had discussions about this before, where I argue that foreign keys should always be used to ensure database integrity, and others argue that FKs are not necessary and limit the flexibility of the code.

I can tell you that even if you did have a complete data model, it's not going to give you the whole picture. LR stores a lot of XML in the database, and the XML itself controls portlet placement, contents, etc. None of this info would be exposed in the vanilla data model.
Nicolas Forney
RE: Database schema
July 13, 2011 8:49 AM
Answer

Nicolas Forney

Rank: Junior Member

Posts: 78

Join Date: May 23, 2011

Recent Posts

Hello David,

David H Nebinger:
No, there's no doco available.

I've had discussions about this before, where I argue that foreign keys should always be used to ensure database integrity, and others argue that FKs are not necessary and limit the flexibility of the code.

I have read your discussion about FKs and I'm about the same opinion. FKs are the last constraints available to ensure data consistency... However, it's another subject emoticon.

David H Nebinger:

I can tell you that even if you did have a complete data model, it's not going to give you the whole picture. LR stores a lot of XML in the database, and the XML itself controls portlet placement, contents, etc. None of this info would be exposed in the vanilla data model.

I'm not looking for a perfect picture of liferay structure. I'm just interested to get, at least, a few pieces helping me when developing plugins. For the moment, I will forget the data model one.

By the way, thank you for your reply.
Natasa Bulatovic
RE: Database schema
December 14, 2011 7:41 AM
Answer

Natasa Bulatovic

Rank: Junior Member

Posts: 28

Join Date: June 7, 2011

Recent Posts

as Nicolas mentions, there is no need to evaluate the design but to understand how data are organized.
A word or two on which portlets use which database tables, when and how, along with the portlet name would be indeed a benefit.
There is indeed no need to describe in details the complete database structure, as not all data portlets are used by everybody..

As for start, please provide some info how are comments stored and related to the subject of comment in the database? I am particularly interested about:
*comments on calender event, message boards, web content, wiki page etc.
*comments on comments
*how these relate to asset publisher and in which tables?
Nagendra Kumar Busam
RE: Database schema
December 14, 2011 10:16 AM
Answer

Nagendra Kumar Busam

Rank: Liferay Master

Posts: 653

Join Date: July 7, 2009

Recent Posts

I think you need to look into MBMessage table for comments related stuff in whole portal.
Hitoshi Ozawa
RE: Database schema
December 14, 2011 1:57 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Have you tried looking at service.xml using Liferay IDE's GUI?