Some cleanup
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 13 Dec 2025 12:03:08 +0000 (13:03 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Sat, 13 Dec 2025 12:03:08 +0000 (13:03 +0100)
music_assistant/controllers/webserver/auth.py

index 4a1b5e692b97595343d75e7324894f3235e37b98..9a926d9403408d4c6f999066bae4bbbcfe655f67 100644 (file)
@@ -121,7 +121,7 @@ class AuthenticationManager:
             if db_row := await self.database.get_row("settings", {"key": "schema_version"}):
                 prev_version = int(db_row["value"])
             else:
-                prev_version = 0
+                prev_version = DB_SCHEMA_VERSION
         except (KeyError, ValueError, Exception):
             # settings table doesn't exist yet or other error
             prev_version = 0
@@ -157,8 +157,7 @@ class AuthenticationManager:
             )
             """
         )
-
-        # Users table (decoupled from auth providers)
+        # Users table
         await self.database.execute(
             """
             CREATE TABLE IF NOT EXISTS users (
@@ -175,7 +174,6 @@ class AuthenticationManager:
             )
             """
         )
-
         # User auth provider links (many-to-many)
         await self.database.execute(
             """
@@ -190,7 +188,6 @@ class AuthenticationManager:
             )
             """
         )
-
         # Auth tokens table
         await self.database.execute(
             """
@@ -207,7 +204,6 @@ class AuthenticationManager:
             )
             """
         )
-
         await self.database.commit()
 
     async def _create_database_indexes(self) -> None: