Issue with un-deletable topic


(LoveDiscourse) #1

Hi,

I have an issue where I have a topic that for some reason isn’t linked anymore to a category and I can’t delete it anymore. (It’s the category definition).

I suppose I’ll need a manual intervention in postgre-sql can anyone help me with deleting this topic and it’s category?

Kr


(LoveDiscourse) #2

Found it out myself, in the rails console, just destroy the category object and the topic object. I do hope I didn’t corrupt the DB in any way?!

I executed:

Category.find(7).destroy
Topic.find(13).destroy

Is that ok?


(Jeff Atwood) #3

Did you delete the category? Category definition topics should never be deleted, because they contain… wait for it… the definition of the topic (and related discussion).

But if the category itself is deleted, why would the definition topic remain?


(LoveDiscourse) #4

@codinghorror

I didn’t delete anything, I created the category, and edited the category definition topic with some content.

Then when I check back (a bit later) the Category tag next to that topic disappeared, I tried adding it to any category but it never seemed to update.

So I tried to check if I could delete the topic and the category and recreate them, and both weren’t possible. I figured something must have gone wrong in the DB, so I tried using the Rails CLI to have a look around and then issued those two commands to get rid of both the topic and the category.

Did I do the correct thing with these two commands?
Category.find(7).destroy
Topic.find(13).destroy

Both the category and topic are gone now and I was able to recreate them, I just wanted to know if my DB is clean as well after those two commands or if there are going to be any ghost references…


(LoveDiscourse) #5

@codinghorror did you see my previous reply? Did I do the correct thing or did I break my install?


(Jeff Atwood) #6

As long as you didn’t somehow delete the category definition topic while leaving the category itself you should be fine.


(Jeff Atwood) #7