From 93a62c2e4de6ab290d11f222981d1bdea140bdeb Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Thu, 26 May 2022 09:36:18 +0200 Subject: [PATCH] fix for missing drop column support in sql engine --- music_assistant/helpers/database.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/music_assistant/helpers/database.py b/music_assistant/helpers/database.py index 57e8ba35..ef1fc112 100755 --- a/music_assistant/helpers/database.py +++ b/music_assistant/helpers/database.py @@ -218,7 +218,12 @@ class Database: match = {"item_id": db_row["item_id"]} new_values = {"artists": f'[{ db_row["artist"]}]'} await self.update(TABLE_ALBUMS, match, new_values, db=db) - await db.execute(f"ALTER TABLE {TABLE_ALBUMS} DROP COLUMN artist;") + try: + await db.execute( + f"ALTER TABLE {TABLE_ALBUMS} DROP COLUMN artist;" + ) + except Exception: # pylint: disable=broad-except + pass # old sqlite version # store current schema version await self.set_setting("version", str(SCHEMA_VERSION), db=db) -- 2.34.1