From 7352af038b068972630a628b53e4c888335acde4 Mon Sep 17 00:00:00 2001 From: Jan Bertram Date: Thu, 9 Nov 2023 09:40:10 +0100 Subject: [PATCH] moves recording BLOB from table movement to table is_able_to_play, so that recordings can be stored per user, not per movement --- rep_cli.py | 2 +- repertoire.sql | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/rep_cli.py b/rep_cli.py index 8e7f565..ed9d71d 100644 --- a/rep_cli.py +++ b/rep_cli.py @@ -180,7 +180,7 @@ class work_under_id: saetze = dict() nummern = set() suw_liste = self.reader.execute(sql_suw).fetchall() - # 0 work_id, 1 mov_number, 2 numb, 3 designation, 4 mus_key, 5 recording + # 0 work_id, 1 mov_number, 2 numb, 3 designation, 4 mus_key for satz in suw_liste: saetze[satz[1]] = satz[2], satz[3], satz[4] if not satz[2] is None: diff --git a/repertoire.sql b/repertoire.sql index 43eb546..81dcbde 100644 --- a/repertoire.sql +++ b/repertoire.sql @@ -27,7 +27,6 @@ CREATE TABLE movement ( numb VARCHAR(15), designation VARCHAR(63), mus_key VARCHAR(15), - recording BLOB, PRIMARY KEY(work_id, mov_number), FOREIGN KEY(work_id) REFERENCES work(id) ); @@ -50,6 +49,7 @@ CREATE TABLE is_able_to_play( mov_id INTEGER NOT NULL, pianist_id INTEGER NOT NULL, days_to_practice INTEGER DEFAULT 7, + recording BLOB, PRIMARY KEY(work_id, mov_id, pianist_id), FOREIGN KEY(work_id, mov_id) REFERENCES movement(work_id, mov_number), FOREIGN KEY(pianist_id) REFERENCES pianist(id)