Skip to content

Commit

Permalink
Hopefully fix database error for good
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and [email protected] committed Feb 12, 2017
1 parent 9723de9 commit fd736d3
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 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.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).

Expand Down
10 changes: 5 additions & 5 deletions 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 = 17
DATABASE_VERSION = 18


class JSONField(TextField):
Expand Down Expand Up @@ -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")
logger.info("Database migration completed successfully")
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.2.200
0.2.201

0 comments on commit fd736d3

Please sign in to comment.