Skip to main content
`Ctrl`+`K`

# Migration

class beets.dbcore.db.Migration(db: Database)

  Bases: `ABC`

  Define a one-time data migration that runs during database startup.

  __init__(db: Database) → None

  Public methods summary

  `migrate_model`(model_cls, current_fields) | Run this migration once for a model's backing table.
  `with_row_factory`(factory) | Temporarily decode query rows into a typed tuple shape.

  Methods definition

  with_row_factory(factory: type[NamedTuple]) → Iterator[None]

    Temporarily decode query rows into a typed tuple shape.

  migrate_model(model_cls: type[Model], current_fields: set[str]) → None

    Run this migration once for a model’s backing table.