karlomikus / bar-assistant

Bar assistant is a all-in-one solution for managing your home bar
https://barassistant.app
MIT License
442 stars 22 forks source link

Updating the custom URL for a Bar #295

Open proffalken opened 2 weeks ago

proffalken commented 2 weeks ago

Describe the bug I have renamed my bar and want to update the custom URL without having to create a new bar and re-add all the ingredients

To Reproduce

  1. Create a new bar and call it "foo's palace"
  2. Go to the bar settings and check that the bar custom URI is http://my.install/bars/foos-palace
  3. Change the name of the bar to "Bar's Bar"
  4. Observe that the custom URI remains http://my.install/bars/foos-palace

Versions:

karlomikus commented 2 weeks ago

This was intended behavior when I implemented it but I don't remember why exactly :D

I'll re-check it out once more

proffalken commented 5 days ago

Thanks - is there a command I can run against the database to update it in the meantime?

karlomikus commented 5 days ago

You can use the following sql:

docker compose exec bar-assistant sqlite3 storage/bar-assistant/database.ba3.sqlite "update bars set slug = 'my-new-slug' where slug = 'my-old-slug'"
proffalken commented 5 days ago

Amazing thanks!