Teslamate: Question: Removing vehicle from database

Created on 10 May 2020  路  2Comments  路  Source: adriankumpf/teslamate

I had been using Teslamate with 2 cars in my account. Got rid of one of the cars. Is it possible / how do I remove that car from the database?

question solved

Most helpful comment

Easiest way is to run docker exec -it database psql -U teslamate -W teslamate
then just do a select * from cars; and find your old car... look at the id and then do a delete from cars where id = #replacing # /w the right car id.

All 2 comments

Easiest way is to run docker exec -it database psql -U teslamate -W teslamate
then just do a select * from cars; and find your old car... look at the id and then do a delete from cars where id = #replacing # /w the right car id.

Note that if you only delete the rows in the cars table, you'll run into internal errors when visiting TeslaMate's settings page. To fix this, run:

DELETE FROM car_settings WHERE id = 1234;

(where 1234 is the ID removed from the cars table).

To summarize:

docker exec -it my_database_container psql -U teslamate -W teslamate
SELECT id, vin FROM cars;
 id |        vin
----+-------------------
  1 | 5YJ3E1EA2HF123456
  2 | 5YJYGDEF7LF456789
(2 rows)

Assuming 5YJ3E1EA2HF123456 must be removed:

DELETE FROM cars WHERE id = 1;
DELETE FROM car_settings WHERE id = 1;

(Could we get a UI option? :))

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Try2Fly picture Try2Fly  路  5Comments

jun3280net picture jun3280net  路  4Comments

virtualm2000 picture virtualm2000  路  4Comments

spacecosmos picture spacecosmos  路  5Comments

tobiasehlert picture tobiasehlert  路  4Comments