thilojaeggi / WinGetty

An open source REST Backend for creating a private WinGet Repo without having to rely on cloud dependencies.
https://wingetty.dev
GNU Affero General Public License v3.0
191 stars 18 forks source link

Upgrade from 0.0.2 to 0.0.3 hasn't seemed to run migrations for me #9

Closed ImNtReal closed 1 year ago

ImNtReal commented 1 year ago

I had 0.0.2 up and running on a Kubernetes cluster. When I restarted to upgrade to 0.0.3, I got this:

sqlalchemy.exc.OperationalError: (sqlite3.OperationalError) no such table: role
[SQL: SELECT role.id AS role_id, role.name AS role_name
FROM role
WHERE role.name = ?
 LIMIT ? OFFSET ?]
[parameters: ('admin', 1, 0)]

I'm thinking that maybe the migrations need to run. Is there a way to kick them manually?

To Reproduce Steps to reproduce the behavior:

  1. Get 0.0.2 up and running with just a SQLite database
  2. Shutdown the container
  3. Start it back with the 0.0.3 image
  4. See error

Expected behavior Database migrations should run, and make sure the databases are in the correct state.

General Information:

ImNtReal commented 1 year ago

Sorry if you're not interested in supporting running it this way at this point. If you do want to, I'll be happy to share the manifest I'm using to get it up and running with you.

ImNtReal commented 1 year ago

I did spin 0.0.3 back up with a new database file, and that worked fine.

thilojaeggi commented 1 year ago

I'll look into it, it somehow worked perfectly fine for me. For release v1.0.0 (whenever that happens) I'll make sure that these processes work better. You could theoretically go inside the running docker container and run "flask db upgrade", not sure how this would work on k8s though tbh as I have very limited experience with it.

ImNtReal commented 1 year ago

Pretty sure this was actually caused by a file permission change I had made, and wasn't aware of (from copying the database elsewhere, and then later back). I was able to get my database upgraded with the flask command.