mirror of
https://github.com/spl0k/supysonic.git
synced 2024-12-22 08:56:17 +00:00
Add database migrations to fix up the bitrate units
The migration assumes that no audio files will be <16kbps and only wav files will be more than 16,000kbps.
This commit is contained in:
parent
109f81e713
commit
639c68291a
@ -31,7 +31,7 @@ from playhouse.db_url import parseresult_to_dict, schemes
|
|||||||
from urllib.parse import urlparse
|
from urllib.parse import urlparse
|
||||||
from uuid import UUID, uuid4
|
from uuid import UUID, uuid4
|
||||||
|
|
||||||
SCHEMA_VERSION = "20230115"
|
SCHEMA_VERSION = "20230331"
|
||||||
|
|
||||||
|
|
||||||
def now():
|
def now():
|
||||||
|
5
supysonic/schema/migration/mysql/20230331.sql
Normal file
5
supysonic/schema/migration/mysql/20230331.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
|
UPDATE track SET bitrate=bitrate/1000 WHERE bitrate > 16000 AND path NOT LIKE '%.wav';
|
||||||
|
|
||||||
|
COMMIT;
|
5
supysonic/schema/migration/postgres/20230331.sql
Normal file
5
supysonic/schema/migration/postgres/20230331.sql
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
START TRANSACTION;
|
||||||
|
|
||||||
|
UPDATE track SET bitrate=bitrate/1000 WHERE bitrate > 16000 AND path NOT LIKE '%.wav';
|
||||||
|
|
||||||
|
COMMIT;
|
8
supysonic/schema/migration/sqlite/20230331.sql
Normal file
8
supysonic/schema/migration/sqlite/20230331.sql
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
COMMIT;
|
||||||
|
PRAGMA foreign_keys = OFF;
|
||||||
|
BEGIN TRANSACTION;
|
||||||
|
|
||||||
|
UPDATE track SET bitrate=bitrate/1000 WHERE bitrate > 16000 AND path NOT LIKE '%.wav';
|
||||||
|
|
||||||
|
COMMIT;
|
||||||
|
BEGIN TRANSACTION;
|
Loading…
Reference in New Issue
Block a user