mirror of
https://github.com/teslamate-org/teslamate.git
synced 2026-01-24 21:06:08 +08:00
@@ -71,6 +71,7 @@ The full TeslaMate documentation is available on [Read the Docs](https://teslama
|
||||
- [Environment Variables](https://teslamate.readthedocs.io/en/latest/configuration/environment_variables.html)
|
||||
- Maintenance
|
||||
- [Backup and Restore](https://teslamate.readthedocs.io/en/latest/maintenance/backup_restore.html)
|
||||
- [Manually fixing data](https://teslamate.readthedocs.io/en/latest/maintenance/manually_fixing_data.html)
|
||||
- Development and Contributing
|
||||
- [Development](https://teslamate.readthedocs.io/en/latest/development.html)
|
||||
|
||||
|
||||
@@ -41,6 +41,7 @@ A powerful, self-hosted data logger for your Tesla.
|
||||
:caption: Maintenance
|
||||
|
||||
maintenance/backup_restore.md
|
||||
maintenance/manually_fixing_data.md
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 1
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
# Manually fixing data
|
||||
|
||||
## Docker: Connect to the database container
|
||||
|
||||
When using TeslaMate with Docker, you must first connect to the **running** database container before queries can be executed.
|
||||
|
||||
```bash
|
||||
docker-compose exec database psql teslamate teslamate
|
||||
```
|
||||
|
||||
## Delete a specific drive
|
||||
|
||||
If for some reason a drive was recorded incorrectly, you can delete it manually.
|
||||
|
||||
First you need to find out the ID of the drive you want to delete:
|
||||
|
||||
- Open the `Drives` dashboard and click on the start date of the drive.
|
||||
- The URL will contain the drive id, for example `&var-drive_id=9999`.
|
||||
|
||||
Afterwards run the following query:
|
||||
|
||||
```sql
|
||||
BEGIN;
|
||||
UPDATE drives SET start_position_id = NULL, end_position_id = NULL WHERE id = 9999;
|
||||
DELETE FROM positions WHERE drive_id = 9999;
|
||||
DELETE FROM drives WHERE id = 9999;
|
||||
COMMIT;
|
||||
```
|
||||
Reference in New Issue
Block a user