Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DAT-14199] Rename xsd schema prefix #366

Merged
merged 1 commit into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions src/test/resources/liquibase/ext/changelog.admin-command.test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,34 +20,34 @@
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/mongodb"
xmlns:mongodb="http://www.liquibase.org/xml/ns/mongodb"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd
http://www.liquibase.org/xml/ns/mongodb http://www.liquibase.org/xml/ns/mongodb/liquibase-mongodb-latest.xsd">

<property name="database.name" value="db1"/>

<changeSet id="1" author="alex">

<ext:adminCommand>
<mongodb:adminCommand>

<ext:command>
<mongodb:command>
{ buildInfo: 1 }
</ext:command>
</mongodb:command>

</ext:adminCommand>
</mongodb:adminCommand>

</changeSet>

<changeSet id="2" author="alex">

<ext:adminCommand>
<mongodb:adminCommand>

<ext:command>
<mongodb:command>
{ shardCollection: "${database.name}.player_info_static", key: {location: 1, _id: 1}, unique: true}
</ext:command>
</mongodb:command>

</ext:adminCommand>
</mongodb:adminCommand>

</changeSet>

</databaseChangeLog>
</databaseChangeLog>
60 changes: 30 additions & 30 deletions src/test/resources/liquibase/ext/changelog.changeTypesMix.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/mongodb"
xmlns:mongodb="http://www.liquibase.org/xml/ns/mongodb"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.0.xsd
http://www.liquibase.org/xml/ns/mongodb http://www.liquibase.org/xml/ns/mongodb/liquibase-mongodb-latest.xsd">

<changeSet id="create_students" author="SteveZ">
<ext:createCollection collectionName="students">
<ext:options>
<mongodb:createCollection collectionName="students">
<mongodb:options>
{
validator: {
$jsonSchema: {
Expand Down Expand Up @@ -52,12 +52,12 @@
validationAction: "warn",
validationLevel: "strict"
}
</ext:options>
</ext:createCollection>
</mongodb:options>
</mongodb:createCollection>
</changeSet>
<changeSet id="insertOne_tudents" author="AmyS">
<ext:insertOne collectionName="students">
<ext:document>
<mongodb:insertOne collectionName="students">
<mongodb:document>
{
name: "Alice",
year: NumberInt(2019),
Expand All @@ -68,12 +68,12 @@
street: "33rd Street"
}
}
</ext:document>
</ext:insertOne>
</mongodb:document>
</mongodb:insertOne>
</changeSet>
<changeSet id="create_inventory" author="AdeelM">
<ext:insertMany collectionName="inventory">
<ext:documents>
<mongodb:insertMany collectionName="inventory">
<mongodb:documents>
[
{ item: "journal", qty: NumberInt(25), size: { h: 14, w: 21, uom: "cm" }, instock: true },
{ item: "notebook", qty: NumberInt(50), size: { h: 8.5, w: 11, uom: "in" }, instock: true },
Expand All @@ -83,48 +83,48 @@
{ item: "apple", qty: NumberInt(45), status: "A", instock: true },
{ item: "pears", qty: NumberInt(50), status: "A", instock: true }
]
</ext:documents>
</ext:insertMany>
</mongodb:documents>
</mongodb:insertMany>
</changeSet>
<!-- https://docs.mongodb.com/manual/core/capped-collections/ -->
<changeSet id="capped_inventory" author="RobertR">
<ext:runCommand>
<ext:command>
<mongodb:runCommand>
<mongodb:command>
{
cloneCollectionAsCapped: "inventory",
toCollection: "capped_inventory",
size: 100000,
comment: "This is a capped collection"
}
</ext:command>
</ext:runCommand>
</mongodb:command>
</mongodb:runCommand>
</changeSet>
<changeSet id="create_car" author="AdeelM">
<ext:insertMany collectionName="car">
<ext:documents>
<mongodb:insertMany collectionName="car">
<mongodb:documents>
[
{ _id: 1, name: "Alto", color: "Red",cno: "H410",speed:40,mfdcountry: "India"},
{ _id: 2, name: "Polo", color: "White",cno: "H411",speed:45,mfdcountry: "Japan" },
{ _id: 3, name: "Audi", color: "Black",cno: "H412",speed:50,mfdcountry: "Germany" }
]
</ext:documents>
</ext:insertMany>
</mongodb:documents>
</mongodb:insertMany>
</changeSet>
<changeSet id="findAndModify_car" author="ChristineM">
<ext:runCommand>
<ext:command>
<mongodb:runCommand>
<mongodb:command>
{
findAndModify: "car",
query: { name: "Alto" },
sort: { cno: 1 },
update: { $inc: { speed: 10 } },
}
</ext:command>
</ext:runCommand>
</mongodb:command>
</mongodb:runCommand>
</changeSet>
<changeSet id="findAndModify_car2" author="SteveZ">
<ext:runCommand>
<ext:command>
<mongodb:runCommand>
<mongodb:command>
{
findAndModify: "car",
query: { name: "HondaCity", color: "Silver", cno:"H415" ,speed: 25 },
Expand All @@ -133,7 +133,7 @@
upsert: true,
new: true
}
</ext:command>
</ext:runCommand>
</mongodb:command>
</mongodb:runCommand>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/mongodb"
xmlns:mongodb="http://www.liquibase.org/xml/ns/mongodb"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.0.xsd
http://www.liquibase.org/xml/ns/mongodb http://www.liquibase.org/xml/ns/mongodb/liquibase-mongodb-latest.xsd">

<changeSet id="drop_students" author="MikeO">
<ext:runCommand>
<ext:command>
<mongodb:runCommand>
<mongodb:command>
{ drop: "students" }
</ext:command>
</ext:runCommand>
</mongodb:command>
</mongodb:runCommand>
</changeSet>
<changeSet id="drop_inventory" author="MarthaB">
<ext:runCommand>
<ext:command>
<mongodb:runCommand>
<mongodb:command>
{ drop: "inventory" }
</ext:command>
</ext:runCommand>
</mongodb:command>
</mongodb:runCommand>
</changeSet>
<changeSet id="drop_capped_inventory" author="ChristineM">
<ext:runCommand>
<ext:command>
<mongodb:runCommand>
<mongodb:command>
{ drop: "capped_inventory" }
</ext:command>
</ext:runCommand>
</mongodb:command>
</mongodb:runCommand>
</changeSet>
<changeSet id="drop_car" author="ChristineM">
<ext:runCommand>
<ext:command>
<mongodb:runCommand>
<mongodb:command>
{ drop: "car" }
</ext:command>
</ext:runCommand>
</mongodb:command>
</mongodb:runCommand>
</changeSet>
</databaseChangeLog>
</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/mongodb"
xmlns:mongodb="http://www.liquibase.org/xml/ns/mongodb"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd
http://www.liquibase.org/xml/ns/mongodb http://www.liquibase.org/xml/ns/mongodb/liquibase-mongodb-latest.xsd">

<changeSet id="1" author="alex">
<ext:createCollection collectionName="createCollectionWithValidatorAndOptionsTest">
<ext:options>
<mongodb:createCollection collectionName="createCollectionWithValidatorAndOptionsTest">
<mongodb:options>
{
validator: {
$jsonSchema: {
Expand All @@ -47,18 +47,18 @@
validationAction: "warn",
validationLevel: "strict"
}
</ext:options>
</ext:createCollection>
</mongodb:options>
</mongodb:createCollection>

<ext:createCollection collectionName="createCollectionWithEmptyValidatorTest">
<ext:options>
<mongodb:createCollection collectionName="createCollectionWithEmptyValidatorTest">
<mongodb:options>

</ext:options>
</mongodb:options>

</ext:createCollection>
</mongodb:createCollection>

<ext:createCollection collectionName="createCollectionWithNoValidator"/>
<mongodb:createCollection collectionName="createCollectionWithNoValidator"/>

</changeSet>

</databaseChangeLog>
</databaseChangeLog>
24 changes: 12 additions & 12 deletions src/test/resources/liquibase/ext/changelog.create-index.test.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,26 +20,26 @@
<databaseChangeLog
xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ext="http://www.liquibase.org/xml/ns/mongodb"
xmlns:mongodb="http://www.liquibase.org/xml/ns/mongodb"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-3.6.xsd
http://www.liquibase.org/xml/ns/mongodb http://www.liquibase.org/xml/ns/mongodb/liquibase-mongodb-latest.xsd">

<changeSet id="1" author="alex">
<ext:createIndex collectionName="createIndexTest">
<ext:keys>
<mongodb:createIndex collectionName="createIndexTest">
<mongodb:keys>
{ clientId: 1, type: 1}
</ext:keys>
<ext:options>
</mongodb:keys>
<mongodb:options>
{unique: true, name: "ui_tppClientId"}
</ext:options>
</ext:createIndex>
</mongodb:options>
</mongodb:createIndex>

<ext:createIndex collectionName="createIndexNoOptionsTest">
<ext:keys>
<mongodb:createIndex collectionName="createIndexNoOptionsTest">
<mongodb:keys>
{ clientId: 1, type: 1}
</ext:keys>
</ext:createIndex>
</mongodb:keys>
</mongodb:createIndex>
</changeSet>


</databaseChangeLog>
</databaseChangeLog>
Loading