示例#1
0
 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)
示例#2
0
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()
示例#3
0
 def current(self, args):
     config = commands.init_config()
     config.osvmexpire = CONF
     commands.current(args.verbose, config=config)
示例#4
0
 def history(self, args):
     config = commands.init_config()
     config.osvmexpire = CONF
     commands.history(args.verbose, config=config)
示例#5
0
 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)