diff --git a/README.md b/README.md index 3e08791..f229c02 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ Only requirement is that migration files follow the pattern `V99__Some_name.[sql ### Patch and override files -For each migration file that needs to be corrected a pair of `.patch.sql` and `.override.sql` must exists. +For each migration file that needs to be corrected a pair of `.patch.sql` and `.override.sql` must exist. The behaviour will follow these rules: - **WHEN** file`.sql` exists and was executed **AND** file`.patch.sql`, file.override.sql pair exists -> apply patch @@ -25,33 +25,33 @@ If for a given file there is only either a single .patch or a single .override t MigTool is designed to be embedded in the target app. Use the following idiom: ```groovy - MigTool tool = new MigTool(); + MigTool tool = new MigTool.Builder() .withDriver('org.h2.Driver') .withDialect('h2') .withUrl('jdbc:h2:mem:test') .withUser('sa') .withPassword('') .withLocations('classpath:test') + .build() try { - tool.run(); + tool.run() } finally { - tool.close(); + tool.close() } ``` ## Binary release -MigTool is also released as a pre-compiled Linux binary including H2 and MySQL drivers. To use it, download the -binary package at [this link](https://github.com/seqeralabs/migtool/releases/latest), then grant execute permission, -finally run it following the example below: +MigTool is also released as a pre-compiled Linux binary including H2, MySQL and Postgres drivers. To use it, download the +binary package at [this link](https://github.com/seqeralabs/migtool/releases/latest), then grant execute permission, finally run it following the example below: ```bash ./migtool \ --username \ --password \ - --url jdbc:mysql://:3306/ \ + --url jdbc:://:3306/ \ --location file:/path/to/migration/scripts ``` @@ -66,9 +66,11 @@ finally run it following the example below: * `password`: Target database connection password. * `url`: Target database JDBC connection URL. * `location`: File system path where migration scripts are located. Path must be prefixed with `file:`. -* `dialect`: Either `mysql` or `h2` (optional). +* `dialect`: Either `mysql`, `h2` or `postgres` (optional). * `driver`: JDBC driver class name to connect the target database (optional). +In case the `driver` or `dialect` options are not provided, the tool will try to infer the driver class name from the `url` provided. + ## License [Mozilla Public License v2.0](LICENSE.txt)