Docs/Configuration/Overview & precedence
OSS

Configuration

One file describes the database, where migrations live, and how each environment differs. Nothing in it is required except the database — every other section has a working default.

Where configuration comes from

DBLift needs at least one source. Pass a file, pass a URL, or set one environment variable — any of the three is enough on its own.

dblift --config ./dblift.yaml info
dblift --db-url "postgresql://localhost:5432/mydb" info
export DBLIFT_DB_URL="postgresql://localhost:5432/mydb"

No configuration source provided

Pass --config, --db-url, or set DBLIFT_DB_URL.

The sections

SectionEditionWhat it covers
databaseOSSWhich engine, where it lives, and how to authenticate. The only required section.
migrationsOSSWhere migration files are found, how they are named, and which ones a run considers.
loggingOSSLevel, destination file or directory, and output format.
secretsOSSWhere credentials are read from, so they never sit in the file.
environmentsOSSNamed overlays on everything above. Selected with --env or DBLIFT_ENV.
validationPro / EnterpriseThresholds and a custom rules_file on Pro. Named profiles and the built-in packs beyond security on Enterprise.
data_setsPro / EnterpriseNamed sets of audited DML. data new/plan/apply/status are Pro; undo and capture are Enterprise.
zero_downtimePro / EnterpriseBackfill settings, enforce, and allow_drops. Table and column drops also need --approved-by.

Root keys

A handful of settings sit at the top level rather than inside a section.

KeyDefaultWhat it does
history_tabledblift_schema_historyTable that records every applied migration.
snapshot_tabledblift_schema_snapshotsTable that stores captured schema snapshots.
max_snapshots—How many snapshots to retain before the oldest is dropped.
strict_modefalseEnforces Flyway-compatible strict validation rules.
clean_disabledtrueGuards dblift clean. Must be turned off deliberately before it will run.
placeholders{}Values substituted into SQL at apply time.
installed_by—Name written to the Installed By column instead of the database user.

Precedence

When the same setting is given twice, the higher source wins. Nothing is merged field by field except the environment block, which overlays the root sections.

OrderSourceNotes
1CLI flagHighest. Wins over everything below.
2Environment variableAny recognised DBLIFT_* name.
3Environment blockThe selected block under environments:.
4Root sectionThe shared base.
5Built-in defaultWhat you get having said nothing.

Which environment block is selected is itself resolved in order: --env, then DBLIFT_ENV, then a branch map if you have configured one, then none.

Environment variables

Connection settings follow one convention: DBLIFT_DB_<FIELD> sets database.<field>. The accepted names are an explicit list — an unrecognised one is ignored rather than applied, so an unrelated CI variable can never shadow a real setting.

VariableSets
DBLIFT_ENVSelects the environment block. Overridden by --env; the variable name itself can be changed with resolve.env_var.
DBLIFT_DB_URLFull connection URL. Enough on its own — no config file needed.
DBLIFT_DB_TYPEEngine key, when the URL does not carry it.
DBLIFT_DB_HOST / _DATABASE / _SCHEMA / _INSTANCEConnection parts, if you would rather not assemble a URL.
DBLIFT_DB_USER / _USERNAME / _PASSWORDCredentials. Both user spellings map to the same field.
DBLIFT_DB_PORT / _CONNECTION_TIMEOUTRead as integers. A non-numeric value is reported, not silently dropped.
DBLIFT_DB_ENCRYPT / _TRUST_SERVER_CERTIFICATE / _INTEGRATED_SECURITY / _USE_MANAGED_IDENTITYBooleans — true, 1 and yes all count as true.
DBLIFT_DB_OPTIONS / _SESSION_VARS / _EXTRA_PARAMS / _PROPERTIESStructured values, given as JSON or comma-separated key=value pairs.
DBLIFT_DB_ACCOUNT_ENDPOINT / _ACCOUNT_KEY / _DATABASE_NAME / _CONTAINER_NAMEAzure Cosmos DB connection fields.
DBLIFT_HISTORY_TABLE / DBLIFT_SNAPSHOT_TABLE / DBLIFT_MAX_SNAPSHOTSThe three root keys that can be set from the environment.
On this page