Docs/Commands/clean
OSSgenerated from cli/_parser_setup.py
dblift clean
Drop every object in the target schema, including the schema history table. Intended for disposable development and test databases.
Synopsis
$ dblift clean [--clean-enabled | --clean-disabled]
[--show-query-results]
[--strict] [--table TABLE]Options
FlagDescription
--tableCustom schema history table name (default: dblift_schema_history)--strictEnable strict mode - fail if any previously applied migration is missing and require migrations to be applied in strict version order--show-query-resultsShow rows returned by SELECT statements in command output and reports--clean-enabledAllow destructive clean execution. Without this flag, clean is disabled by default.--clean-disabledDisable destructive clean execution (default).Global flags apply to every command: --config, --env, --scripts, --dry-run, --quiet, --log-level. See global flags.
Examples
List what would be dropped, without dropping it
$ dblift clean --dry-run┏━━━━━━━━━━━━━━━━━━━━━━━ DBLIFT DATABASE MIGRATION LOG ━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Timestamp: 2026-01-15 12:00:00 ┃ ┃ Dblift version: 3.9.0 ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ DBLIFT COMMAND: CLEAN ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Connected to database ./app.db (SQLite) ┃ ┃ Database: ./app.db ┃ ┃ Schema: main ┃ ┃ Schema Version: 1.2.0 ┃ ┃ Database URL: sqlite:///./app.db ┃ ┃ Filtering Options: --dry-run ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛ DRY RUN: Would clean schema 'main' Would drop table: dblift_migration_lock Would drop table: dblift_schema_history Would drop table: users ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ SUCCESS ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ ┃ Command CLEAN completed successfully (Execution time: 12 ms) ┃ ┃ Schema Version: 1.2.0 ┃ ┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
Reset a local development database
$ dblift clean --clean-enabled --env localExit codes
CodeMeaning
0Command completed successfully4A paid-edition feature was invoked without a valid licence (EXIT_LICENSE_REQUIRED)