def flatten( alembic_home_dir: pathlib.Path = typer.Option( "etc/alembic/versions", exists=True, help="The directory where the alembic migrations live", ), ): home = MigrationHome(alembic_home_dir) home.flatten()
def test_flatten(self, scripts_dir): home = MigrationHome(scripts_dir) home.flatten() assert MigrationHome(scripts_dir).generate_dependency_graph() == { "aaaaaa": {None}, "bbbbbb": {"aaaaaa"}, "cccccc": {"bbbbbb"}, "dddddd": {"cccccc"}, "eeeeee": {"dddddd"}, "ffffff": {"eeeeee"}, "gggggg": {"ffffff"}, }