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'
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() == ""
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
def current(_config, verbose, head_only): alembic_current(_config.alembic_config, verbose, head_only)
def current(): """현재 리비전이 어떤 리비전인지 보여줍니다. """ return alembic_current(alembic_config())
def current(): """현재 리비전이 어떤 리비전인지 보여줍니다. """ return alembic_current(alembc_config())
def current(): """Current revision.""" engine = get_engine() config, _ = get_alembic_config(engine) return alembic_current(config)