Brewtarget / brewtarget

Main brewtarget source code repository.
GNU General Public License v3.0
313 stars 135 forks source link

Brewtarget asks to migrate db from vers 9 to version 13 even if no previous DB is there #834

Open bebenlebricolo opened 3 days ago

bebenlebricolo commented 3 days ago

Seems like brewtarget warns about Old DB migration even when there is nothing in the config folder.

Config

Repro works on a Linux machine Fresh install of brewtarget Tested on commit Merge pull request #830 from matty0ung/usability.

Exact popup Message is :

"Before continuing, Brewtarget 4.0.4 needs to upgrade your database schema (from v9 to v13)."

Reprosteps

  1. rm -rf ~/.config/brewtarget -- gets rid of everything in the .config/brewtarget folder
  2. Open brewtarget
  3. BT will show the DB migration popup. image

It seems to be the default handling of "no database" ; which in this case should instead copy the default database in the ~/.config folder and shouldn't warn about it (normal behavior for first Brewtarget use).

By the way, the database created seems to be the exact same one : image

Note : I straced brewtarget in order to see if there were any other locations for the DB to be taken from, and it seems it's only the default_db being duplicated. Maybe I overlooked something, I haven't looked into the codebase yet :smile: .

matty0ung commented 3 days ago

Ah, yes, you are right - I did not update the default database. This is partly because I forgot and partly because I intended at one point to have a new install of the program create the database from scratch and then read in all the "default" data from BeerXML/BeerJSON.

Current behaviour is "harmless" in the sense that it doesn't break anything, but it's probably a bit off-putting to new users, so I'll fix it.

bebenlebricolo commented 3 days ago

No problem, thanks @matty0ung !