当前位置: 首页>>代码示例>>Python>>正文


Python command.history方法代码示例

本文整理汇总了Python中alembic.command.history方法的典型用法代码示例。如果您正苦于以下问题:Python command.history方法的具体用法?Python command.history怎么用?Python command.history使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在alembic.command的用法示例。


在下文中一共展示了command.history方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: history

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def history(directory=None, rev_range=None, verbose=False):
    """List changeset scripts in chronological order."""
    config = current_app.extensions['migrate'].migrate.get_config(directory)
    if alembic_version >= (0, 7, 0):
        command.history(config, rev_range, verbose=verbose)
    else:
        command.history(config, rev_range) 
开发者ID:jpush,项目名称:jbox,代码行数:9,代码来源:__init__.py

示例2: history

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def history(config, verbose: bool, rev_range: Optional[str]):
    """List changeset scripts in chronological order."""

    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.history(c, rev_range, verbose=verbose) 
开发者ID:item4,项目名称:yui,代码行数:14,代码来源:cli.py

示例3: history

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def history(context, directory='migrations', rev_range=None, verbose=False):
    """List changeset scripts in chronological order."""
    config = _get_config(directory)
    if alembic_version >= (0, 7, 0):
        command.history(config, rev_range, verbose=verbose)
    else:
        command.history(config, rev_range) 
开发者ID:frol,项目名称:flask-restplus-server-example,代码行数:9,代码来源:db.py

示例4: test_history_full

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_full(self):
        self.cfg.stdout = buf = self._buf_fixture()
        command.history(self.cfg, verbose=True)
        self._eq_cmd_output(buf, [self.c, self.b, self.a]) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:6,代码来源:test_command.py

示例5: test_history_full_environment

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_full_environment(self):
        self.cfg.stdout = buf = self._buf_fixture()
        self.cfg.set_main_option("revision_environment", "true")
        command.history(self.cfg, verbose=True)
        self._eq_cmd_output(buf, [self.c, self.b, self.a], env_token=True) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:7,代码来源:test_command.py

示例6: test_history_num_range

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_num_range(self):
        self.cfg.stdout = buf = self._buf_fixture()
        command.history(self.cfg, "%s:%s" % (self.a, self.b), verbose=True)
        self._eq_cmd_output(buf, [self.b, self.a]) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:6,代码来源:test_command.py

示例7: test_history_num_range_environment

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_num_range_environment(self):
        self.cfg.stdout = buf = self._buf_fixture()
        self.cfg.set_main_option("revision_environment", "true")
        command.history(self.cfg, "%s:%s" % (self.a, self.b), verbose=True)
        self._eq_cmd_output(buf, [self.b, self.a], env_token=True) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:7,代码来源:test_command.py

示例8: test_history_base_to_num

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_base_to_num(self):
        self.cfg.stdout = buf = self._buf_fixture()
        command.history(self.cfg, ":%s" % (self.b), verbose=True)
        self._eq_cmd_output(buf, [self.b, self.a]) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:6,代码来源:test_command.py

示例9: test_history_num_to_head_environment

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_num_to_head_environment(self):
        self.cfg.stdout = buf = self._buf_fixture()
        self.cfg.set_main_option("revision_environment", "true")
        command.history(self.cfg, "%s:" % (self.a), verbose=True)
        self._eq_cmd_output(buf, [self.c, self.b, self.a], env_token=True) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:7,代码来源:test_command.py

示例10: test_history_num_plus_relative

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_num_plus_relative(self):
        self.cfg.stdout = buf = self._buf_fixture()
        command.history(self.cfg, "%s:+2" % (self.a), verbose=True)
        self._eq_cmd_output(buf, [self.c, self.b, self.a]) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:6,代码来源:test_command.py

示例11: test_history_relative_to_num

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_relative_to_num(self):
        self.cfg.stdout = buf = self._buf_fixture()
        command.history(self.cfg, "-2:%s" % (self.c), verbose=True)
        self._eq_cmd_output(buf, [self.c, self.b, self.a]) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:6,代码来源:test_command.py

示例12: test_history_too_large_relative_to_num

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_too_large_relative_to_num(self):
        self.cfg.stdout = buf = self._buf_fixture()
        command.history(self.cfg, "-5:%s" % (self.c), verbose=True)
        self._eq_cmd_output(buf, [self.c, self.b, self.a]) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:6,代码来源:test_command.py

示例13: test_history_current_to_head_as_b

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_current_to_head_as_b(self):
        command.stamp(self.cfg, self.b)
        self.cfg.stdout = buf = self._buf_fixture()
        command.history(self.cfg, "current:", verbose=True)
        self._eq_cmd_output(buf, [self.c, self.b], env_token=True) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:7,代码来源:test_command.py

示例14: test_history_include_env

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_include_env(self):
        self.cfg.stdout = buf = self._buf_fixture()
        self.cfg.set_main_option("revision_environment", "true")
        command.history(self.cfg, verbose=True)
        self._eq_cmd_output(buf, [self.c, self.b, self.a], env_token=True) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:7,代码来源:test_command.py

示例15: test_history_indicate_current

# 需要导入模块: from alembic import command [as 别名]
# 或者: from alembic.command import history [as 别名]
def test_history_indicate_current(self):
        command.stamp(self.cfg, (self.b,))
        self.cfg.stdout = buf = self._buf_fixture()
        command.history(self.cfg, indicate_current=True, verbose=True)
        self._eq_cmd_output(
            buf, [self.c, self.b, self.a], currents=(self.b,), env_token=True
        ) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:9,代码来源:test_command.py


注:本文中的alembic.command.history方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。