db-patch-history

This tool allow manage the patches stored with db-patch (through the option –enable-historic).

The meta-information about patches is stored in a SQLite database (by default placed in ~/.db-patch/historical.sqlite). The physical patches executed (provided by the option -f) are copied by default are copied into ~/.db-patch/patches, and the SQL generated is stored by default in ~/.db-patch/sqls.

Note that to make a backup of the historical is very simple; Only it is necessary copy the directory that store the SQLite database and the patches.

These default values could be customized using a configuration file. For use a configuration file for db-patch it is necessary to use the option –history-cfg; for use a configuration file for db-patch-history it is necessary to use the option -c. Next it is shown a configuration file example.

[historical_db]

# Base path for store the database, the patches and the SQL generated
base_path = ~/.db-patch

# SQLite db name to store historical entries
db_name = historical.sqlite

# Relative path to base_path where the patches will be stored
patch_path = patches

# Relative path to base_path where the SQL generated will be stored
sql_path = sqls

Man page

db-patch-history

SYNOPSIS

db-patch-history [options]

DESCRIPTION

This program allow manage the database that store the patches applied with db-patch.

The database used by default (located in ~/.db-patch/db) can be customized providing a configuration file.

It is mandatory provide a query (-q option). The section QUERIES explain all the command queries. Note that the delete operations delete the full entry. That is, remove the entry, the patch, and the generated SQL.

OPTIONS

-h, –help
Show the help message and exit
-c, –config
Allow provide a customized configuration file. The /usr/share/doc/db-patch/historical.cfg.default file contains an exmple with the default values used by the tool.
-q, –query
Database password. Mandatory
–commands
Show the command queries

QUERIES

list all
List all the entries
list db [db-name]
List all the entries of the specified database
list host [hostname]
List all the entries of the specified host name
list since [YYYY-MM-DD]
List all the entries since the specified date
list until [YYYY-MM-DD]
List all the entries until the specified date
list between [id_number] [id_number]
List all the entries between two identifiers. The identifiers are included
delete all
Delete all the entries
delete db [db-name]
Delete all the entries of the specified database
delete host [hostname]
Delete all the entries of the specified host name
delete since [YYYY-MM-DD]
Delete all the entries since the specified date
delete until [YYYY-MM-DD]
Delete all the entries until the specified date
delete between [id_number_minor] [id_number_major]
Delete all the entries between two identifiers. The identifiers are included.
see [id_number]
Show the patch and the generated SQL in the stdout
export [id_number]+ [dst_directory]
Export the patch and the generated SQL to the provided directory. The directory must exist.

EXAMPLES

db-patch-history -q “list all”

db-patch-history -q “export 12 13 14 ~/output_dir”

db-patch-history -q “see 24”

db-patch-history -q “list since 2013-12-31”

db-patch-history -q “delete between 10 123”

db-patch-history -q “delete until 2013-12-31”

SEE

db-patch

Author

Miguel A. Martínez Pinedo <miguel.mpinedo@gmail.com>

Wrote this manpage for the Debian system.

Table Of Contents

Previous topic

db-patch

This Page