forked from openlp/openlp
Fix initial setup bug
This commit is contained in:
parent
611577577f
commit
c1a648900f
@ -90,7 +90,7 @@ def upgrade_db(url, upgrade):
|
|||||||
version_meta = session.query(Metadata).get(u'version')
|
version_meta = session.query(Metadata).get(u'version')
|
||||||
if version_meta is None:
|
if version_meta is None:
|
||||||
version_meta = Metadata.populate(key=u'version', value=u'0')
|
version_meta = Metadata.populate(key=u'version', value=u'0')
|
||||||
version = 0
|
version = 0 if tables else upgrade.__version__;
|
||||||
else:
|
else:
|
||||||
version = int(version_meta.value)
|
version = int(version_meta.value)
|
||||||
if version > upgrade.__version__:
|
if version > upgrade.__version__:
|
||||||
|
@ -41,6 +41,7 @@ def upgrade_setup(metadata):
|
|||||||
upgrade process. If you want to drop a table, you need to remove it from
|
upgrade process. If you want to drop a table, you need to remove it from
|
||||||
here, and add it to your upgrade function.
|
here, and add it to your upgrade function.
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
tables = {
|
tables = {
|
||||||
u'authors': Table(u'authors', metadata, autoload=True),
|
u'authors': Table(u'authors', metadata, autoload=True),
|
||||||
u'media_files': Table(u'media_files', metadata, autoload=True),
|
u'media_files': Table(u'media_files', metadata, autoload=True),
|
||||||
@ -50,6 +51,8 @@ def upgrade_setup(metadata):
|
|||||||
u'authors_songs': Table(u'authors_songs', metadata, autoload=True),
|
u'authors_songs': Table(u'authors_songs', metadata, autoload=True),
|
||||||
u'songs_topics': Table(u'songs_topics', metadata, autoload=True)
|
u'songs_topics': Table(u'songs_topics', metadata, autoload=True)
|
||||||
}
|
}
|
||||||
|
except:
|
||||||
|
tables = None
|
||||||
return tables
|
return tables
|
||||||
|
|
||||||
|
|
||||||
|
@ -40,9 +40,12 @@ def upgrade_setup(metadata):
|
|||||||
upgrade process. If you want to drop a table, you need to remove it from
|
upgrade process. If you want to drop a table, you need to remove it from
|
||||||
here, and add it to your upgrade function.
|
here, and add it to your upgrade function.
|
||||||
"""
|
"""
|
||||||
|
try:
|
||||||
tables = {
|
tables = {
|
||||||
u'songusage_data': Table(u'songusage_data', metadata, autoload=True)
|
u'songusage_data': Table(u'songusage_data', metadata, autoload=True)
|
||||||
}
|
}
|
||||||
|
except:
|
||||||
|
tables = None
|
||||||
return tables
|
return tables
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user