mirror of
https://github.com/SickGear/SickGear.git
synced 2024-12-03 18:03:37 +00:00
Merge branch 'hotfix/0.11.12'
This commit is contained in:
commit
9198eb6990
3 changed files with 55 additions and 11 deletions
|
@ -1,4 +1,9 @@
|
|||
### 0.11.11 (2016-04-05 19:20:00 UTC)
|
||||
### 0.11.12 (2016-06-20 02:20:00 UTC)
|
||||
|
||||
* Change improve importing show list sickbeard.db files
|
||||
|
||||
|
||||
### 0.11.11 (2016-04-05 19:20:00 UTC)
|
||||
|
||||
* Add support for SD mkv container
|
||||
|
||||
|
|
|
@ -977,15 +977,25 @@ class Migrate41(db.SchemaUpgrade):
|
|||
return self.checkDBVersion()
|
||||
|
||||
|
||||
# 4301 -> 10001
|
||||
# 4301 -> 10002
|
||||
class Migrate4301(db.SchemaUpgrade):
|
||||
def execute(self):
|
||||
db.backup_database('sickbeard.db', self.checkDBVersion())
|
||||
|
||||
logger.log(u'Dropping redundant column')
|
||||
self.dropColumn('db_version', 'db_minor_version')
|
||||
logger.log(u'Bumping database version')
|
||||
|
||||
self.setDBVersion(10001)
|
||||
self.setDBVersion(10002)
|
||||
return self.checkDBVersion()
|
||||
|
||||
|
||||
# 4302,4400 -> 10003
|
||||
class Migrate4302(db.SchemaUpgrade):
|
||||
def execute(self):
|
||||
db.backup_database('sickbeard.db', self.checkDBVersion())
|
||||
|
||||
logger.log(u'Bumping database version')
|
||||
|
||||
self.setDBVersion(10003)
|
||||
return self.checkDBVersion()
|
||||
|
||||
|
||||
|
@ -1016,13 +1026,38 @@ class RemoveDefaultEpStatusFromTvShows(db.SchemaUpgrade):
|
|||
def execute(self):
|
||||
db.backup_database('sickbeard.db', self.checkDBVersion())
|
||||
|
||||
logger.log(u'Dropping column default_ep_status from tv_shows')
|
||||
logger.log(u'Dropping redundant column default_ep_status from tv_shows')
|
||||
self.dropColumn('tv_shows', 'default_ep_status')
|
||||
|
||||
self.setDBVersion(10000)
|
||||
return self.checkDBVersion()
|
||||
|
||||
|
||||
# 10002 -> 10001
|
||||
class RemoveMinorDBVersion(db.SchemaUpgrade):
|
||||
def execute(self):
|
||||
db.backup_database('sickbeard.db', self.checkDBVersion())
|
||||
|
||||
logger.log(u'Dropping redundant column db_minor_version from db_version')
|
||||
self.dropColumn('db_version', 'db_minor_version')
|
||||
|
||||
self.setDBVersion(10001)
|
||||
return self.checkDBVersion()
|
||||
|
||||
|
||||
# 10003 -> 10002
|
||||
class RemoveMetadataSub(db.SchemaUpgrade):
|
||||
def execute(self):
|
||||
db.backup_database('sickbeard.db', self.checkDBVersion())
|
||||
|
||||
if self.hasColumn('tv_shows', 'sub_use_sr_metadata'):
|
||||
logger.log(u'Dropping redundant column metadata sub')
|
||||
self.dropColumn('tv_shows', 'sub_use_sr_metadata')
|
||||
|
||||
self.setDBVersion(10002)
|
||||
return self.checkDBVersion()
|
||||
|
||||
|
||||
# 20000 -> 20001
|
||||
class DBIncreaseTo20001(db.SchemaUpgrade):
|
||||
def execute(self):
|
||||
|
|
|
@ -75,11 +75,11 @@ class DBConnection(object):
|
|||
return 0
|
||||
|
||||
if result:
|
||||
if self.hasColumn('db_version', 'db_minor_version'):
|
||||
version = int(result[0]['db_version'])
|
||||
if 10000 > version and self.hasColumn('db_version', 'db_minor_version'):
|
||||
minor = self.select('SELECT db_minor_version FROM db_version')
|
||||
version = int(result[0]['db_version']) * 100 + int(minor[0]['db_minor_version'])
|
||||
return (version, 4301)[2000301 == version]
|
||||
return int(result[0]['db_version'])
|
||||
return version * 100 + int(minor[0]['db_minor_version'])
|
||||
return version
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
@ -427,6 +427,8 @@ def MigrationCode(myDB):
|
|||
44: sickbeard.mainDB.Migrate41,
|
||||
|
||||
4301: sickbeard.mainDB.Migrate4301,
|
||||
4302: sickbeard.mainDB.Migrate4302,
|
||||
4400: sickbeard.mainDB.Migrate4302,
|
||||
|
||||
5816: sickbeard.mainDB.MigrateUpstream,
|
||||
5817: sickbeard.mainDB.MigrateUpstream,
|
||||
|
@ -434,6 +436,8 @@ def MigrationCode(myDB):
|
|||
|
||||
10000: sickbeard.mainDB.SickGearDatabaseVersion,
|
||||
10001: sickbeard.mainDB.RemoveDefaultEpStatusFromTvShows,
|
||||
10002: sickbeard.mainDB.RemoveMinorDBVersion,
|
||||
10003: sickbeard.mainDB.RemoveMetadataSub,
|
||||
|
||||
20000: sickbeard.mainDB.DBIncreaseTo20001,
|
||||
20001: sickbeard.mainDB.AddTvShowOverview,
|
||||
|
|
Loading…
Reference in a new issue