Python alembic.command.show() Examples

The following are 7 code examples of alembic.command.show(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module alembic.command , or try the search function .
Example #1
Source File: __init__.py    From jbox with MIT License 5 votes vote down vote up
def show(directory=None, revision='head'):
    """Show the revision denoted by the given symbol."""
    if alembic_version >= (0, 7, 0):
        config = current_app.extensions['migrate'].migrate.get_config(
            directory)
        command.show(config, revision)
    else:
        raise RuntimeError('Alembic 0.7.0 or greater is required') 
Example #2
Source File: cli.py    From yui with GNU Affero General Public License v3.0 5 votes vote down vote up
def show(config, revision: str):
    """Show the revision denoted by the given symbol."""

    bot = Bot(config)

    directory = os.path.join('yui', 'migrations')
    c = Config(os.path.join(directory, 'alembic.ini'))
    c.set_main_option('script_location', directory)
    c.set_main_option('sqlalchemy.url', bot.config.DATABASE_URL)
    c.attributes['Base'] = bot.orm_base

    command.show(c, revision) 
Example #3
Source File: db.py    From flask-restplus-server-example with MIT License 5 votes vote down vote up
def show(context, directory='migrations', revision='head'):
    """Show the revision denoted by the given symbol."""
    if alembic_version >= (0, 7, 0):
        config = _get_config(directory)
        command.show(config, revision)
    else:
        raise RuntimeError('Alembic 0.7.0 or greater is required') 
Example #4
Source File: migrations.py    From lux with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def show(self, revision):
        alembic_cmd.show(self.cfg, revision) 
Example #5
Source File: alembic_wrapper.py    From build-relengapi with Mozilla Public License 2.0 5 votes vote down vote up
def make_parser(self, subparsers):
        parser = subparsers.add_parser('show', help=self.show.__doc__)
        parser.add_argument('revision', nargs='?', default="head",
                            help="revision identifier")
        parser.add_argument('-d', '--directory', dest='directory', default=None,
                            help=("migration script directory (default is "
                                  "'migrations')"))
        return parser 
Example #6
Source File: alembic_wrapper.py    From build-relengapi with Mozilla Public License 2.0 5 votes vote down vote up
def run(self, parser, args):
        self.show(**vars(args)) 
Example #7
Source File: alembic_wrapper.py    From build-relengapi with Mozilla Public License 2.0 5 votes vote down vote up
def show(self, directory=None, revision='head', **kwargs):  # pragma: no cover
        """Show the revision denoted by the given symbol."""
        config = _get_config(directory)
        command.show(config, revision)