diff --git a/liquibase-cli/src/main/java/liquibase/integration/commandline/LiquibaseLauncher.java b/liquibase-cli/src/main/java/liquibase/integration/commandline/LiquibaseLauncher.java index ac56d997914..a92eb15fe82 100644 --- a/liquibase-cli/src/main/java/liquibase/integration/commandline/LiquibaseLauncher.java +++ b/liquibase-cli/src/main/java/liquibase/integration/commandline/LiquibaseLauncher.java @@ -24,6 +24,12 @@ public static void main(final String[] args) throws Exception { debug("Debug mode enabled because LIQUIBASE_LAUNCHER_DEBUG is set to " + debugSetting); } + String parentLoaderSetting = System.getenv("LIQUIBASE_LAUNCHER_PARENT_CLASSLOADER"); + if (parentLoaderSetting == null) { + parentLoaderSetting = "system"; + } + debug("LIQUIBASE_LAUNCHER_PARENT_CLASSLOADER is set to " + parentLoaderSetting); + final String liquibaseHomeEnv = System.getenv("LIQUIBASE_HOME"); debug("LIQUIBASE_HOME: " + liquibaseHomeEnv); if (liquibaseHomeEnv == null || liquibaseHomeEnv.equals("")) { @@ -80,10 +86,20 @@ public static void main(final String[] args) throws Exception { } } - //loading with the regular system classloader includes liquibase.jar in the parent. - //That causes the parent classloader to load LiqiuabaseCommandLine which makes it not able to access files in the child classloader - //The system classloader's parent is the boot classloader, which keeps the only classloader with liquibase.jar the same as the rest of the classes it needs to access. - final URLClassLoader classloader = new URLClassLoader(urls.toArray(new URL[0]), ClassLoader.getSystemClassLoader().getParent()); + ClassLoader parentLoader; + if (parentLoaderSetting.equalsIgnoreCase("system")) { + //loading with the regular system classloader includes liquibase.jar in the parent. + //That causes the parent classloader to load LiquibaseCommandLine which makes it not able to access files in the child classloader + //The system classloader's parent is the boot classloader, which keeps the only classloader with liquibase.jar the same as the rest of the classes it needs to access. + parentLoader = ClassLoader.getSystemClassLoader().getParent(); + + } else if (parentLoaderSetting.equalsIgnoreCase("thread")) { + parentLoader = Thread.currentThread().getContextClassLoader(); + } else { + throw new RuntimeException("Unknown LIQUIBASE_LAUNCHER_PARENT_CLASSLOADER value: "+parentLoaderSetting); + } + + final URLClassLoader classloader = new URLClassLoader(urls.toArray(new URL[0]), parentLoader); Thread.currentThread().setContextClassLoader(classloader); final Class cli = classloader.loadClass(LiquibaseCommandLine.class.getName()); diff --git a/liquibase-core/src/main/java/liquibase/changelog/ChangeSet.java b/liquibase-core/src/main/java/liquibase/changelog/ChangeSet.java index d37f406dde9..c62849f8845 100644 --- a/liquibase-core/src/main/java/liquibase/changelog/ChangeSet.java +++ b/liquibase-core/src/main/java/liquibase/changelog/ChangeSet.java @@ -1,6 +1,7 @@ package liquibase.changelog; import liquibase.ContextExpression; +import liquibase.GlobalConfiguration; import liquibase.Labels; import liquibase.Scope; import liquibase.change.*; @@ -16,6 +17,7 @@ import liquibase.executor.ExecutorService; import liquibase.executor.LoggingExecutor; import liquibase.logging.Logger; +import liquibase.parser.ChangeLogParserConfiguration; import liquibase.parser.core.ParsedNode; import liquibase.parser.core.ParsedNodeException; import liquibase.precondition.Conditional; @@ -194,7 +196,7 @@ public String toString() { */ private PreconditionContainer preconditions; - /** + /** * ChangeSet level attribute to specify an Executor */ private String runWith; @@ -276,6 +278,7 @@ public String getFilePath() { /** * The logical file path defined directly on this node. Return null if not set. + * * @return */ public String getLogicalFilePath() { @@ -367,7 +370,7 @@ public void load(ParsedNode node, ResourceAccessor resourceAccessor) throws Pars } } else { filePath = filePath.replaceAll("\\\\", "/") - .replaceFirst("^/", ""); + .replaceFirst("^/", ""); } @@ -440,11 +443,7 @@ protected void handleChildNode(ParsedNode child, ResourceAccessor resourceAccess break; case "preConditions": this.preconditions = new PreconditionContainer(); - try { - this.preconditions.load(child, resourceAccessor); - } catch (ParsedNodeException e) { - e.printStackTrace(); - } + this.preconditions.load(child, resourceAccessor); break; case "changes": for (ParsedNode changeNode : child.getChildren()) { @@ -517,6 +516,14 @@ protected void handleRollbackNode(ParsedNode rollbackNode, ResourceAccessor reso protected Change toChange(ParsedNode value, ResourceAccessor resourceAccessor) throws ParsedNodeException { Change change = Scope.getCurrentScope().getSingleton(ChangeFactory.class).create(value.getName()); if (change == null) { + if (value.getChildren().size() > 0 && ChangeLogParserConfiguration.CHANGELOG_PARSE_MODE.getCurrentValue().equals(ChangeLogParserConfiguration.ChangelogParseMode.STRICT)) { + String message = ""; + if (this.getChangeLog() != null && this.getChangeLog().getPhysicalFilePath() != null) { + message = "Error parsing " + this.getChangeLog().getPhysicalFilePath() + ": "; + } + message += "Unknown change type '" + value.getName() + "'. Check for spelling or capitalization errors and missing extensions such as liquibase-commercial."; + throw new ParsedNodeException(message); + } return null; } else { change.load(value, resourceAccessor); @@ -730,7 +737,7 @@ private Executor setupCustomExecutorIfNecessary(Database database) { Scope.getCurrentScope().getSingleton(ExecutorService.class).setExecutor("jdbc", database, customExecutor); List changes = getChanges(); for (Change change : changes) { - if (! (change instanceof AbstractChange)) { + if (!(change instanceof AbstractChange)) { continue; } final ResourceAccessor resourceAccessor = ((AbstractChange) change).getResourceAccessor(); @@ -743,13 +750,11 @@ private Executor setupCustomExecutorIfNecessary(Database database) { } /** - * * Look for a configuration property that matches liquibase..executor * and if found, return its value as the executor name * - * @param executorName The value from the input changeset runWith attribute - * @return String The mapped value - * + * @param executorName The value from the input changeset runWith attribute + * @return String The mapped value */ public static String lookupExecutor(String executorName) { if (StringUtil.isEmpty(executorName)) { @@ -757,7 +762,7 @@ public static String lookupExecutor(String executorName) { } String key = "liquibase." + executorName.toLowerCase() + ".executor"; String replacementExecutorName = - (String)Scope.getCurrentScope().getSingleton(LiquibaseConfiguration.class).getCurrentConfiguredValue(null, null, key).getValue(); + (String) Scope.getCurrentScope().getSingleton(LiquibaseConfiguration.class).getCurrentConfiguredValue(null, null, key).getValue(); if (replacementExecutorName != null) { Scope.getCurrentScope().getLog(ChangeSet.class).info("Mapped '" + executorName + "' to executor '" + replacementExecutorName + "'"); return replacementExecutorName; @@ -906,7 +911,7 @@ public void setIgnore(boolean ignore) { } public boolean isInheritableIgnore() { - DatabaseChangeLog changeLog = getChangeLog(); + DatabaseChangeLog changeLog = getChangeLog(); if (changeLog == null) { return false; } @@ -945,11 +950,9 @@ public Collection getInheritableLabels() { } /** - * * Build and return a string which contains both the changeset and inherited context * - * @return String - * + * @return String */ public String buildFullContext() { StringBuilder contextExpression = new StringBuilder(); @@ -966,11 +969,9 @@ public String buildFullContext() { } /** - * * Build and return a string which contains both the changeset and inherited labels * - * @return String - * + * @return String */ public String buildFullLabels() { StringBuilder labels = new StringBuilder(); @@ -1219,11 +1220,11 @@ public String getSerializedObjectName() { @Override public Set getSerializableFields() { return new LinkedHashSet<>( - Arrays.asList( - "id", "author", "runAlways", "runOnChange", "failOnError", "context", "labels", "dbms", - "objectQuotingStrategy", "comment", "preconditions", "changes", "rollback", "labels", - "logicalFilePath", "created", "runInTransaction", "runOrder", "ignore" - ) + Arrays.asList( + "id", "author", "runAlways", "runOnChange", "failOnError", "context", "labels", "dbms", + "objectQuotingStrategy", "comment", "preconditions", "changes", "rollback", "labels", + "logicalFilePath", "created", "runInTransaction", "runOrder", "ignore" + ) ); } @@ -1308,7 +1309,7 @@ public Object getSerializableFieldValue(String field) { } if ("logicalFilePath".equals(field)) { - return getLogicalFilePath(); + return getLogicalFilePath(); } if ("rollback".equals(field)) { diff --git a/liquibase-core/src/main/java/liquibase/changelog/DatabaseChangeLog.java b/liquibase-core/src/main/java/liquibase/changelog/DatabaseChangeLog.java index d51e3512483..c21e846ba82 100644 --- a/liquibase-core/src/main/java/liquibase/changelog/DatabaseChangeLog.java +++ b/liquibase-core/src/main/java/liquibase/changelog/DatabaseChangeLog.java @@ -426,13 +426,9 @@ protected void handleChildNode(ParsedNode node, ResourceAccessor resourceAccesso } case "preConditions": { PreconditionContainer parsedContainer = new PreconditionContainer(); - try { - parsedContainer.load(node, resourceAccessor); - this.preconditionContainer.addNestedPrecondition(parsedContainer); + parsedContainer.load(node, resourceAccessor); + this.preconditionContainer.addNestedPrecondition(parsedContainer); - } catch (ParsedNodeException e) { - e.printStackTrace(); - } break; } case "property": { diff --git a/liquibase-core/src/main/java/liquibase/parser/ChangeLogParserConfiguration.java b/liquibase-core/src/main/java/liquibase/parser/ChangeLogParserConfiguration.java index f0a6f64ec4b..36afa37be9f 100644 --- a/liquibase-core/src/main/java/liquibase/parser/ChangeLogParserConfiguration.java +++ b/liquibase-core/src/main/java/liquibase/parser/ChangeLogParserConfiguration.java @@ -1,5 +1,6 @@ package liquibase.parser; +import liquibase.GlobalConfiguration; import liquibase.configuration.AutoloadedConfigurations; import liquibase.configuration.ConfigurationDefinition; @@ -12,6 +13,9 @@ public class ChangeLogParserConfiguration implements AutoloadedConfigurations { public static final ConfigurationDefinition USE_PROCEDURE_SCHEMA; public static final ConfigurationDefinition MISSING_PROPERTY_MODE; + public static final ConfigurationDefinition CHANGELOG_PARSE_MODE; + + static { ConfigurationDefinition.Builder builder = new ConfigurationDefinition.Builder("liquibase"); @@ -30,6 +34,13 @@ public class ChangeLogParserConfiguration implements AutoloadedConfigurations { .setDescription("How to handle changelog property expressions where a value is not set. For example, a string '${address}' when no 'address' property was defined. Values can be: 'preserve' which leaves the string as-is, 'empty' which replaces it with an empty string, or 'error' which stops processing with an error.") .setDefaultValue(MissingPropertyMode.PRESERVE) .build(); + + + CHANGELOG_PARSE_MODE = builder.define("changelogParseMode", ChangelogParseMode.class) + .setDescription("Configures how to handle unknown fields in changelog files. Possible values: STRICT which causes parsing to fail, and LAX which continues with the parsing.") + .setDefaultValue(ChangelogParseMode.STRICT) + .build(); + } public enum MissingPropertyMode { @@ -37,4 +48,9 @@ public enum MissingPropertyMode { EMPTY, ERROR, } + + public enum ChangelogParseMode { + STRICT, + LAX, + } } diff --git a/liquibase-core/src/main/java/liquibase/precondition/PreconditionLogic.java b/liquibase-core/src/main/java/liquibase/precondition/PreconditionLogic.java index 8c1eff6338e..fc0d41fc532 100644 --- a/liquibase-core/src/main/java/liquibase/precondition/PreconditionLogic.java +++ b/liquibase-core/src/main/java/liquibase/precondition/PreconditionLogic.java @@ -1,7 +1,9 @@ package liquibase.precondition; +import liquibase.GlobalConfiguration; import liquibase.database.Database; import liquibase.exception.ValidationErrors; +import liquibase.parser.ChangeLogParserConfiguration; import liquibase.parser.core.ParsedNode; import liquibase.parser.core.ParsedNodeException; import liquibase.resource.ResourceAccessor; @@ -47,6 +49,10 @@ public void load(ParsedNode parsedNode, ResourceAccessor resourceAccessor) throw protected Precondition toPrecondition(ParsedNode node, ResourceAccessor resourceAccessor) throws ParsedNodeException { Precondition precondition = PreconditionFactory.getInstance().create(node.getName()); if (precondition == null) { + if (node.getChildren() != null && node.getChildren().size() > 0 && ChangeLogParserConfiguration.CHANGELOG_PARSE_MODE.getCurrentValue().equals(ChangeLogParserConfiguration.ChangelogParseMode.STRICT)) { + throw new ParsedNodeException("Unknown precondition '" + node.getName() + "'. Check for spelling or capitalization errors and missing extensions such as liquibase-commercial."); + } + return null; } diff --git a/liquibase-core/src/test/groovy/liquibase/changelog/ChangeSetTest.groovy b/liquibase-core/src/test/groovy/liquibase/changelog/ChangeSetTest.groovy index 5c8b3155106..92aac0c246e 100644 --- a/liquibase-core/src/test/groovy/liquibase/changelog/ChangeSetTest.groovy +++ b/liquibase-core/src/test/groovy/liquibase/changelog/ChangeSetTest.groovy @@ -1,7 +1,10 @@ package liquibase.changelog + +import liquibase.Scope import liquibase.change.CheckSum import liquibase.change.core.* +import liquibase.parser.ChangeLogParserConfiguration import liquibase.parser.core.ParsedNode import liquibase.parser.core.ParsedNodeException import liquibase.precondition.core.RunningAsPrecondition @@ -187,6 +190,39 @@ public class ChangeSetTest extends Specification { changeSet.changes[1].tableName == "table_2" } + def "load node with unknown change types and strict parsing"() { + when: + def changeSet = new ChangeSet(new DatabaseChangeLog("com/example/test.xml")) + def node = new ParsedNode(null, "changeSet") + .addChildren([id: "1", author: "nvoxland"]) + .addChild(new ParsedNode(null, "createTable").addChild(null, "tableName", "table_1")) + .addChild(new ParsedNode(null, "invalid").addChild(null, "tableName", "table_2")) + changeSet.load(node, resourceSupplier.simpleResourceAccessor) + + then: + def e = thrown(ParsedNodeException) + e.message == "Error parsing com/example/test.xml: Unknown change type 'invalid'. Check for spelling or capitalization errors and missing extensions such as liquibase-commercial." + } + + def "load node with unknown change types and lax parsing"() { + when: + def changeSet = new ChangeSet(new DatabaseChangeLog("com/example/test.xml")) + def node = new ParsedNode(null, "changeSet") + .addChildren([id: "1", author: "nvoxland"]) + .addChild(new ParsedNode(null, "createTable").addChild(null, "tableName", "table_1")) + .addChild(new ParsedNode(null, "invalid").addChild(null, "tableName", "table_2")) + + Scope.child([(ChangeLogParserConfiguration.CHANGELOG_PARSE_MODE.getKey()): ChangeLogParserConfiguration.ChangelogParseMode.LAX], { + -> + changeSet.load(node, resourceSupplier.simpleResourceAccessor) + } as Scope.ScopedRunner) + + + then: + notThrown(ParsedNodeException) + changeSet.getChanges().size() == 1 + } + def "load node with rollback containing sql as value"() { when: def changeSet = new ChangeSet(new DatabaseChangeLog("com/example/test.xml")) diff --git a/liquibase-core/src/test/groovy/liquibase/parser/core/yaml/YamlChangeLogParser_RealFile_Test.groovy b/liquibase-core/src/test/groovy/liquibase/parser/core/yaml/YamlChangeLogParser_RealFile_Test.groovy index a42e92b307c..db7cc906c11 100644 --- a/liquibase-core/src/test/groovy/liquibase/parser/core/yaml/YamlChangeLogParser_RealFile_Test.groovy +++ b/liquibase-core/src/test/groovy/liquibase/parser/core/yaml/YamlChangeLogParser_RealFile_Test.groovy @@ -300,29 +300,6 @@ public class YamlChangeLogParser_RealFile_Test extends Specification { assert e.message.startsWith("Syntax error in file liquibase/parser/core/yaml/malformedChangeLog.yaml") } - def "elements that don't correspond to anything in liquibase are ignored"() throws Exception { - def path = "liquibase/parser/core/yaml/unusedTagsChangeLog.yaml" - expect: - DatabaseChangeLog changeLog = new YamlChangeLogParser().parse(path, new ChangeLogParameters(), new JUnitResourceAccessor()); - - changeLog.getLogicalFilePath() == path - changeLog.getPhysicalFilePath() == path - - changeLog.getPreconditions().getNestedPreconditions().size() == 0 - changeLog.getChangeSets().size() == 1 - - ChangeSet changeSet = changeLog.getChangeSets().get(0); - changeSet.getAuthor() == "nvoxland" - changeSet.getId() == "1" - changeSet.getChanges().size() == 1 - changeSet.getFilePath() == path - changeSet.getComments() == "Some comments go here" - - Change change = changeSet.getChanges().get(0); - Scope.getCurrentScope().getSingleton(ChangeFactory.class).getChangeMetaData(change).getName() == "createTable" - assert change instanceof CreateTableChange - } - def "changeLog parameters are correctly expanded"() throws Exception { when: def params = new ChangeLogParameters(new MockDatabase()); diff --git a/liquibase-core/src/test/groovy/liquibase/precondition/core/PreconditionContainerTest.groovy b/liquibase-core/src/test/groovy/liquibase/precondition/core/PreconditionContainerTest.groovy index 8cf9b1ccce9..2f19abdfc45 100644 --- a/liquibase-core/src/test/groovy/liquibase/precondition/core/PreconditionContainerTest.groovy +++ b/liquibase-core/src/test/groovy/liquibase/precondition/core/PreconditionContainerTest.groovy @@ -1,6 +1,9 @@ package liquibase.precondition.core +import liquibase.GlobalConfiguration +import liquibase.Scope import liquibase.exception.SetupException +import liquibase.parser.ChangeLogParserConfiguration import liquibase.parser.core.ParsedNode import liquibase.parser.core.ParsedNodeException import liquibase.sdk.supplier.resource.ResourceSupplier @@ -9,7 +12,8 @@ import spock.lang.Specification class PreconditionContainerTest extends Specification { - @Shared resourceSupplier = new ResourceSupplier() + @Shared + resourceSupplier = new ResourceSupplier() def "load handles empty node with params"() { when: @@ -101,8 +105,8 @@ class PreconditionContainerTest extends Specification { def node = new ParsedNode(null, "preConditions").addChildren([onFail: "MARK_RAN"]) .addChild(new ParsedNode(null, "runningAs").addChildren([username: "my_user"])) .addChild(new ParsedNode(null, "or") - .addChildren([runningAs: [username: "other_user"]]) - .addChildren([runningAs: [username: "yet_other_user"]]) + .addChildren([runningAs: [username: "other_user"]]) + .addChildren([runningAs: [username: "yet_other_user"]]) ) .addChild(new ParsedNode(null, "tableExists").addChildren([tableName: "my_table"])) @@ -128,4 +132,35 @@ class PreconditionContainerTest extends Specification { } + def "load handles node with unknown preconditions in strict mode"() { + when: + def node = new ParsedNode(null, "preConditions").addChildren([onFail: "MARK_RAN"]) + .addChild(new ParsedNode(null, "invalid").addChildren([tableName: "my_table"])) + .addChild(new ParsedNode(null, "tableExists").addChildren([tableName: "my_table"])) + + def container = new PreconditionContainer() + container.load(node, resourceSupplier.simpleResourceAccessor) + + then: + def e = thrown(ParsedNodeException) + e.message == "Unknown precondition 'invalid'. Check for spelling or capitalization errors and missing extensions such as liquibase-commercial." + } + + def "load handles node with unknown preconditions in lax mode"() { + when: + def node = new ParsedNode(null, "preConditions").addChildren([onFail: "MARK_RAN"]) + .addChild(new ParsedNode(null, "invalid").addChildren([tableName: "my_table"])) + .addChild(new ParsedNode(null, "tableExists").addChildren([tableName: "my_table"])) + + def container = new PreconditionContainer() + Scope.currentScope.child([(ChangeLogParserConfiguration.CHANGELOG_PARSE_MODE.key): ChangeLogParserConfiguration.ChangelogParseMode.LAX], { + -> + container.load(node, resourceSupplier.simpleResourceAccessor) + } as Scope.ScopedRunner) + + + then: + notThrown(ParsedNodeException) + container.getNestedPreconditions().size() == 1 + } } diff --git a/liquibase-core/src/test/resources/liquibase/registered-changelog.json b/liquibase-core/src/test/resources/liquibase/registered-changelog.json index ed23e7f31be..ee5c8244d15 100644 --- a/liquibase-core/src/test/resources/liquibase/registered-changelog.json +++ b/liquibase-core/src/test/resources/liquibase/registered-changelog.json @@ -46,24 +46,6 @@ } }, - { - "changeSet": { - "id": "1604958377003-3", - "author": "wesley (generated)", - "changes": [ - { - "createTrigger": { - "disabled": false, - "path": "objects/trigger/TRIGGER1.sql", - "relativeToChangelogFile": true, - "tableName": "ACCOUNT", - "triggerName": "TRIGGER1" - } - }] - - } - }, - { "changeSet": { "id": "1604958377003-4", @@ -413,40 +395,6 @@ } }] - } - }, - - { - "changeSet": { - "id": "1604958377003-14", - "author": "wesley (generated)", - "changes": [ - { - "addCheckConstraint": { - "constraintBody": "supplier_id BETWEEN 100 and 9999", - "constraintName": "CHECK_SUPPLIER_ID", - "disabled": false, - "tableName": "SUPPLIERS" - } - }] - - } - }, - - { - "changeSet": { - "id": "1604958377003-15", - "author": "wesley (generated)", - "changes": [ - { - "createFunction": { - "functionName": "FUNC_COMPUTE_TAX", - "path": "objects/function/FUNC_COMPUTE_TAX.sql", - "relativeToChangelogFile": true - } - }] - } } - ]} diff --git a/liquibase-core/src/test/resources/liquibase/registered-changelog.yml b/liquibase-core/src/test/resources/liquibase/registered-changelog.yml index 52d2ad1da4b..85440377540 100644 --- a/liquibase-core/src/test/resources/liquibase/registered-changelog.yml +++ b/liquibase-core/src/test/resources/liquibase/registered-changelog.yml @@ -22,16 +22,6 @@ databaseChangeLog: path: objects/storedprocedure/PROC_HELLO_WORLD.sql procedureName: PROC_HELLO_WORLD relativeToChangelogFile: true -- changeSet: - id: 1604960286751-3 - author: wesley (generated) - changes: - - createTrigger: - disabled: false - path: objects/trigger/TRIGGER1.sql - relativeToChangelogFile: true - tableName: ACCOUNT - triggerName: TRIGGER1 - changeSet: id: 1604960286751-4 author: wesley (generated) @@ -208,21 +198,3 @@ databaseChangeLog: type: VARCHAR2(50 BYTE) tableName: SUPPLIERS1 tablespace: USERS -- changeSet: - id: 1604960286751-14 - author: wesley (generated) - changes: - - addCheckConstraint: - constraintBody: supplier_id BETWEEN 100 and 9999 - constraintName: CHECK_SUPPLIER_ID - disabled: false - tableName: SUPPLIERS -- changeSet: - id: 1604960286751-15 - author: wesley (generated) - changes: - - createFunction: - functionName: FUNC_COMPUTE_TAX - path: objects/function/FUNC_COMPUTE_TAX.sql - relativeToChangelogFile: true - diff --git a/liquibase-core/src/test/resources/liquibase/simple.json b/liquibase-core/src/test/resources/liquibase/simple.json index 10a53bf8788..49525411a22 100644 --- a/liquibase-core/src/test/resources/liquibase/simple.json +++ b/liquibase-core/src/test/resources/liquibase/simple.json @@ -44,24 +44,6 @@ } }, - { - "changeSet": { - "id": "1604958377003-3", - "author": "wesley (generated)", - "changes": [ - { - "createTrigger": { - "disabled": false, - "path": "objects/trigger/TRIGGER1.sql", - "relativeToChangelogFile": true, - "tableName": "ACCOUNT", - "triggerName": "TRIGGER1" - } - }] - - } - }, - { "changeSet": { "id": "1604958377003-4", @@ -411,40 +393,6 @@ } }] - } - }, - - { - "changeSet": { - "id": "1604958377003-14", - "author": "wesley (generated)", - "changes": [ - { - "addCheckConstraint": { - "constraintBody": "supplier_id BETWEEN 100 and 9999", - "constraintName": "CHECK_SUPPLIER_ID", - "disabled": false, - "tableName": "SUPPLIERS" - } - }] - - } - }, - - { - "changeSet": { - "id": "1604958377003-15", - "author": "wesley (generated)", - "changes": [ - { - "createFunction": { - "functionName": "FUNC_COMPUTE_TAX", - "path": "objects/function/FUNC_COMPUTE_TAX.sql", - "relativeToChangelogFile": true - } - }] - } } - ]} diff --git a/liquibase-core/src/test/resources/liquibase/test-changelog.json b/liquibase-core/src/test/resources/liquibase/test-changelog.json index 10a53bf8788..49525411a22 100644 --- a/liquibase-core/src/test/resources/liquibase/test-changelog.json +++ b/liquibase-core/src/test/resources/liquibase/test-changelog.json @@ -44,24 +44,6 @@ } }, - { - "changeSet": { - "id": "1604958377003-3", - "author": "wesley (generated)", - "changes": [ - { - "createTrigger": { - "disabled": false, - "path": "objects/trigger/TRIGGER1.sql", - "relativeToChangelogFile": true, - "tableName": "ACCOUNT", - "triggerName": "TRIGGER1" - } - }] - - } - }, - { "changeSet": { "id": "1604958377003-4", @@ -411,40 +393,6 @@ } }] - } - }, - - { - "changeSet": { - "id": "1604958377003-14", - "author": "wesley (generated)", - "changes": [ - { - "addCheckConstraint": { - "constraintBody": "supplier_id BETWEEN 100 and 9999", - "constraintName": "CHECK_SUPPLIER_ID", - "disabled": false, - "tableName": "SUPPLIERS" - } - }] - - } - }, - - { - "changeSet": { - "id": "1604958377003-15", - "author": "wesley (generated)", - "changes": [ - { - "createFunction": { - "functionName": "FUNC_COMPUTE_TAX", - "path": "objects/function/FUNC_COMPUTE_TAX.sql", - "relativeToChangelogFile": true - } - }] - } } - ]} diff --git a/liquibase-core/src/test/resources/liquibase/test-changelog.yml b/liquibase-core/src/test/resources/liquibase/test-changelog.yml index 81ccb6ed59f..1d78e5362e0 100644 --- a/liquibase-core/src/test/resources/liquibase/test-changelog.yml +++ b/liquibase-core/src/test/resources/liquibase/test-changelog.yml @@ -21,16 +21,6 @@ databaseChangeLog: path: objects/storedprocedure/PROC_HELLO_WORLD.sql procedureName: PROC_HELLO_WORLD relativeToChangelogFile: true -- changeSet: - id: 1604960286751-3 - author: wesley (generated) - changes: - - createTrigger: - disabled: false - path: objects/trigger/TRIGGER1.sql - relativeToChangelogFile: true - tableName: ACCOUNT - triggerName: TRIGGER1 - changeSet: id: 1604960286751-4 author: wesley (generated) @@ -207,21 +197,3 @@ databaseChangeLog: type: VARCHAR2(50 BYTE) tableName: SUPPLIERS1 tablespace: USERS -- changeSet: - id: 1604960286751-14 - author: wesley (generated) - changes: - - addCheckConstraint: - constraintBody: supplier_id BETWEEN 100 and 9999 - constraintName: CHECK_SUPPLIER_ID - disabled: false - tableName: SUPPLIERS -- changeSet: - id: 1604960286751-15 - author: wesley (generated) - changes: - - createFunction: - functionName: FUNC_COMPUTE_TAX - path: objects/function/FUNC_COMPUTE_TAX.sql - relativeToChangelogFile: true -