Board look Amber Blue Moon Futaba Headline Pseud0ch Toothpaste
Admin Manage

removing categories? (2)

1 Name: calle 2005-01-21 09:43 ID:MpTS2i9y [Del]

am i really daft or is there no way of doing this?

2 Name: h3!h3//z2E0hc 2005-01-21 11:58 ID:rxsrEpo7 [Del]

Nope. Administrative mistakes are not allowed.

Err... deletes are always tricky when you are using foreign keys, doubly so in ochiba because it's sqlite and I'm kinda fudging things. It's not so bad if you have FEATURE_MULTIPLE_CATEGORY set to false, since the images.category column will only have single values.

The easiest way is to first recategorize any images in the target category to something else, then delete the category. So, something like:

sqlite> update images set category='/other/' where category='/deleteme/';
sqlite> delete from categories where abbr='deleteme';

If you don't have shell or don't have sqlite access, then you can wrap the above statements into a PHP file, upload it, then "open" it. Something like:

<?php
require("conf.php");
$db = sqlite_open(DB);
sqlite_exec("update blah..");
sqlite_exec("delete blah...");
?>

Backup your sqlite database file first!

If you wanted images in those categories to also be deleted, you then have to manually delete delete them.

If you had multiple categories, then... well things are more complicated. But the above would still have worked; you just have "dangling" category entries.

I put category deletion and administrative thread deletions on the to-do list.

Name: E-mail: