-
Notifications
You must be signed in to change notification settings - Fork 769
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document how a drive can be deleted manually
Closes #360
- Loading branch information
1 parent
0fdd0ad
commit a2c5a79
Showing
3 changed files
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
This comment has been minimized.
Sorry, something went wrong. |
||
``` | ||
|
||
## 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. | ||
This comment has been minimized.
Sorry, something went wrong. |
||
- 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; | ||
``` |
Per my comment in #360, this should be db. Again, per my install. I see that the YML files were updated. If I were to update, would my install bork?