Foren

Deleting the threads manually

praveen orvakanti, geändert vor 12 Jahren.

Deleting the threads manually

Junior Member Beiträge: 51 Beitrittsdatum: 10.08.11 Neueste Beiträge
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
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: Deleting the threads manually

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
never modify the database directly. Only go through the Liferay API.
praveen orvakanti, geändert vor 12 Jahren.

RE: Deleting the threads manually

Junior Member Beiträge: 51 Beitrittsdatum: 10.08.11 Neueste Beiträge
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?
thumbnail
David H Nebinger, geändert vor 12 Jahren.

RE: Deleting the threads manually

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
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...
thumbnail
Hitoshi Ozawa, geändert vor 12 Jahren.

RE: Deleting the threads manually

Liferay Legend Beiträge: 7942 Beitrittsdatum: 24.03.10 Neueste Beiträge
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.