本文整理匯總了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
)