當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。