paper_firehose.commands.migrate_db

Database migration command.

Migrates existing databases to the optimised schema: - Archives raw_data to a separate raw_archive.db - Drops the raw_data column from all three databases - Applies performance pragmas (auto_vacuum, page_size) - Runs VACUUM to reclaim space

Functions

run(config_path, *[, skip_archive, dry_run])

Run the database migration.

paper_firehose.commands.migrate_db.run(config_path, *, skip_archive=False, dry_run=False)[source]

Run the database migration.

  1. Back up all three DBs

  2. Archive raw_data to raw_archive.db (unless –skip-archive)

  3. Rebuild tables without raw_data column

  4. Drop stale FTS indexes (rebuilt on next DB open)

  5. Apply pragmas and VACUUM

Return type:

None

Parameters: