Yoyo cloud builds on top of Yoyo migrations and allows appying SQL migrations that are stored in cloud storage.
from yoyo import get_backend
from yoyo_cloud import read_s3_migrations
if __name__ == "__main__":
migrations = read_s3_migrations(paths=["s3://bucket/yoyo-migrations-s3/"])
backend = get_backend(f"postgresql://postgres:my-secret-pw@localhost:5432/postgres")
with backend.lock():
# -- Apply any outstanding migrations
backend.apply_migrations(backend.to_apply(migrations))