diff --git a/supysonic/db.py b/supysonic/db.py index 0c745cd..4ab3a45 100644 --- a/supysonic/db.py +++ b/supysonic/db.py @@ -31,7 +31,7 @@ from playhouse.db_url import parseresult_to_dict, schemes from urllib.parse import urlparse from uuid import UUID, uuid4 -SCHEMA_VERSION = "20230115" +SCHEMA_VERSION = "20230331" def now(): diff --git a/supysonic/schema/migration/mysql/20230331.sql b/supysonic/schema/migration/mysql/20230331.sql new file mode 100644 index 0000000..030a7bf --- /dev/null +++ b/supysonic/schema/migration/mysql/20230331.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +UPDATE track SET bitrate=bitrate/1000 WHERE bitrate > 16000 AND path NOT LIKE '%.wav'; + +COMMIT; diff --git a/supysonic/schema/migration/postgres/20230331.sql b/supysonic/schema/migration/postgres/20230331.sql new file mode 100644 index 0000000..030a7bf --- /dev/null +++ b/supysonic/schema/migration/postgres/20230331.sql @@ -0,0 +1,5 @@ +START TRANSACTION; + +UPDATE track SET bitrate=bitrate/1000 WHERE bitrate > 16000 AND path NOT LIKE '%.wav'; + +COMMIT; diff --git a/supysonic/schema/migration/sqlite/20230331.sql b/supysonic/schema/migration/sqlite/20230331.sql new file mode 100644 index 0000000..45e7b22 --- /dev/null +++ b/supysonic/schema/migration/sqlite/20230331.sql @@ -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;