Rename DatabaseOutOfDate's parameter 'current' -> 'existing'.
This commit is contained in:
parent
1f45be9c39
commit
1eb5a6f465
2 changed files with 4 additions and 8 deletions
|
@ -165,7 +165,7 @@ class BadDataDirectory(EtiquetteException):
|
|||
error_message = 'Bad data directory "{}"'
|
||||
|
||||
OUTOFDATE = '''
|
||||
Database is out of date. {current} should be {new}.
|
||||
Database is out of date. {existing} should be {new}.
|
||||
Please use utilities\\database_upgrader\\database_upgrader.py
|
||||
'''.strip()
|
||||
class DatabaseOutOfDate(EtiquetteException):
|
||||
|
|
|
@ -1333,13 +1333,9 @@ class PhotoDB(
|
|||
Compare database's user_version against constants.DATABASE_VERSION,
|
||||
raising exceptions.DatabaseOutOfDate if not correct.
|
||||
'''
|
||||
existing_version = self.sql_execute('PRAGMA user_version').fetchone()[0]
|
||||
if existing_version != constants.DATABASE_VERSION:
|
||||
exc = exceptions.DatabaseOutOfDate(
|
||||
current=existing_version,
|
||||
new=constants.DATABASE_VERSION,
|
||||
)
|
||||
raise exc
|
||||
existing = self.sql_execute('PRAGMA user_version').fetchone()[0]
|
||||
if existing != constants.DATABASE_VERSION:
|
||||
raise exceptions.DatabaseOutOfDate(existing=existing, new=constants.DATABASE_VERSION)
|
||||
|
||||
def _first_time_setup(self):
|
||||
self.log.debug('Running first-time setup.')
|
||||
|
|
Loading…
Reference in a new issue