Skippr is now Manifold.

Skip to content

mfd migrate ​

mfd migrate applies migrations/*.sql next to mfd.yml. Each file is one atomic ALTER TABLE batch. Mfd records the file in the Manifold Store journal family so a retry is idempotent: the same id and checksum is a no-op, a changed file with the same id fails closed.

Python authors those files; migrate never loads .py. Declared transform.compute type: py does load the file in path. Session.migrate() is the same path as the CLI.

You do not stop the pipeline. Apply is in-stream. DISABLE PIPELINE still freezes ingest; it is not the ALTER gate.

Usage ​

bash
mfd migrate --pipeline <NAME> [--down] [--config <path>] [--log [LEVEL]]

Options ​

FlagDefaultDescription
-p, --pipeline <NAME>NonePipeline whose migrations/ apply. Required in practice when several pipelines share a config.
--downOffApply -- migrate:down instead of -- migrate:up. Only Rename may have a down section.

See CLI overview for global flags (--config, --store-type, --wal-storage, …).

Examples ​

Apply pending files, then sync:

bash
mfd migrate --pipeline bikehire
mfd sync --pipeline bikehire --once

Roll back a Rename with --down:

bash
mfd migrate --pipeline bikehire --down

Author a file ​

python
from mfd import Migration

Migration(
    "20261020_rename_region",
    up="ALTER TABLE bikehire.trips RENAME COLUMN region TO region_code;",
    down="ALTER TABLE bikehire.trips RENAME COLUMN region_code TO region;",
).write("migrations")

Files use -- migrate:up (optional) and -- migrate:down (optional, Rename only).

sql
-- migrate:up
ALTER TABLE bikehire.trips RENAME COLUMN region TO region_code;

-- migrate:down
ALTER TABLE bikehire.trips RENAME COLUMN region_code TO region;

down() is only valid for Rename. Promote, Drop, and Merge fail closed if a -- migrate:down section is present.

Query ALTER ​

mfd query --sql "ALTER TABLE …" uses the same apply path. Mfd journals it as query-<checksum> in Manifold Store, so repeating the same statement is safe.

Prefer files in migrations/ for anything you want in git. Use query ALTER for a one-off.

What apply does ​

For each pending file, Mfd:

  1. Loads the journal from Manifold Store under the writer lock.
  2. Rewrites live WAL so later ingest uses the new names and types.
  3. Applies table DDL on destinations that advertise it (Iceberg: ManifoldLake, Athena Iceberg, DuckDB; plus Snowflake, Postgres, BigQuery, Redshift, MotherDuck). Glue/Hive and ClickHouse fail closed.
  4. Appends the ALTER output log (schema family) and commits the journal row (id, checksum, phase). Source discover metadata is unchanged. A crash mid-apply resumes from that phase; it does not double-apply a finished file.

Iceberg keeps the field id, so existing Parquet stays readable after rename.

Statements: RENAME COLUMN, MERGE COLUMN, DROP COLUMN, ALTER COLUMN … TYPE. TO is one identifier; a dotted TO such as detail.region fails closed. See ALTER operations for the matrix and fail-closed cases.

Manifold Store ​

Migrations do not use a second KV. Journal, schema, and WAL catalog share Manifold Store with ingest. One writer. See Manifold Store.

Next steps ​