Opened 9 years ago

Closed 9 years ago

#824 closed enhancement (fixed)

Delete an element with cli/gmg

Reported by: janssen Owned by:
Priority: major Milestone: 0.7.0
Component: programming Keywords: delete, cli, bitesized
Cc: Parent Tickets:

Description

It would be nice, if elements (let’s say pictures) could be delete over a gmg command (or another cli command).

It happend, that i uploadad a picture, which could not be displayed (working on that, if it’s a bug, i’ll report that one later). so i cannot display the pictures. the problem is, i can only delete it, when i can display it.

an option would be great or even necessary.

Subtickets

Change History (7)

comment:1 Changed 9 years ago by janssen

+ how can i delete this picture now?

comment:2 in reply to:  1 Changed 9 years ago by saul

Replying to janssen:

+ how can i delete this picture now?

This may not be the best way, but it is how I've done it in the past.

Make a backup of your mediagoblin.db file. Then open the file with sqlite3 (running interactively).

sqlite3 mediagoblin.db

Then enter the following commands, substituting the ID number of the media for the ###s.

delete from core__collection_items where media_entry=###;
delete from core__comment_subscriptions where media_entry_id=###;
delete from core__media_comments where media_entry=###;
delete from core__media_entries where id=###;
delete from core__media_tags where media_entry=###;
delete from core__mediafiles where media_entry=###;
delete from image__mediadata where media_entry=###;

comment:3 Changed 9 years ago by Christopher Allan Webber

This would be pretty easy-ish to do probably. But not quite bitesized.

We already have media deletion code from the views point of view; adding that to a gmg command shouldn't be too hard.

comment:4 Changed 9 years ago by Christopher Allan Webber

Keywords: bitesized added

I'm not sure how bitesized this is, but it's bitesized *enough* to mark it I guess :)

comment:5 Changed 9 years ago by berkerpeksag

Status: newreview

comment:6 Changed 9 years ago by janssen

--> sorry, was supposed to #825

Last edited 9 years ago by janssen (previous) (diff)

comment:7 Changed 9 years ago by Christopher Allan Webber

Resolution: fixed
Status: reviewclosed

Looks great. Merged!

Note: See TracTickets for help on using tickets.