Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
praveen orvakanti
Deleting the threads manually
April 19, 2012 11:11 AM
Answer

praveen orvakanti

Rank: Junior Member

Posts: 51

Join Date: August 10, 2011

Recent Posts

Hi All,
If i want to delete all the threads that i have created through "Forums" in the Liferay, What all tables do i need to touch? I reckon MBThreads, MBMessages and MBCategory as the three tables that would need to be cleared. Is there any other table that i ve missed? Is there any right order that i need to keep in mind?

I know that i could delete them through the UI, but i have got a really large number of threads. Im just a Liferay Beginner so im in "Testing" phase emoticon
David H Nebinger
RE: Deleting the threads manually
April 19, 2012 12:12 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11770

Join Date: September 1, 2006

Recent Posts

never modify the database directly. Only go through the Liferay API.
praveen orvakanti
RE: Deleting the threads manually
April 20, 2012 2:36 AM
Answer

praveen orvakanti

Rank: Junior Member

Posts: 51

Join Date: August 10, 2011

Recent Posts

I understand David,
But there are a lot many threads which would take like forever. Moreover this exercise might help in understanding the DB better right?
David H Nebinger
RE: Deleting the threads manually
April 20, 2012 5:30 AM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11770

Join Date: September 1, 2006

Recent Posts

No, you should not understand the DB at all.

I know it sounds like a hard line to take, but the issue is that people (developers) think "Oh, I can just do that in the database and not worry about the API". Liferay, however, gets very tricky with how the database is used. Sometimes an ID is not what it says it is, sometimes it's referenced somewhere else (as an unmanaged foreign key so no DB enforcement when it comes to deletes), sometimes data is buried within XML, sometimes it's also in the lucene indices, ...

The only place all of these issues is managed is in the API. As soon as you start back-dooring changes, you're going to break your system because of one or more of these things...
Hitoshi Ozawa
RE: Deleting the threads manually
April 21, 2012 8:28 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

If you're just interesting in "testing", there's actually no need to post here. Just do it and see the results yourself. You'll understand the database better doing it yourself.