Don't even try to load migration when db doesn't exists
This commit is contained in:
1 parent
b164674ff7
commit
d568bea393
1 file changed
+3
-3
@@ -128,14 +128,14 @@ def runCouchPotato(options, base_path, args, data_dir = None, log_dir = None, En
|
|||||||
|
|
||||||
|
|
||||||
# Load migrations
|
# Load migrations
|
||||||
from migrate.versioning.api import version_control, db_version, version, upgrade
|
initialize = True
|
||||||
db = Env.get('db_path')
|
db = Env.get('db_path')
|
||||||
|
if os.path.isfile(db):
|
||||||
|
from migrate.versioning.api import version_control, db_version, version, upgrade
|
||||||
repo = os.path.join(base_path, 'couchpotato', 'core', 'migration')
|
repo = os.path.join(base_path, 'couchpotato', 'core', 'migration')
|
||||||
logging.getLogger('migrate').setLevel(logging.WARNING) # Disable logging for migration
|
logging.getLogger('migrate').setLevel(logging.WARNING) # Disable logging for migration
|
||||||
|
|
||||||
latest_db_version = version(repo)
|
latest_db_version = version(repo)
|
||||||
|
|
||||||
initialize = True
|
|
||||||
try:
|
try:
|
||||||
current_db_version = db_version(db, repo)
|
current_db_version = db_version(db, repo)
|
||||||
initialize = False
|
initialize = False
|
||||||
|
|||||||
Reference in new issue
Block a user