From fd736d3e1c24dd70b92fd2e924b24534e97abb7d Mon Sep 17 00:00:00 2001 From: "theotherp@gmx.de" Date: Sun, 12 Feb 2017 08:13:36 +0100 Subject: [PATCH] Hopefully fix database error for good --- changelog.md | 3 +++ nzbhydra/database.py | 10 +++++----- version.txt | 2 +- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/changelog.md b/changelog.md index c4d1126..d6be377 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,9 @@ # NZB Hydra changelog ---------- +### 0.2.201 +Fixed: Hopefully fix database error for good. + ### 0.2.200 Fixed: Forgot to migrate database, resulting in an error upon NZB download. See [#543](https://github.com/theotherp/nzbhydra/issues/543). diff --git a/nzbhydra/database.py b/nzbhydra/database.py index 942f0a2..067a759 100644 --- a/nzbhydra/database.py +++ b/nzbhydra/database.py @@ -19,7 +19,7 @@ db = SqliteQueueDatabase(None, autostart=False, results_timeout=20.0) -DATABASE_VERSION = 17 +DATABASE_VERSION = 18 class JSONField(TextField): @@ -625,16 +625,16 @@ class Meta(object): vi.save() logger.info("Database migration completed successfully") - if vi.version == 16: - logger.info("Dropping time column for NZB downloads") + if vi.version == 16 or vi.version == 17: try: migrator = SqliteMigrator(db) with db.transaction(): migrate( migrator.drop_column('indexernzbdownload', 'time') ) + logger.info("Dropped time column for NZB downloads") except: #May not exist because I fucked up pass - vi.version = 17 + vi.version = 18 vi.save() - logger.info("Database migration completed successfully") \ No newline at end of file + logger.info("Database migration completed successfully") diff --git a/version.txt b/version.txt index f5ca63c..16bcd27 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -0.2.200 \ No newline at end of file +0.2.201 \ No newline at end of file