本文整理汇总了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)
示例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)
示例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)
示例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])
示例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)
示例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])
示例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)
示例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])
示例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)
示例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])
示例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])
示例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])
示例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)
示例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)
示例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
)