mirror of
https://github.com/clinton-hall/nzbToMedia.git
synced 2025-07-12 16:22:53 -07:00
Refactor nzbToMediaDB -> main_db
This commit is contained in:
parent
5d423b0f38
commit
9d9abffdb6
6 changed files with 12 additions and 12 deletions
|
@ -1,6 +1,6 @@
|
|||
# coding=utf-8
|
||||
|
||||
from core import logger, nzbToMediaDB
|
||||
from core import logger, main_db
|
||||
from core.nzbToMediaUtil import backup_versioned_file
|
||||
|
||||
MIN_DB_VERSION = 1 # oldest db version we support migrating from
|
||||
|
@ -9,7 +9,7 @@ MAX_DB_VERSION = 2
|
|||
|
||||
def backup_database(version):
|
||||
logger.info("Backing up database before upgrade")
|
||||
if not backup_versioned_file(nzbToMediaDB.db_filename(), version):
|
||||
if not backup_versioned_file(main_db.db_filename(), version):
|
||||
logger.log_error_and_exit("Database backup failed, abort upgrading database")
|
||||
else:
|
||||
logger.info("Proceeding with upgrade")
|
||||
|
@ -20,7 +20,7 @@ def backup_database(version):
|
|||
# ======================
|
||||
# Add new migrations at the bottom of the list; subclass the previous migration.
|
||||
|
||||
class InitialSchema(nzbToMediaDB.SchemaUpgrade):
|
||||
class InitialSchema(main_db.SchemaUpgrade):
|
||||
def test(self):
|
||||
no_update = False
|
||||
if self.has_table("db_version"):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue