db-doc
The db-doc
command generates documentation in a Javadoc format based on the existing database and changelogs.
Uses
The db-doc
command is typically used to generate database documentation with the change information stored in the changelogs and the existing database. It captures the current state of your database including everything that has been performed against it.
The image below shows an example of the database documentation.
Note: For more information, see the changelogDocs.zip
file, which shows an example of the database documentation structure with the related directories and files.
Running the db-doc
command
To run the db-doc
command, specify the driver, classpath, and URL in your Liquibase properties file. For more information, see Specifying Properties in a Connection Profile. You can also specify these properties from the command line.
Tip: All commands and parameters use the --kebab-case
format in the CLI environment. This is the format Liquibase recommends for best results. If your preference is camelCase, it will still work in the CLI.
Then run the db-doc
command:
liquibase --changelog-file=myChangelog.xml db-doc changelogDocs
Note: Enter the name of the changelog and the output directory that you want to use in place of myChangelog.xml
and changelogDocs
. Also, it is best practice to specify a new empty directory for the files path because the db-doc
command creates its own directories, the CSS file, and multiple .html
files.
db-doc
global attributes
Attribute | Definition | Requirement |
---|---|---|
|
The root changelog |
Required |
|
The JDBC database connection URL |
Required |
|
The database username |
Required |
|
The database password |
Required |
Note: The username
and password
attributes are not required for connections and systems which use alternate means of authentication.
db-doc
command attributes
Attribute | Definition | Requirement |
---|---|---|
|
The directory where the database documentation is generated. |
Required |
db-doc
example output
Liquibase Pro 4.3.0 by Liquibase Enterprise licensed to Liquibase Pro Customer until Tue Sep 22 19:00:00 CDT 2020
Liquibase command 'db-doc' was executed successfully.