link playlists to a userid

+ fix favorites foreign key
+ add migration to add userid foreign key to playlists table
This commit is contained in:
cwilvx
2024-06-09 11:08:18 +03:00
parent 8fa64b3a4d
commit fcf1469428
6 changed files with 102 additions and 41 deletions
+7 -2
View File
@@ -83,7 +83,9 @@ class SQLiteManager:
def __enter__(self) -> Cursor:
if self.conn is not None:
return self.conn.cursor()
cur = self.conn.cursor()
cur.execute("PRAGMA foreign_keys = ON")
return cur
if self.test_db_path:
db_path = self.test_db_path
@@ -97,7 +99,10 @@ class SQLiteManager:
db_path,
timeout=15,
)
return self.conn.cursor()
cur = self.conn.cursor()
cur.execute("PRAGMA foreign_keys = ON")
return cur
def __exit__(self, exc_type, exc_value, exc_traceback):
trial_count = 0