Пример #1
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'
Пример #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
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
    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
def current(_config, verbose, head_only):
    alembic_current(_config.alembic_config, verbose, head_only)
Пример #6
0
def current():
    """현재 리비전이 어떤 리비전인지 보여줍니다.
    """
    return alembic_current(alembic_config())
Пример #7
0
def current():
    """현재 리비전이 어떤 리비전인지 보여줍니다.
    """
    return alembic_current(alembc_config())
Пример #8
0
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)