コード例 #1
0
ファイル: __init__.py プロジェクト: PublicaMundi/ckan
 def current_version(self):
     try:
         alembic_current(self.alembic_config)
         return self.take_alembic_output()[0][0]
     except (TypeError, IndexError):
         # alembic is not initialized yet
         return 'base'
コード例 #2
0
 def current_version(self):
     try:
         alembic_current(self.alembic_config)
         return self.take_alembic_output()[0][0]
     except (TypeError, IndexError):
         # alembic is not initialized yet
         return 'base'
コード例 #3
0
ファイル: test_current.py プロジェクト: RedCarpetUp/rush
def test_current(getAlembic: alembic.config.Config) -> None:
    """Test that the alembic current command does not erorr"""
    # Runs with no error
    # output = run_alembic_command(pg["engine"], "current", {})

    stdout = StringIO()
    with contextlib.redirect_stdout(stdout):
        # command_func(alembic_cfg, **command_kwargs)
        alembic_current(getAlembic, {})
    assert stdout.getvalue() == ""
コード例 #4
0
ファイル: __init__.py プロジェクト: paulmueller/ckan
    def current_version(self):
        """Returns current revision of the migration repository.

        Returns None for plugins that has no migrations and "base" for plugins
        that has migrations but none of them were applied. If current revision
        is the newest one, ` (head)` suffix added to the result

        """
        from alembic.util import CommandError
        try:
            alembic_current(self.alembic_config)
            return self.take_alembic_output()[0][0]
        except (TypeError, IndexError):
            # alembic is not initialized yet
            return 'base'
        except CommandError:
            # trying to get revision of plugin without migrations
            return None
コード例 #5
0
ファイル: run.py プロジェクト: team-soran/soran
def current(_config, verbose, head_only):
    alembic_current(_config.alembic_config, verbose, head_only)
コード例 #6
0
ファイル: cli.py プロジェクト: admire93/soran-1
def current():
    """현재 리비전이 어떤 리비전인지 보여줍니다.
    """
    return alembic_current(alembic_config())
コード例 #7
0
ファイル: cli.py プロジェクト: kanghyojun/soran2
def current():
    """현재 리비전이 어떤 리비전인지 보여줍니다.
    """
    return alembic_current(alembc_config())
コード例 #8
0
ファイル: cli.py プロジェクト: admire93/sc2statistics
def current():
    """Current revision."""
    engine = get_engine()
    config, _ = get_alembic_config(engine)
    return alembic_current(config)
コード例 #9
0
def current(_config, verbose, head_only):
    alembic_current(_config.alembic_config, verbose, head_only)
コード例 #10
0
def current():
    """Current revision."""
    engine = get_engine()
    config, _ = get_alembic_config(engine)
    return alembic_current(config)