def cmd_status(args, cfg): cfg = get_db_config(cfg, args.database) repo = create_repo(cfg) backend = create_backend(cfg) engine = MigrantEngine(backend, repo, cfg) actions = engine.status() if actions: log.info("Pending actions: %s", actions) else: log.info("Up-to-date")
def cmd_upgrade(args, cfg: Dict[str, str]) -> None: cfg = get_db_config(cfg, args.database) repo = create_repo(cfg) backend = create_backend(cfg) engine = MigrantEngine( backend, repo, cfg, dry_run=args.dry_run, processes=args.parallel, ) engine.update(args.revision)
def cmd_test(args, cfg): cfg = get_db_config(cfg, args.database) repo = create_repo(cfg) backend = create_backend(cfg) engine = MigrantEngine(backend, repo, cfg) engine.test(args.revision)
def cmd_new(args, cfg): cfg = get_db_config(cfg, args.database) repo = create_repo(cfg) revname = repo.new_script(args.title) backend = create_backend(cfg) backend.on_new_script(revname)
def cmd_init(args, cfg): cfg = get_db_config(cfg, args.database) repo = create_repo(cfg) repo.init() backend = create_backend(cfg) backend.on_repo_init()