{"id":37027525,"url":"https://github.com/kkrakovych/database-maven-plugin","last_synced_at":"2026-01-14T03:16:23.171Z","repository":{"id":46768016,"uuid":"138421054","full_name":"kkrakovych/database-maven-plugin","owner":"kkrakovych","description":"Database Maven Plugin","archived":false,"fork":false,"pushed_at":"2021-09-27T09:12:41.000Z","size":535,"stargazers_count":3,"open_issues_count":12,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2024-11-16T03:03:30.049Z","etag":null,"topics":["database","oracle","plugin","postgresql"],"latest_commit_sha":null,"homepage":"","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kkrakovych.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-23T17:30:45.000Z","updated_at":"2023-01-27T06:50:51.000Z","dependencies_parsed_at":"2022-09-02T12:11:53.890Z","dependency_job_id":null,"html_url":"https://github.com/kkrakovych/database-maven-plugin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/kkrakovych/database-maven-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkrakovych%2Fdatabase-maven-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkrakovych%2Fdatabase-maven-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkrakovych%2Fdatabase-maven-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkrakovych%2Fdatabase-maven-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kkrakovych","download_url":"https://codeload.github.com/kkrakovych/database-maven-plugin/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kkrakovych%2Fdatabase-maven-plugin/sbom","scorecard":{"id":562805,"data":{"date":"2025-08-11","repo":{"name":"github.com/kkrakovych/database-maven-plugin","commit":"4afd89f379b46889562498bc7cc538df84df7060"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.9,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 0/3 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":["Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/install_auto.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/install_manual.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/deploy_information.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/input_parameters_auto.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/input_parameters_manual.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/log_finish.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/log_start.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/one_time_control.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/one_time_do_after.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/one_time_do_before.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/one_time_do_checksum.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/one_time_do_nothing.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/one_time_do_success.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/run_file.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/run_query.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/script_information.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/common/source.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/database/install_database_${database.name}.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/object/install_object_${schema.index}_${schema.name}_${object.index}_${object.type}.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/schema/install_schema_${schema.index}_${schema.name}.sh:0","Info: Possibly incomplete results: error parsing shell code: \u003c must be followed by a word: src/main/resources/clickhouse/service/script/install_script_${schema.index}_${schema.name}_${script.condition}_${script.index}.sh:0"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'develop'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":9,"reason":"1 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-j288-q9x7-2f5v"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 30 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T14:10:11.348Z","repository_id":46768016,"created_at":"2025-08-20T14:10:11.348Z","updated_at":"2025-08-20T14:10:11.348Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28408824,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T01:52:23.358Z","status":"online","status_checked_at":"2026-01-14T02:00:06.678Z","response_time":107,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","oracle","plugin","postgresql"],"created_at":"2026-01-14T03:16:22.270Z","updated_at":"2026-01-14T03:16:23.166Z","avatar_url":"https://github.com/kkrakovych.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Database Maven Plugin\n\n[![Build Status](https://travis-ci.com/kkrakovych/database-maven-plugin.svg?branch=develop)](https://travis-ci.com/kkrakovych/database-maven-plugin)\n\n## Main Idea of the Plugin\n\nThe plugin creates database migration scripts to update databases from version to version.\n\nWe believe database migration scripts should be automated.\nWe believe all database objects, source code, and data dictionaries should be under version source control.\nThus creation of database migration scripts should be performed based on files under version source control only.\nFurther deploy of these scripts to databases should be easy and simple to automate but still allow manual deploy as well.\n\n## Strategies for Database Migration Scripts\n\nAt the moment plugin supports one strategy - 'Full Source Code Drop and Create'.\n\nThe strategy contains next steps:\n- deploy scripts before source code drop;\n- drop existent source code;\n- deploy actual source code;\n- deploy scripts after source code validation.\n\nConfiguration in pom.xml defines:\n- database;\n- schemes if any;\n- groups of database objects;\n  - type of objects within a group\n  - location of the group in repository\n- location of database objects within repository;\n- location of DDL (Data Definition Language) and DML (Data Manipulation Language) scripts;\n- order for execution of groups of scripts.\n\n#### Oracle\n\n0. Fail fast in case of any issue;\n1. Execute scripts before source code processing;\n2. Execute source code processing.\n   Supported objects are: functions, package specifications and bodies, procedures, triggers, type specifications and bodies, and views;\n3. Execute scripts after source code processing.\n\n#### PostgreSQL\n\n0. Fail fast in case of any issue;\n1. Execute scripts before source code processing;\n2. Execute source code processing.\n   Supported objects are: functions, triggers, and views;\n3. Execute scripts after source code processing.\n\n#### ClickHouse\n\n0. Fail fast in case of any issue;\n1. Execute scripts before source code processing;\n2. Execute source code processing.\n   Supported objects are: materialized views and views;\n3. Execute scripts after source code processing.\n\nP.S. No source code dropping.\nP.P.S. The migration script is based on unix shell scripts.\n\n## How to add the plugin to database maven build\n\nAdd new plugin to build section and set up configuration.\n\n```xml\n\u003cbuild\u003e\n    \u003cplugins\u003e\n        \u003cplugin\u003e\n            \u003cgroupId\u003enet.kosto\u003c/groupId\u003e\n            \u003cartifactId\u003edatabase-maven-plugin\u003c/artifactId\u003e\n            \u003cversion\u003e1.4-SNAPSHOT\u003c/version\u003e\n            \u003cconfiguration\u003e\n                ...\n            \u003c/configuration\u003e\n        \u003c/plugin\u003e\n    \u003c/plugins\u003e\n\u003c/build\u003e\n```\n\nSnapshot versions of the plugin available at [Sonatype Central Repository](https://central.sonatype.org).\nIf you want to use them, add plugin repository section to configuration as below.\n\n```xml\n\u003cpluginRepositories\u003e\n    \u003cpluginRepository\u003e\n        \u003cid\u003esonatype-plugin-snapshots\u003c/id\u003e\n        \u003curl\u003ehttps://oss.sonatype.org/content/repositories/snapshots\u003c/url\u003e\n        \u003csnapshots\u003e\n            \u003cenabled\u003etrue\u003c/enabled\u003e\n        \u003c/snapshots\u003e\n    \u003c/pluginRepository\u003e\n\u003c/pluginRepositories\u003e\n```\n\n#### Main configuration section\n\n```xml\n\u003cplugin\u003e\n    ...\n    \u003cconfiguration\u003e\n        \u003clogFileName\u003e[log-file-name]\u003c/logFileName\u003e\n        \u003cserviceDirectory\u003e[service-directory-name]\u003c/serviceDirectory\u003e\n        ...\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n```\n\n| Tag Name           | Description |\n| ------------------ | ----------- |\n| `logFileName`      | Log file name. By default the name will be generated automatically as `install_[database-name]_[build-version]_[start-timestamp].log`. Any valid file name can be set to get stable log file name. As an example, `install.log`. |\n| `serviceDirectory` | Service directory name. By default set as `service`. Plugin creates the directory and puts all generated service scripts to it. Any valid directory name can be set to avert name coincidence. As an example, `.service`. |\n\nOther depends on database type.\n\n#### Oracle database configuration section\n\n```xml\n\u003cconfiguration\u003e\n    ...\n    \u003coracle\u003e\n        \u003cname\u003e[database name]\u003c/name\u003e\n        \u003csourceDirectory\u003e[database source code directory]\u003c/sourceDirectory\u003e\n        \u003cignoreDirectory\u003efalse\u003c/ignoreDirectory\u003e\n        \u003cdefineSymbol\u003e[symbol]\u003c/defineSymbol\u003e\n        \u003cignoreDefine\u003efalse\u003c/ignoreDefine\u003e\n        \u003cschemes\u003e\n            \u003cschema\u003e\n                \u003cindex\u003e1\u003c/index\u003e\n                \u003cname\u003e[schema name]\u003c/name\u003e\n                \u003csourceDirectory\u003e[schema source directory]\u003c/sourceDirectory\u003e\n                \u003cignoreDirectory\u003efalse\u003c/ignoreDirectory\u003e\n                \u003cobjects\u003e\n                    \u003cobject\u003e\n                        \u003cindex\u003e1\u003c/index\u003e\n                        \u003ctype\u003e[object type]\u003c/type\u003e\n                        \u003csourceDirectory\u003e[object type source directory]\u003c/sourceDirectory\u003e\n                        \u003cignoreDirectory\u003efalse\u003c/ignoreDirectory\u003e\n                        \u003cfileMask\u003e*.sql\u003c/fileMask\u003e\n                    \u003c/object\u003e\n                    ...\n                \u003c/objects\u003e\n                \u003cscripts\u003e\n                    \u003cscript\u003e\n                        \u003ctype\u003eONE_TIME\u003c/type\u003e\n                        \u003ccondition\u003eBEFORE\u003c/condition\u003e\n                        \u003cindex\u003e1\u003c/index\u003e\n                        \u003csourceDirectory\u003e[script source directory]\u003c/sourceDirectory\u003e\n                        \u003cignoreDirectory\u003efalse\u003c/ignoreDirectory\u003e\n                        \u003cfileMask\u003e*.sql\u003c/fileMask\u003e\n                    \u003c/script\u003e\n                    ...\n                \u003c/scripts\u003e\n            \u003c/schema\u003e\n            ...\n        \u003c/schemes\u003e\n    \u003c/oracle\u003e\n\u003c/configuration\u003e\n```\n\n###### `oracle` Tag\n\n| Tag Name          | Description |\n| ----------------- | ----------- |\n| `name`            | Database name. By default set as `database`. |\n| `sourceDirectory` | Source directory for all database's objects. By default database name is used as source directory. |\n| `ignoreDirectory` | If `true` source directory will be ignored. By default set as `false`. |\n| `defineSymbol`    | Define symbol for variable substitution. By default set as `\u0026`. The option affects all sub objects recursively. |\n| `ignoreDefine`    | If `true` variable substitution will be disabled. By default set as `true`. The option affects all sub objects recursively. |\n| `schemes`         | List of database's schemes for deploy. |\n\n###### `schemes` Tag\n\n| Tag Name              | Description |\n| --------------------- | ----------- |\n| `ignoreServiceTables` | If `true` service tables will be ignored for the schema only. By default set as `false`. It makes sense to use the option for _proxy_ schemes or schemes without `CREATE TABLE` privilege. However if service tables are ignored there no way to run `ONE_TIME` scripts. |\n| `index`               | Schema's index (integer). Affects schema processing order. It should be either set for every `schema` and unique or missing. If it is missing for every `schema`, natural order of schemes in configuration will be used. |\n| `name`                | Schema name. By default set as `schema`. |\n| `sourceDirectory`     | Source directory for all schema's objects. By default schema name is used as source directory. |\n| `ignoreDirectory`     | If `true` source directory will be ignored. By default set as `false`. |\n| `defineSymbol`        | Define symbol for variable substitution. By default takes value set for database. |\n| `ignoreDefine`        | If `true` variable substitution will be disabled. By default takes value set for database. |\n| `objects`             | List of schema's objects for deploy if any. |\n| `scripts`             | List of schema's scripts for deploy if any. |\n\n###### `objects` Tag\n\n| Tag Name          | Description |\n| ----------------- | ----------- |\n| `index`           | Objects' index (integer). Affects objects processing order. It should be either set for every `object` and unique or missing. If it is missing for every `object`, natural order of objects in configuration will be used. |\n| `type`            | Objects' type. Possible values are: `FUNCTION`, `PACKAGE_BODY`, `PACKAGE_SPEC`, `PROCEDURE`, `TRIGGER`, `TYPE_BODY`, `TYPE_SPEC`, `VIEW`.  |\n| `sourceDirectory` | Source directory for all objects' type. By default objects' types have next associated directories: `FUNCTION` - `functions`, `PACKAGE_BODY` - `package_bodies`, `PACKAGE_SPEC` - `package_specs`, `PROCEDURE` - `procedures`, `TRIGGER` - `triggers`, `TYPE_BODY` - `type_bodies`, `TYPE_SPEC` - `type_specs`, and `VIEW` - `views`. |\n| `ignoreDirectory` | If `true` source directory will be ignored. By default set as `false`. |\n| `defineSymbol`    | Define symbol for variable substitution. By default takes value set for schema. |\n| `ignoreDefine`    | If `true` variable substitution will be disabled. By default takes value set for schema. |\n| `fileMask`        | File mask for objects. By default set as `*.sql`. |\n\n###### `scripts` Tag\n\n| Tag Name          | Description |\n| ----------------- | ----------- |\n| `type`            | Scripts' type. Possible values are: `ONE_TIME` and `REUSABLE`. Affects how scripts will be used, one time only or every time during deploy. |\n| `condition`       | Scripts' condition. Possible values are: `BEFORE` and `AFTER`. Affects when scripts will be executed, before or after source code deploy. |\n| `index`           | Scripts' index (integer). Affects scripts processing order. It should be either set for every `script` and unique within script `type` or missing. If it is missing for every `script`, natural order of scripts in configuration will be used. |\n| `sourceDirectory` | Source directory for all scripts. By default scripts' type have next associated directories: `ONE_TIME` - `script_one_time` and `REUSABLE` - `script_reusable`. |\n| `ignoreDirectory` | If `true` source directory will be ignored. By default set as `false`. |\n| `defineSymbol`    | The option is not supported for scripts. |\n| `ignoreDefine`    | The option is not supported for scripts. |\n| `fileMask`        | File mask for objects. By default set as `*.sql`. |\n\n#### PostgreSQL database configuration section\n\n```xml\n\u003cconfiguration\u003e\n    ...\n    \u003cpostgresql\u003e\n        \u003cname\u003e[database name]\u003c/name\u003e\n        \u003csourceDirectory\u003e[database source code directory]\u003c/sourceDirectory\u003e\n        \u003cignoreDirectory\u003efalse\u003c/ignoreDirectory\u003e\n        \u003cobjects\u003e\n            \u003cobject\u003e\n                \u003cindex\u003e1\u003c/index\u003e\n                \u003ctype\u003e[object type]\u003c/type\u003e\n                \u003csourceDirectory\u003e[object type source directory]\u003c/sourceDirectory\u003e\n                \u003cignoreDirectory\u003efalse\u003c/ignoreDirectory\u003e\n                \u003cfileMask\u003e*.sql\u003c/fileMask\u003e\n            \u003c/object\u003e\n            ...\n        \u003c/objects\u003e\n        \u003cscripts\u003e\n            \u003cscript\u003e\n                \u003ctype\u003eONE_TIME\u003c/type\u003e\n                \u003ccondition\u003eBEFORE\u003c/condition\u003e\n                \u003cindex\u003e1\u003c/index\u003e\n                \u003csourceDirectory\u003e[script source directory]\u003c/sourceDirectory\u003e\n                \u003cignoreDirectory\u003efalse\u003c/ignoreDirectory\u003e\n                \u003cfileMask\u003e*.sql\u003c/fileMask\u003e\n            \u003c/script\u003e\n            ...\n        \u003c/scripts\u003e\n        \u003cschemes\u003e\n            \u003cschema\u003e\n                \u003cindex\u003e1\u003c/index\u003e\n                \u003cname\u003e[schema name]\u003c/name\u003e\n                \u003csourceDirectory\u003e[schema source directory]\u003c/sourceDirectory\u003e\n                \u003cignoreDirectory\u003efalse\u003c/ignoreDirectory\u003e\n                \u003cobjects\u003e\n                    \u003cobject\u003e\n                        \u003cindex\u003e1\u003c/index\u003e\n                        \u003ctype\u003e[object type]\u003c/type\u003e\n                        \u003csourceDirectory\u003e[object type source directory]\u003c/sourceDirectory\u003e\n                        \u003cignoreDirectory\u003efalse\u003c/ignoreDirectory\u003e\n                        \u003cfileMask\u003e*.sql\u003c/fileMask\u003e\n                    \u003c/object\u003e\n                    ...\n                \u003c/objects\u003e\n                \u003cscripts\u003e\n                    \u003cscript\u003e\n                        \u003ctype\u003eONE_TIME\u003c/type\u003e\n                        \u003ccondition\u003eBEFORE\u003c/condition\u003e\n                        \u003cindex\u003e1\u003c/index\u003e\n                        \u003csourceDirectory\u003e[script source directory]\u003c/sourceDirectory\u003e\n                        \u003cignoreDirectory\u003efalse\u003c/ignoreDirectory\u003e\n                        \u003cfileMask\u003e*.sql\u003c/fileMask\u003e\n                    \u003c/script\u003e\n                `   ...\n                \u003c/scripts\u003e\n            \u003c/schema\u003e\n            ...\n        \u003c/schemes\u003e\n    \u003c/postgresql\u003e\n\u003c/configuration\u003e\n```\n\n## How to make database build with the plugin\n\nExecute next command and check output directory.\n```bash\nmvn database:package\n```\n\nIn output directory you will find next things:\n1. Script install_auto.sql - Main SQL script for deploy via script.\n2. Script install_manual.sql - Main SQL script for deploy with manual input.\n3. Service directory - All service scripts required for deploy.\nThe directory name by default is `service`.\nThe name can be changed with `serviceDirectory` parameter in `configuration` section of the plugin.\n4. Database directory and sub directories - All database source code and scripts required for deploy.\nContent of the directory may vary dependent on configuration of the plugin.\n\n## How to deploy result script\n\nPlease take into account before the script execution you will need to install and setup:\n1. [Oracle Instant Client](http://www.oracle.com/technetwork/database/database-technologies/instant-client/overview/index.html) with Oracle SQL*Plus;\n2. `tnsnames.ora` [configuration file](https://docs.oracle.com/database/121/NETRF/tnsnames.htm#NETRF007);\n3. `ORACLE_HOME`, `TNS_ADMIN` and `NLS_LANG` system variables should be set properly;\n4. Oracle SQL*Plus should be available for execution via `PATH` system variable.\n\n#### Automatically\n\n###### ClickHouse\n\nThe main script for automatic deploy can be executed from Unix shell either with direct credentials:\n```bash\n./install_auto.sh -h [hostname] -u [username] -p [password]\n```\nor with configuration file: \n```bash\n./install_auto.sh -h [hostname] -u [username] -p [password]\n```\nSample configuration file:\n```xml\n\u003cconfig\u003e\n    \u003chost\u003ehostname\u003c/host\u003e\n    \u003cuser\u003eusername\u003c/user\u003e\n    \u003cpassword\u003epassword\u003c/password\u003e\n    \u003csecure\u003eFalse\u003c/secure\u003e\n\u003c/config\u003e\n```\n\n###### Oracle\n\nThe main script for automatic deploy can be executed with Oracle SQL*Plus.\n```bash\nsqlplus /nolog @install_auto.sql [tns-name] [user-schema-1] [user-password-1] [user-schema-2] [user-password-2] ...\n```\n\n###### PostgreSQL\n\nThe main script for automatic deploy can be executed with PostgreSQL interactive terminal.\n```bash\npsql -h [host] -p [port] -U [user-name] -W [user-password] -d [database-name] -f install.sql\n```\n\nIf SSH tunnel is required, first session to create it\n```bash\nssh -L [port]:localhost:[port-remote] [user-remote]@[host-remote]\n```\nsecond session to connect database\n```bash\npsql -h localhost -p [port] -U [user-name] -W [user-password] -d [database-name] -f install.sql\n```\n\n#### Manually\n\n###### ClickHouse\n\nThe main script for deploy with manual input can be executed as:\n```bash\n./install_manual.sh\n```\n\n###### Oracle\n\nThe main script for deploy with manual input can be executed with Oracle SQL*Plus.\n```bash\nsqlplus /nolog @install_manual.sql\n```\n\nAt the beginning the script requests next parameters to be set:\n1. TNS name for database to deploy the script.\n2. For every schema in database: schema name and corresponding password.\nPlease take into account if no input on schema name request - schema name will be as is.\nThe same is true for password.\n\nPlease take into account - no waiting or pause after all mentioned parameters set before deploy.\n\nWe strongly recommend to turn off all connections to database before deploy to avert session blocking and errors.\n\nWe strongly recommend to test the script on prod-like environment before going live on production.\n\n## What does script execute\n\n1. Script shows brief information about itself: database name, build version and when it was created.\n2. Script requests all parameters required for deploy.\n3. Script checks all connections to schemes required for deploy.\n4. Script starts to spool all activities into log file with name `install_manual_${database_name}_${build_version}_${build_timestamp}.log`.\n5. Script prints detailed information about upcoming deploy.\n6. For every schema in database the script does next:\n   * Connects to the schema\n   * Checks service tables `deploy$version` and `deploy$scripts`. If they are missing than they will be created.\n   * Writes details about the deploy into `deploy$version` table.\n   * Deploys scripts before source code drop if set.\n   * Drops source code. Tables are not affected for sure.\n   * Deploys source code according to configuration of the plugin.\n   * Compiles invalid objects if any.\n   * Checks for invalid objects.\n   * Deploys scripts after source code deploy if set.\n\nThe script uses fail fast strategy. In case of any error deploy will be terminated. \n\n## Appendix A - Sample pom.xml for database-maven-plugin for Oracle\n\nYou may find sample projects in test directory.\nOne example is database called [oracle_a](https://github.com/kkrakovych/database-maven-plugin/blob/develop/src/test/resources/oracle_a/pom.xml).\nBelow you may see part of the project's pom.xml file.\n\n```xml\n\u003cplugin\u003e\n    \u003cgroupId\u003enet.kosto\u003c/groupId\u003e\n    \u003cartifactId\u003edatabase-maven-plugin\u003c/artifactId\u003e\n    \u003cversion\u003e1.4-SNAPSHOT\u003c/version\u003e\n    \u003cconfiguration\u003e\n        \u003cserviceDirectory\u003e.service\u003c/serviceDirectory\u003e\n        \u003coracle\u003e\n            \u003cname\u003edatabase\u003c/name\u003e\n            \u003cschemes\u003e\n                \u003cschema\u003e\n                    \u003cindex\u003e2\u003c/index\u003e\n                    \u003cname\u003eschema_a\u003c/name\u003e\n                    \u003cobjects\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e1\u003c/index\u003e\n                            \u003ctype\u003eTYPE_SPEC\u003c/type\u003e\n                        \u003c/object\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e2\u003c/index\u003e\n                            \u003ctype\u003eTYPE_BODY\u003c/type\u003e\n                        \u003c/object\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e3\u003c/index\u003e\n                            \u003ctype\u003eVIEW\u003c/type\u003e\n                        \u003c/object\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e4\u003c/index\u003e\n                            \u003ctype\u003ePROCEDURE\u003c/type\u003e\n                        \u003c/object\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e3\u003c/index\u003e\n                            \u003ctype\u003eFUNCTION\u003c/type\u003e\n                        \u003c/object\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e5\u003c/index\u003e\n                            \u003ctype\u003ePACKAGE_SPEC\u003c/type\u003e\n                        \u003c/object\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e6\u003c/index\u003e\n                            \u003ctype\u003ePACKAGE_BODY\u003c/type\u003e\n                        \u003c/object\u003e\n                    \u003c/objects\u003e\n                    \u003cscripts\u003e\n                        \u003cscript\u003e\n                            \u003ctype\u003eONE_TIME\u003c/type\u003e\n                            \u003ccondition\u003eBEFORE\u003c/condition\u003e\n                            \u003cindex\u003e1\u003c/index\u003e\n                            \u003csourceDirectory\u003escripts/delta\u003c/sourceDirectory\u003e\n                            \u003cfileMask\u003e*.sql\u003c/fileMask\u003e\n                        \u003c/script\u003e\n                        \u003cscript\u003e\n                            \u003ctype\u003eREUSABLE\u003c/type\u003e\n                            \u003ccondition\u003eAFTER\u003c/condition\u003e\n                            \u003cindex\u003e1\u003c/index\u003e\n                            \u003csourceDirectory\u003escripts/dictionaries\u003c/sourceDirectory\u003e\n                            \u003cfileMask\u003e*.sql\u003c/fileMask\u003e\n                        \u003c/script\u003e\n                    \u003c/scripts\u003e\n                \u003c/schema\u003e\n                \u003cschema\u003e\n                    \u003cindex\u003e1\u003c/index\u003e\n                    \u003cname\u003eschema_b\u003c/name\u003e\n                    \u003cobjects\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e1\u003c/index\u003e\n                            \u003ctype\u003eFUNCTION\u003c/type\u003e\n                            \u003csourceDirectory\u003efncs\u003c/sourceDirectory\u003e\n                            \u003cfileMask\u003e*.fnc\u003c/fileMask\u003e\n                        \u003c/object\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e2\u003c/index\u003e\n                            \u003ctype\u003ePROCEDURE\u003c/type\u003e\n                            \u003csourceDirectory\u003eprcs\u003c/sourceDirectory\u003e\n                            \u003cfileMask\u003e*.prc\u003c/fileMask\u003e\n                        \u003c/object\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e3\u003c/index\u003e\n                            \u003ctype\u003eVIEW\u003c/type\u003e\n                            \u003csourceDirectory\u003evws\u003c/sourceDirectory\u003e\n                            \u003cfileMask\u003e*.vw\u003c/fileMask\u003e\n                        \u003c/object\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e4\u003c/index\u003e\n                            \u003ctype\u003ePACKAGE_SPEC\u003c/type\u003e\n                            \u003csourceDirectory\u003epkgs\u003c/sourceDirectory\u003e\n                            \u003cfileMask\u003e*.pks\u003c/fileMask\u003e\n                        \u003c/object\u003e\n                        \u003cobject\u003e\n                            \u003cindex\u003e5\u003c/index\u003e\n                            \u003ctype\u003ePACKAGE_BODY\u003c/type\u003e\n                            \u003csourceDirectory\u003epkgs\u003c/sourceDirectory\u003e\n                            \u003cfileMask\u003e*.pkb\u003c/fileMask\u003e\n                        \u003c/object\u003e\n                    \u003c/objects\u003e\n                \u003c/schema\u003e\n            \u003c/schemes\u003e\n        \u003c/oracle\u003e\n    \u003c/configuration\u003e\n\u003c/plugin\u003e\n```\n\n## Appendix B - Sample output for install_manual.sql script for Oracle\n\n```\n$ sqlplus /nolog @install_manual.sql\n\nSQL*Plus: Release 12.2.0.1.0 Production on Sat Jul 7 23:12:41 2018\n\nCopyright (c) 1982, 2017, Oracle.  All rights reserved.\n\n\n=== DATABASE-MAVEN-PLUGIN\nOracle database [database] version [test] created at [2018-07-07 23:11:14]\n\nEnter TNS name for database [database]: ORACLE_A\nEnter username for schema [schema_b]:\nEnter password for schema [schema_b]:\nEnter username for schema [schema_a]:\nEnter password for schema [schema_a]:\n\n=== Check Connections\n\nschema_b\nConnected.\nschema_a\nConnected.\n\n\nElapsed: 00:00:00.02\n=== Deploy Information\n\nDatabase database\nBuild version: test\nBuild timestamp: 2018-07-07 23:11:14\nDatabase TNS name: ORACLE_A\nList of schemes:\n* schema_b -\u003e schema_b\n* schema_a -\u003e schema_a\n\n=== Deploy Database [database]\n\n=== Deploy Schema [schema_b]\n\nConnected.\nCheck service tables.\nService table deploy$version... already exists.\nService table deploy$scripts... already exists.\nElapsed: 00:00:00.03\nStart deploy version.\nElapsed: 00:00:00.03\nDrop source code.\nElapsed: 00:00:00.08\nDeploy source code.\nExecute /database/schema_b/fncs/fnc_test_c.fnc\nElapsed: 00:00:00.02\nExecute /database/schema_b/fncs/fnc_test_d.fnc\nElapsed: 00:00:00.02\nExecute /database/schema_b/prcs/prc_test_c.prc\nElapsed: 00:00:00.04\nExecute /database/schema_b/prcs/prc_test_d.prc\nElapsed: 00:00:00.02\nExecute /database/schema_b/vws/vw_test_c.vw\nElapsed: 00:00:00.03\nExecute /database/schema_b/vws/vw_test_d.vw\nElapsed: 00:00:00.03\nElapsed: 00:00:00.03\nExecute /database/schema_b/pkgs/pkg_test_c.pks\nElapsed: 00:00:00.03\nExecute /database/schema_b/pkgs/pkg_test_c.pkb\nElapsed: 00:00:00.03\nCompile schema objects.\nElapsed: 00:00:00.65\nCheck objects.\nNumber of invalid schema's objects = 0.\nElapsed: 00:00:00.02\nFinish deploy version.\nElapsed: 00:00:00.01\n\n=== Deploy Schema [schema_a]\n\nConnected.\nCheck service tables.\nService table deploy$version... already exists.\nService table deploy$scripts... already exists.\nElapsed: 00:00:00.02\nStart deploy version.\nElapsed: 00:00:00.03\nExecute ONE_TIME scripts with BEFORE condition.\nExecute /database/schema_a/scripts/delta/v1_20180701232000_delta_test_a.sql\n[SUCCESS] - Script v1_20180701232000_delta_test_a.sql was already applied.\nDrop source code.\nElapsed: 00:00:00.10\nDeploy source code.\nExecute /database/schema_a/type_specs/ot_test_a.sql\nElapsed: 00:00:00.14\nExecute /database/schema_a/type_specs/ot_test_b.sql\nElapsed: 00:00:00.03\nExecute /database/schema_a/type_specs/tt_test_a.sql\nElapsed: 00:00:00.04\nExecute /database/schema_a/type_bodies/ot_test_b.sql\nElapsed: 00:00:00.02\nExecute /database/schema_a/functions/fnc_test_a.sql\nElapsed: 00:00:00.03\nExecute /database/schema_a/functions/fnc_test_b.sql\nElapsed: 00:00:00.03\nExecute /database/schema_a/views/vw_test_a.sql\nElapsed: 00:00:00.02\nExecute /database/schema_a/views/vw_test_b.sql\nElapsed: 00:00:00.05\nExecute /database/schema_a/procedures/prc_test_a.sql\nElapsed: 00:00:00.02\nExecute /database/schema_a/procedures/prc_test_b.sql\nElapsed: 00:00:00.03\nExecute /database/schema_a/package_specs/pkg_test_a.sql\nElapsed: 00:00:00.03\nExecute /database/schema_a/package_bodies/pkg_test_a.sql\nElapsed: 00:00:00.02\nCompile schema objects.\nElapsed: 00:00:00.44\nCheck objects.\nNumber of invalid schema's objects = 0.\nElapsed: 00:00:00.02\nExecute REUSABLE scripts with AFTER condition.\nExecute /database/schema_a/scripts/dictionaries/test_b.sql\nElapsed: 00:00:00.01\nElapsed: 00:00:00.01\nElapsed: 00:00:00.00\nElapsed: 00:00:00.01\nElapsed: 00:00:00.01\nElapsed: 00:00:00.01\nElapsed: 00:00:00.01\nExecute /database/schema_a/scripts/dictionaries/test_a.sql\nElapsed: 00:00:00.01\nElapsed: 00:00:00.01\nElapsed: 00:00:00.01\nElapsed: 00:00:00.01\nElapsed: 00:00:00.01\nElapsed: 00:00:00.01\nElapsed: 00:00:00.01\nFinish deploy version.\nElapsed: 00:00:00.02\n\nDisconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production\nWith the Partitioning, OLAP, Data Mining and Real Application Testing options\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkrakovych%2Fdatabase-maven-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkkrakovych%2Fdatabase-maven-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkkrakovych%2Fdatabase-maven-plugin/lists"}