-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add support for XML-based changelogs
this provides the necessary XSD. note that the XSD has to be published at http://www.liquibase.org/xml/ns/opensearch/liquibase-opensearch-1.0.xsd for the reference to be valid for consumers. this seems to have been done for other plugins (e.g. mongodb) but is - presumably? - a manual process.
- Loading branch information
Showing
3 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
src/main/resources/www.liquibase.org/xml/ns/opensearch/liquibase-opensearch-1.0.xsd
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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" | ||
targetNamespace="http://www.liquibase.org/xml/ns/opensearch" | ||
xmlns="http://www.liquibase.org/xml/ns/opensearch" | ||
elementFormDefault="qualified"> | ||
|
||
<xsd:simpleType name="httpMethods" final="restriction"> | ||
<xsd:restriction base="xsd:string"> | ||
<!-- | ||
as per https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods | ||
the following methods have been intentionally skipped as they cannot be used to modify data in OpenSearch: | ||
GET, HEAD, CONNECT, OPTIONS, TRACE | ||
--> | ||
<xsd:enumeration value="POST" /> | ||
<xsd:enumeration value="PUT" /> | ||
<xsd:enumeration value="DELETE" /> | ||
<xsd:enumeration value="PATCH" /> | ||
</xsd:restriction> | ||
</xsd:simpleType> | ||
|
||
<xsd:element name="httpRequest"> | ||
<xsd:complexType> | ||
<xsd:all> | ||
<xsd:element name="method" type="httpMethods" /> | ||
<xsd:element name="path" type="xsd:string" /> | ||
<xsd:element name="body" type="xsd:string" /> | ||
</xsd:all> | ||
</xsd:complexType> | ||
</xsd:element> | ||
|
||
</xsd:schema> |
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
src/test/resources/liquibase/ext/changelog.httprequest.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 | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
<databaseChangeLog | ||
xmlns="http://www.liquibase.org/xml/ns/dbchangelog" | ||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xmlns:opensearch="http://www.liquibase.org/xml/ns/opensearch" | ||
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.29.xsd | ||
http://www.liquibase.org/xml/ns/opensearch http://www.liquibase.org/xml/ns/opensearch/liquibase-opensearch-1.0.xsd"> | ||
|
||
<changeSet id="10000" author="test" labels="XMLhttpRequestLabel" context="httpRequestContext"> | ||
<comment>httpRequestComment</comment> | ||
<opensearch:httpRequest> | ||
<opensearch:method>PUT</opensearch:method> | ||
<opensearch:path>/xmltestindex</opensearch:path> | ||
<opensearch:body> | ||
{ | ||
"mappings": { | ||
"properties": { | ||
"testfield": { | ||
"type": "text" | ||
} | ||
} | ||
} | ||
} | ||
</opensearch:body> | ||
</opensearch:httpRequest> | ||
</changeSet> | ||
|
||
</databaseChangeLog> |