hydromodpy.results.catalog.migrations#

Catalog DuckDB schema migrations.

Thin wrapper that binds the generic migration runner from hydromodpy.core.migrations to the bundled SQL directory and to the "catalog" component name.

Functions

apply_migration(connection, migration)

Apply one catalog migration in a transaction.

apply_migrations(db_path[, versions_dir])

Open db_path and apply pending catalog migrations.

current_version(connection)

Return the highest applied catalog migration version (0 if none).

discover_migrations([versions_dir])

Discover catalog migrations under versions_dir or the bundled dir.

ensure_schema(connection, *[, versions_dir, ...])

Bring the catalog DuckDB schema up to the latest bundled version.

target_version([versions_dir])

Return the highest catalog migration version present on disk.