mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-04 04:23:01 +00:00
link playlists to a userid
+ fix favorites foreign key + add migration to add userid foreign key to playlists table
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user