julian_knight
07/08/2022, 3:18 PM$PATH issue, we ended up migrating our meltano metadata db to v2 (including the table rename from job to runs, 5b43800443d1) while our code was still expecting v1.
Rolling back was painful but I managed to do it in the python interpreter by stealing code from MigrationService.py. Positing here in case anyone else finds themselves in this situation:
from meltano.core.project import Project
from meltano.core.db import project_engine
from meltano.migrations import MIGRATION_DIR
from alembic import command
from alembic.config import Config
from alembic.script import ScriptDirectory
from alembic.runtime.migration import MigrationContext
project = Project('/project')
engine, _ = project_engine(project, default=True)
conn = engine.connect()
cfg = Config()
cfg.attributes["connection"] = conn
cfg.set_main_option("script_location", str(MIGRATION_DIR))
script = ScriptDirectory.from_config(cfg)
context = MigrationContext.configure(conn)
command.downgrade(cfg, '13e8639c6d2b')
conn.close()