mirror of
https://github.com/netfun2000/hipudding-teslamate.git
synced 2026-02-27 09:44:28 +08:00
Update docs to manually remove vehicle (#3075)
* Update docs to manually remove vehicle Entry added to document how to remove a vehicle from the database until a native solution is implemented. #3074 #2719 * Update manually_fixing_data.mdx
This commit is contained in:
@@ -100,3 +100,23 @@ If for some reason a drive or charge was recorded incorrectly, you can delete it
|
||||
|
||||
</TabItem>
|
||||
</Tabs>
|
||||
|
||||
## Remove a vehicle from the database
|
||||
**NOTE:** Always [backup](https://docs.teslamate.org/docs/maintenance/backup_restore "backup") your data before performing any database changes.
|
||||
|
||||
1. Connect to your TeslaMate database
|
||||
2. Identify the right car ID in the database to remove
|
||||
```
|
||||
SELECT id, vin FROM cars;
|
||||
```
|
||||
3. Based upon the output, run the following command replacing `num` with the ID from the previous command.
|
||||
```
|
||||
DELETE FROM cars WHERE id = num;
|
||||
DELETE FROM car_settings WHERE id = num;
|
||||
DELETE FROM charging_processes WHERE car_id = num;
|
||||
DELETE from charges WHERE charging_process_id in (select id from charging_processes where car_id = num);
|
||||
DELETE FROM drives WHERE car_id = num;
|
||||
DELETE FROM positions WHERE car_id = num;
|
||||
DELETE FROM states WHERE car_id = num;
|
||||
DELETE FROM updates WHERE car_id = num;
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user