Skip to content

Commit

Permalink
Fixed: Forgot to migrate database, resulting in an error upon NZB dow…
Browse files Browse the repository at this point in the history
…nload. Closes #543
  • Loading branch information
[email protected] authored and [email protected] committed Feb 11, 2017
1 parent 8aa9f7d commit 63a3680
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
3 changes: 3 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
# NZB Hydra changelog

----------
### 0.2.200
Fixed: Forgot to migrate database, resulting in an error upon NZB download. See [#543](https://github.com/theotherp/nzbhydra/issues/543).

### 0.2.199
Fixed: NFO display was broken with last version. Also adapted NFO and log colors to grey theme.

Expand Down
10 changes: 9 additions & 1 deletion nzbhydra/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

db = SqliteQueueDatabase(None, autostart=False, results_timeout=20.0)

DATABASE_VERSION = 16
DATABASE_VERSION = 17


class JSONField(TextField):
Expand Down Expand Up @@ -624,3 +624,11 @@ class Meta(object):
vi.version = 16
vi.save()
logger.info("Database migration completed successfully")

if vi.version == 16:
logger.info("Dropping time column for NZB downloads")
migrator = SqliteMigrator(db)
with db.transaction():
migrate(
migrator.drop_column('indexernzbdownload', 'time')
)
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.199
0.2.200

0 comments on commit 63a3680

Please sign in to comment.