From 291e5578996bbca086e6c0d4f2baba6962129f4a Mon Sep 17 00:00:00 2001 From: JackDandy Date: Thu, 17 Mar 2016 19:09:07 +0000 Subject: [PATCH] Fix dbs that should not have been imported to work. --- CHANGES.md | 7 ++++++- sickbeard/databases/mainDB.py | 10 ++++++---- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 6c86f382..f8926ef0 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,4 +1,9 @@ -### 0.11.9 (2016-03-17 12:30:00 UTC) +### 0.11.10 (2016-03-17 19:00:00 UTC) + +* Fix dbs that should not have been imported to work + + +### 0.11.9 (2016-03-17 12:30:00 UTC) * Fix for import of very rare db structure diff --git a/sickbeard/databases/mainDB.py b/sickbeard/databases/mainDB.py index 88536b35..f9d2dcce 100644 --- a/sickbeard/databases/mainDB.py +++ b/sickbeard/databases/mainDB.py @@ -1042,8 +1042,9 @@ class AddTvShowOverview(db.SchemaUpgrade): def execute(self): db.backup_database('sickbeard.db', self.checkDBVersion()) - logger.log(u'Adding column overview to tv_shows') - self.addColumn('tv_shows', 'overview', 'TEXT', '') + if not self.hasColumn('tv_shows', 'overview'): + logger.log(u'Adding column overview to tv_shows') + self.addColumn('tv_shows', 'overview', 'TEXT', '') self.setDBVersion(20002) return self.checkDBVersion() @@ -1054,8 +1055,9 @@ class AddTvShowTags(db.SchemaUpgrade): def execute(self): db.backup_database('sickbeard.db', self.checkDBVersion()) - logger.log(u'Adding tag to tv_shows') - self.addColumn('tv_shows', 'tag', 'TEXT', 'Show List') + if not self.hasColumn('tv_shows', 'tag'): + logger.log(u'Adding tag to tv_shows') + self.addColumn('tv_shows', 'tag', 'TEXT', 'Show List') self.setDBVersion(20003) return self.checkDBVersion()