hydromodpy.data.registry.migrations#

Data cache DuckDB schema migrations.

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

Functions

apply_migration(connection, migration)

Apply one data cache migration in a transaction.

apply_migrations(db_path[, versions_dir])

Open db_path and apply pending data cache migrations.

current_version(connection)

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

discover_migrations([versions_dir])

Discover data cache migrations under versions_dir or the bundled dir.

ensure_schema(connection, *[, versions_dir])

Bring the data cache DuckDB schema up to the latest bundled version.

target_version([versions_dir])

Return the highest data cache migration version present on disk.