Skip to content

Remove Loaner Car #3074

Answered by natrlhy
natrlhy asked this question in Q&A
Jan 17, 2023 · 3 comments · 5 replies
Discussion options

You must be logged in to vote

Thanks @cwanja!
For reference I did the following:

SSH to pi@teslamate
In my case my ID I want to delete is id=6. Change based on your query results. Make sure to delete any car_settings ID's that don't map to a car you want to keep.

sudo -i
docker-compose exec database psql teslamate teslamate
SELECT id, vin FROM cars;
DELETE FROM cars WHERE id = 6;
SELECT * from car_settings;
SELECT id, settings_id, inserted_at, updated_at FROM cars;
DELETE FROM car_settings WHERE id = 3;
DELETE from charges WHERE charging_process_id in (select id from charging_processes where car_id = 6);
DELETE FROM charging_processes WHERE car_id = 6;
DELETE FROM drives WHERE car_id = 6;
DELETE FROM positions WHERE c…

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
5 replies
@cwanja
Comment options

@natrlhy
Comment options

@ednax
Comment options

@marcbaier
Comment options

@natrlhy
Comment options

Answer selected by natrlhy
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants