liquibase / liquibase-docs

8 stars 18 forks source link

Add since version to columnDataType attribute of setColumnRemarks change type #108

Closed Boiarshinov closed 3 years ago

Boiarshinov commented 3 years ago

Add since version to columnDataType attribute of setColumnRemarks change type. @nmelny can you review it, please?

Boiarshinov commented 3 years ago

@nmelny But there is no columnDataType attribute of the setColumnRemarks Change Type in xsd-schema v 4.2: image And it's exist in xsd-schema v 4.3: image Thats why I thougth that columnDataType attribute was invented only in liquibase v. 4.3

Boiarshinov commented 3 years ago

I have tested changelogs with columnDataType attribute on liquibase v. 4.1 (can't test it on v.4.2 cause of this bug) and thats what I got:

Caused by: org.xml.sax.SAXParseException; lineNumber: 9; columnNumber: 92; cvc-complex-type.3.2.2: Attribute 'columnDataType' is not allowed to appear in element 'setColumnRemarks'.
    at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:204)
    at java.xml/com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.error(ErrorHandlerWrapper.java:135)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:396)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:327)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:284)
    at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator$XSIErrorReporter.reportError(XMLSchemaValidator.java:511)
    at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.reportSchemaError(XMLSchemaValidator.java:3587)
    at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.processAttributes(XMLSchemaValidator.java:2992)
    at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:2286)
    at java.xml/com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:849)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:351)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2710)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:605)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:112)
    at java.xml/com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:534)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:888)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:824)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:141)
    at java.xml/com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1216)
    at java.xml/com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:635)
    at liquibase.parser.core.xml.XMLChangeLogSAXParser.parseToNode(XMLChangeLogSAXParser.java:91)
    ... 109 more

Changelog with attribute columnDataType in setColumnRemarks change type was declared illegal while xsd schema validation.

You can find full test Demo in my repo: https://github.com/Boiarshinov/mysql-testcontainers-liqui-demo/tree/columnDataType_in_liqui_v_4.1 Try to run any test to catch exception like above.

So I'm pretty sure that this PR changes are correct.

Boiarshinov commented 3 years ago

Thank you!