本文整理汇总了Python中alembic.command.show方法的典型用法代码示例。如果您正苦于以下问题:Python command.show方法的具体用法?Python command.show怎么用?Python command.show使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类alembic.command
的用法示例。
在下文中一共展示了command.show方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: show
# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import show [as 别名]
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')
示例2: show
# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import show [as 别名]
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)
示例3: show
# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import show [as 别名]
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')
示例4: show
# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import show [as 别名]
def show(self, revision):
alembic_cmd.show(self.cfg, revision)
示例5: make_parser
# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import show [as 别名]
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
示例6: run
# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import show [as 别名]
def run(self, parser, args):
self.show(**vars(args))
示例7: show
# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import show [as 别名]
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)