A class is extended AbstractChange to add a random UUID to a column:
- public class AddGuidColumnChange extends AbstractChange
And it is registered as
- <?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd=“http://www.w3.org/2001/XMLSchema”
targetNamespace=“http://www.mycompany.com/liquibase/xml/ns/dbchangelog-ext”
xmlns=“http://www.liquibase.org/xml/ns/dbchangelog-ext”
elementFormDefault=“qualified”>
<xsd:element name=“addGuidColumn”>
xsd:complexType
<xsd:attribute name=“schemaName” type=“xsd:string” />
<xsd:attribute name=“tableName” type=“xsd:string” use=“required” />
<xsd:attribute name=“primaryKey” type=“xsd:string” use=“required” />
<xsd:attribute name=“columnName” type=“xsd:string” use=“optional” default=“GUID” />
<xsd:attribute name=“columnType” type=“xsd:string” use=“optional” default=“VARCHAR(64)” />
</xsd:complexType>
</xsd:element>
</xsd:schema>
In the changelog, try to use it as:
- <?xml version="1.0" encoding="UTF-8"?>
<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/dbchangelog-ext” xmlns:mc=“http://www.mycompany.com/liquibase/xml/ns/dbchangelog-ext”
xsi:schemaLocation=“http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd
http://www.liquibase.org/xml/ns/dbchangelog-ext http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-ext.xsd”
logicalFilePath=“com/mycompany/core/db/changelog-1.xml”> -
But got errror:
What settings have been missed?
Thank you very much, Jing