RFC: Cleanup DB metadata for RFC

This commit is contained in:
Jon Tibble 2010-06-12 03:14:18 +01:00
parent 55f6197212
commit 5f2042168d
4 changed files with 6 additions and 6 deletions

View File

@ -53,4 +53,5 @@ def init_schema(url):
mapper(AlertItem, alerts_table)
return session, metadata
metadata.create_all(checkfirst=True)
return session

View File

@ -61,8 +61,7 @@ class DBManager(object):
unicode(settings.value(u'db hostname').toString()),
unicode(settings.value(u'db database').toString()))
settings.endGroup()
self.session, self.metadata = init_schema(self.db_url)
self.metadata.create_all(checkfirst=True)
self.session = init_schema(self.db_url)
log.debug(u'Alerts Initialised')
def get_all_alerts(self):

View File

@ -147,4 +147,5 @@ def init_schema(url):
secondary=songs_topics_table)})
mapper(Topic, topics_table)
return session, metadata
metadata.create_all(checkfirst=True)
return session

View File

@ -110,8 +110,7 @@ class SongManager(object):
u'db hostname', QtCore.QVariant(u'')).toString()),
unicode(settings.value(
u'db database', QtCore.QVariant(u'')).toString()))
self.session, self.metadata = init_schema(self.db_url)
self.metadata.create_all(checkfirst=True)
self.session = init_schema(self.db_url)
settings.endGroup()
log.debug(u'Song Initialised')