You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Well, shortly after opening this issue, I went to the hard/RAW approach. This project seems abandoned(?), so it's likely that no friendly method for editing and deleting entries will be incorporated here (at least not from the original developer).
Anyway, if you need to edit (or in this case, delete) an entry directly in the database, here is what I do:
First, get access to the docker shell, executing psql automatically:
# docker exec -u postgres -ti guestbook_db_1 psql
I assume you are using the root user (or your user have permission to access the docker directly), so if needed you can add "sudo" before the command.
Then, connect to the proper database:
# \c guestbook
Now that you are connected, you can list all of the guestbook entries/messages:
# SELECT * FROM entries;
It will provide a full list of the entries. Choose which one you want to delete from the guestbook, get its ID and use this number to delete the entry:
# DELETE FROM entries WHERE ID = X;
Replace "X" with the entry's ID you want to delete and...
You are done! Quit the database server and the docker sending a \q command.
PLUS
For editing an entry, when already connected to the database, you can send the following command:
UPDATE entries SET created = '2023-11-16 00:17:03.930071' WHERE ID = X;
Once again, replace "X" with your entry's ID. In this example, we are changing only the "created" column (the date in which a message was posted), but you can also edit "name", for changing the person's name who sent a message, and "comment" to edit the message itself, instead.
Hey there, how are you?
I found your solution and it works fine for me, but it seems to have no admin control or whatever.
Considering login-less is exposed to any harmful messages or SPAMs, how can I DELETE any entries if I need?
Thanks in advance!
The text was updated successfully, but these errors were encountered: