Skip to content

Yoyo database migrations

Yoyo is a Python database schema migration tool. You write migrations as Python scripts containing raw SQL statements or Python functions. They can be as simple as this:

# file: migrations/

from yoyo import step

steps = [
        "CREATE TABLE foo (id INT, bar VARCHAR(20), PRIMARY KEY (id))",
        "DROP TABLE foo"


pip install yoyo-database-migrations