Private GIT

Skip to content
Snippets Groups Projects
Commit 06569fcb authored by miigotu's avatar miigotu
Browse files

Merge pull request #3121 from labrys/pep8-cache_db

Update cache_db.py for PEPs 8 and 263
parents 74ef60df 49af8d2c
Branches
Tags
No related merge requests found
# coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# URL: http://code.google.com/p/sickbeard/
#
......@@ -18,6 +20,7 @@
from sickbeard import db
# Add new migrations at the bottom of the list; subclass the previous migration.
class InitialSchema(db.SchemaUpgrade):
def test(self):
......@@ -49,6 +52,7 @@ class AddSceneExceptions(InitialSchema):
self.connection.action(
"CREATE TABLE scene_exceptions (exception_id INTEGER PRIMARY KEY, indexer_id INTEGER KEY, show_name TEXT);")
class AddSceneNameCache(AddSceneExceptions):
def test(self):
return self.hasTable("scene_names")
......@@ -64,6 +68,7 @@ class AddNetworkTimezones(AddSceneNameCache):
def execute(self):
self.connection.action("CREATE TABLE network_timezones (network_name TEXT PRIMARY KEY, timezone TEXT);")
class AddLastSearch(AddNetworkTimezones):
def test(self):
return self.hasTable("lastSearch")
......@@ -71,6 +76,7 @@ class AddLastSearch(AddNetworkTimezones):
def execute(self):
self.connection.action("CREATE TABLE lastSearch (provider TEXT, time NUMERIC);")
class AddSceneExceptionsSeasons(AddLastSearch):
def test(self):
return self.hasColumn("scene_exceptions", "season")
......@@ -78,6 +84,7 @@ class AddSceneExceptionsSeasons(AddLastSearch):
def execute(self):
self.addColumn("scene_exceptions", "season", "NUMERIC", -1)
class AddSceneExceptionsCustom(AddSceneExceptionsSeasons):
def test(self):
return self.hasColumn("scene_exceptions", "custom")
......@@ -85,6 +92,7 @@ class AddSceneExceptionsCustom(AddSceneExceptionsSeasons):
def execute(self):
self.addColumn("scene_exceptions", "custom", "NUMERIC", 0)
class AddSceneExceptionsRefresh(AddSceneExceptionsCustom):
def test(self):
return self.hasTable("scene_exceptions_refresh")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment