From 51b30014c64d5c265198b8e1266fe3a1a9e6d0a1 Mon Sep 17 00:00:00 2001 From: Carl Hall Date: Sun, 23 Aug 2020 14:29:09 -0700 Subject: [PATCH] Make bitrate field int to match xml schema datatype. Correct index names and FK refs --- supysonic/db.py | 2 +- supysonic/schema/migration/mysql/20200620.sql | 2 +- supysonic/schema/migration/postgres/20200620.sql | 4 ++-- supysonic/schema/migration/sqlite/20200620.sql | 6 +++--- supysonic/schema/mysql.sql | 2 +- supysonic/schema/postgres.sql | 4 ++-- supysonic/schema/sqlite.sql | 6 +++--- 7 files changed, 13 insertions(+), 13 deletions(-) diff --git a/supysonic/db.py b/supysonic/db.py index f3a2a51..97d761a 100755 --- a/supysonic/db.py +++ b/supysonic/db.py @@ -645,7 +645,7 @@ class PodcastEpisode(db.Entity): created = Required(datetime, precision=0, default=now) size = Optional(int, nullable=True) suffix = Optional(str, nullable=True) - bitrate = Optional(str, nullable=True) + bitrate = Optional(int, nullable=True) content_type = Optional(str, nullable=True) cover_art = Optional(str, nullable=True) genre = Optional(str, nullable=True) diff --git a/supysonic/schema/migration/mysql/20200620.sql b/supysonic/schema/migration/mysql/20200620.sql index 38b12b2..652d66d 100644 --- a/supysonic/schema/migration/mysql/20200620.sql +++ b/supysonic/schema/migration/mysql/20200620.sql @@ -27,7 +27,7 @@ CREATE TABLE IF NOT EXISTS podcast_episode ( created DATETIME NOT NULL, size INTEGER, suffix VARCHAR(8), - bitrate VARCHAR(16), + bitrate INTEGER, content_type VARCHAR(64), cover_art VARCHAR(256), genre VARCHAR(16), diff --git a/supysonic/schema/migration/postgres/20200620.sql b/supysonic/schema/migration/postgres/20200620.sql index 03a7ef1..80c583f 100644 --- a/supysonic/schema/migration/postgres/20200620.sql +++ b/supysonic/schema/migration/postgres/20200620.sql @@ -28,11 +28,11 @@ CREATE TABLE IF NOT EXISTS podcast_episode ( created TIMESTAMP NOT NULL, size INTEGER, suffix VARCHAR(8), - bitrate VARCHAR(16), + bitrate INTEGER, content_type VARCHAR(64), cover_art VARCHAR(256), genre VARCHAR(16), year SMALLINT ); -CREATE INDEX IF NOT EXISTS index_episode_channel_id_fk ON podcast_channel(id); +CREATE INDEX IF NOT EXISTS index_episode_channel_id_fk ON podcast_episode(channel_id); CREATE INDEX IF NOT EXISTS index_episode_status ON podcast_episode(status); diff --git a/supysonic/schema/migration/sqlite/20200620.sql b/supysonic/schema/migration/sqlite/20200620.sql index a685b63..4e10963 100644 --- a/supysonic/schema/migration/sqlite/20200620.sql +++ b/supysonic/schema/migration/sqlite/20200620.sql @@ -28,11 +28,11 @@ CREATE TABLE IF NOT EXISTS podcast_episode ( created DATETIME NOT NULL, size INT, suffix VARCHAR(8), - bitrate VARCHAR(16), + bitrate INT, content_type VARCHAR(64), cover_art VARCHAR(256), genre VARCHAR(16), year SMALLINT ); -CREATE INDEX IF NOT EXISTS index_episode_channel_id_fk ON podcast_channel(id); -CREATE INDEX IF NOT EXISTS index_episode_status_id_fk ON podcast_episode(status); +CREATE INDEX IF NOT EXISTS index_episode_channel_id_fk ON podcast_episode(channel_id); +CREATE INDEX IF NOT EXISTS index_episode_status ON podcast_episode(status); diff --git a/supysonic/schema/mysql.sql b/supysonic/schema/mysql.sql index ee2d0fc..85898a4 100644 --- a/supysonic/schema/mysql.sql +++ b/supysonic/schema/mysql.sql @@ -186,7 +186,7 @@ CREATE TABLE IF NOT EXISTS podcast_episode ( created DATETIME NOT NULL, size INTEGER, suffix VARCHAR(8), - bitrate VARCHAR(16), + bitrate INTEGER, content_type VARCHAR(64), cover_art VARCHAR(256), genre VARCHAR(16), diff --git a/supysonic/schema/postgres.sql b/supysonic/schema/postgres.sql index 8b620b1..f6a832c 100644 --- a/supysonic/schema/postgres.sql +++ b/supysonic/schema/postgres.sql @@ -187,11 +187,11 @@ CREATE TABLE IF NOT EXISTS podcast_episode ( created TIMESTAMP NOT NULL, size INTEGER, suffix VARCHAR(8), - bitrate VARCHAR(16), + bitrate INTEGER, content_type VARCHAR(64), cover_art VARCHAR(256), genre VARCHAR(16), year SMALLINT ); -CREATE INDEX IF NOT EXISTS index_episode_channel_id_fk ON podcast_channel(id); +CREATE INDEX IF NOT EXISTS index_episode_channel_id_fk ON podcast_episode(channel_id); CREATE INDEX IF NOT EXISTS index_episode_status ON podcast_episode(status); diff --git a/supysonic/schema/sqlite.sql b/supysonic/schema/sqlite.sql index c7c6240..7446ab7 100644 --- a/supysonic/schema/sqlite.sql +++ b/supysonic/schema/sqlite.sql @@ -189,11 +189,11 @@ CREATE TABLE IF NOT EXISTS podcast_episode ( created DATETIME NOT NULL, size INT, suffix VARCHAR(8), - bitrate VARCHAR(16), + bitrate INTEGER, content_type VARCHAR(64), cover_art VARCHAR(256), genre VARCHAR(16), year SMALLINT ); -CREATE INDEX IF NOT EXISTS index_episode_channel_id_fk ON podcast_channel(id); -CREATE INDEX IF NOT EXISTS index_episode_status_id_fk ON podcast_episode(status); +CREATE INDEX IF NOT EXISTS index_episode_channel_id_fk ON podcast_episode(channel_id); +CREATE INDEX IF NOT EXISTS index_episode_status ON podcast_episode(status);