def revision(self, args): """Process the 'revision' Alembic command.""" config = commands.init_config() config.osvmexpire = CONF commands.generate(autogenerate=args.autogenerate, message=args.message, config=config)
def setup_in_memory_db(): # Ensure we are using in-memory SQLite database, and creating tables. options.set_defaults(repositories.CONF, connection='sqlite:///test.db') repositories.CONF.set_override("debug", True) config = commands.init_config() config.osvmexpire = repositories.CONF # Ensure the connection is completely closed, so any previous in-memory # database can be removed prior to starting the next test run. repositories.hard_reset() commands.upgrade(config=config, to_version='head') # Start the in-memory database, creating required tables. repositories.start()
def current(self, args): config = commands.init_config() config.osvmexpire = CONF commands.current(args.verbose, config=config)
def history(self, args): config = commands.init_config() config.osvmexpire = CONF commands.history(args.verbose, config=config)
def upgrade(self, args): """Process the 'upgrade' Alembic command.""" LOG.debug("Performing database schema migration...") config = commands.init_config() config.osvmexpire = CONF commands.upgrade(to_version=args.version, config=config)