-
-
Notifications
You must be signed in to change notification settings - Fork 90
Reset or edit the databases
Daniel Tischner edited this page Feb 11, 2022
·
7 revisions
In order to reset of edit the databases used by the bot, one has to login to the VPS and navigate to the corresponding directory. Only members of the Moderator-Team can do the following steps.
See Access the VPS for details of the login process.
-
ssh togetherjava
to login to the VPS - Consider temporarilly shutting down the bot during the database edits (see Shutdown or restart the bot)
- Either
cd /var/lib/docker/volumes/tj-bot-master-database/_data
orcd /var/lib/docker/volumes/tj-bot-develop-database/_data
to go to the directory of the corresponding database - Edit the database manually, it is a SQLite 3 database.
To ease inspecting and editing the database, the sqlite3
CLI is installed on the VPS.
Please make sure to either shut down the bot in the meantime or working on a copy of the database instead, to avoid locking the actual database:
cp database.db database_copy.db
Here are some simple example queries:
- Connect to the database
sqlite3 database_copy.db
- List all available tables:
.tables
- Show the structure of the table
.schema moderation_actions
- Show all against against a user
SELECT * FROM moderation_actions WHERE author_id = 123456789
- Exist the database
.exit