I noticed in Liquibase 2.0 the modify column function has been removed. Is there an alternative way to accomplish a modify operation or do we have to add the column-modify jar. I have a lot of times I need to modify existing columns so need that functionality. I found a 2.0 jar in the extensions area but it looks to be over a year old and does not work with the latest 2.0. Is there a jar that works with the current version of 2.0? I would appreciate any direction as we can’t use 1.9 due to errors in the diff functionality we are seeing with mysql.
Thanks
Scott Ryan
I did just fix it up this morning. I’ll post an updated version.
The reason we took the modifyColumn change out of 2.0 is because it is so generic that it is hard to create cross-database SQL in a reliable way since we don’t really know what you are trying to do. You can still modify columns using the more specific addNotNullConstraint, addForeignKey, etc. as well as the modifyDataType change in 2.0. ModifyDataType will remain available as an extension for existing changeLogs, but going forward you should use other tags.
Nathan
i will convert over to those once 2.0 becomes more stable and I can use it for all my projects. Is there a place where the new calls are documented? I can’t find them in the manual or in the javadoc.
I guess I will have to update my existing 1.9.5 xml files. I plan on releasing my GUI based management tool do you think it would be best released here or on the grails site since it is just a front end to Liquibase.
Scott Ryan
I haven’t gotten much of the 2.0 changes documented, since I was waiting until the code was more done. Once RC2 is out, I’m hoping ot have only a week or so until 2.0 final and will spend that time documenting.
If you are making a tool based on liquibase and would like a good place to link to it, add it to http://liquibase.org/extensions. The goal of that page is to be a portal to all liquibase-related extensions and tools.
Nathan
I will do that. Do you know why the proxy to the CI server has been down all day? I am trying to access the latest build but can’t get to the build server
Scott Ryan
Yes, I’m looking into why bamboo is down. It’s not managed by me, so I don’t have a lot of control over it.
Nathan
I tried the new modify column jar with the latest 2.0 build from source: I get the following error with an XML file that works on 1.9.5.
2010-06-21 08:39:42,997 [http-8080-1] ERROR liquibase - Error thrown as a SAXException: Unexpected change: liquibase.ext.modifycolumn.ModifyColumnChange
java.lang.RuntimeException: Unexpected change: liquibase.ext.modifycolumn.ModifyColumnChange
at liquibase.parser.core.xml.XMLChangeLogSAXHandler.startElement(XMLChangeLogSAXHandler.java:392)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:739)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(XMLChangeLogSAXParser.java:85)
at liquibase.parser.core.xml.XMLChangeLogSAXHandler.handleIncludedChangeLog(XMLChangeLogSAXHandler.java:495)
at liquibase.parser.core.xml.XMLChangeLogSAXHandler.startElement(XMLChangeLogSAXHandler.java:141)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:501)
at com.sun.org.apache.xerces.internal.parsers.AbstractXMLDocumentParser.emptyElement(AbstractXMLDocumentParser.java:179)
at com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.emptyElement(XMLSchemaValidator.java:739)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:377)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:2755)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:648)
at com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205)
at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522)
at liquibase.parser.core.xml.XMLChangeLogSAXParser.parse(X
It’s because of the constraints tag. I created a bug for it: http://liquibase.jira.com/browse/CORE-647
Nathan
I would like to convert all my xml files to the new 2.0 format so I don’t have to run one version for diffs and one for updates and the 2.0 diffs are more accurate. Is there some place I can look to understand how to convert my modify statements to the new format? I have no issues digging through documentation if you can point me in the right direction. I tried using the extra jar but that seems to still have issues so i might as well convert over to the new format.
Thanks
It’s a bug I have to fix in the liquibase core and the modifyChange library. I’ll hopefully get a new build tomorrow.
Nathan
There is a new build on the modifyColumn page. There is still a problem with our integration server, so I can’t point you to a snapshot build from there. I’m hoping to get a official RC2 build out today or tomorrowan, though.
Nathan