Skip to content

Renaming a car? #1938

Answered by Kosta-Github
Kosta-Github asked this question in Q&A
Aug 28, 2021 · 6 comments · 1 reply
Discussion options

You must be logged in to vote

Just for closing the loop here: the SQL commands for renaming a car would be:

  1. list all cars in the DB:
    docker-compose exec -T database psql -U teslamate << .                            
        SELECT * FROM cars;
    .
    
  2. renaming one car from old_car_name to new_car_name:
    docker-compose exec -T database psql -U teslamate << .                            
        UPDATE cars SET name='new_car_name' WHERE name='old_car_name';
    .
    

Note, that database refers to the name of the DB service in your docker-compose config file; if you renamed this service, e.g., to teslamate-db, you would also need to use the corresponding service name here: docker-compose exec -T teslamate-db ...

Replies: 6 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@horst789github
Comment options

Answer selected by adriankumpf
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
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
Converted from issue

This discussion was converted from issue #1934 on August 30, 2021 09:22.