Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ability to set dbms for raw sql changes.
Currently, you can only specify database names at the changeset level. This commit extends that functionality for sql changes. Useful for creating more compact change logs. I'm not fully comfortable with the practive of injecting variables into a changelog from java. If that is possible, I can move my integration test to common.tests.changelog and pass in the current database short name so that the testing can be used for all databases. Currently only testing using H2 but since this feature is just liquibase based it should work fine with all databases.
- Loading branch information
1 parent
e445123
commit ca13943
Showing
7 changed files
with
95 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
...gration-tests/src/test/resources/changelogs/h2/complete/change.specify.dbms.changelog.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,27 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
|
|||
<databaseChangeLog | |||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | |||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.0.xsd"> | |||
<preConditions> | |||
<dbms type="h2"/> | |||
</preConditions> | |||
|
|||
<changeSet id="1" author="dbiggs"> | |||
<createTable tableName="testChangeDbms"> | |||
<column name="sampleColumn" type="varchar(50)"/> | |||
</createTable> | |||
<!-- sql will cause error if it was run --> | |||
<sql dbms="oracle">select * from tableThatDoesNotExist</sql> | |||
<insert tableName="testChangeDbms" dbms="h2"> | |||
<column name="sampleColumn" value="testValue"/> | |||
</insert> | |||
</changeSet> | |||
|
|||
<changeSet id="2" author="dbiggs"> | |||
<preConditions> | |||
<sqlCheck expectedResult="1">select count(*) from testChangeDbms</sqlCheck> | |||
</preConditions> | |||
</changeSet> | |||
</databaseChangeLog> |