# pylint: disable=protected-access
Store._is_upgrade = True
- datastore = AdminStore()
+ adminstore = AdminStore()
# First try to upgrade the config store before continuing
- if not _upgrade_database(datastore):
+ if not _upgrade_database(adminstore):
return upgrade_failed()
- admin_config = datastore.load_config()
+ admin_config = adminstore.load_config()
for option in admin_config:
cherrypy.config[option] = admin_config[option]
for plugin in root._site[facility].enabled:
print 'Handling plugin %s' % plugin
plugin = root._site[facility].available[plugin]
+ print 'Creating plugin AdminStore table'
+ adminstore.create_plugin_data_table(plugin.name)
for store in plugin.used_datastores():
print 'Handling plugin datastore %s' % store.__class__.__name__
if not _upgrade_database(store):
else:
raise NotImplementedError()
+ def create_plugin_data_table(self, plugin_name):
+ table = plugin_name+'_data'
+ q = self._query(self._db, table, UNIQUE_DATA_TABLE,
+ trans=False)
+ q.create()
+
class UserStore(Store):
try:
Store._is_upgrade = True # pylint: disable=protected-access
self.on_enable()
+ self._data.create_plugin_data_table(self.name)
for store in self.used_datastores():
store.upgrade_database()
finally: