I am trying to set a column as unique, but when I add a <unique>
element to <table>, the element gets added as if it were a column, and
I get the following error:
org.apache.ddlutils.model.ModelException: The column nr. 8 in table
users has no type
at org.apache.ddlutils.model.Database.initialize(Database.java:301)
at org.apache.ddlutils.io.DatabaseIO.read(DatabaseIO.java:207)
....
My schema XML looks like this:
<database name="myDB">
<table name="users">
<column name="id" type="INTEGER" primaryKey="true"
autoIncrement="true" required="true"/>
<column name="user_name" type="VARCHAR" size="255" required="true"/>
<unique name="userNameUnique">
<unique-column name="user_name"/>
</unique>
</table>
</database>
Am I doing something wrong? I can't understand why the model ends up
containing 3 columns instead of 2. I verified this in the debugger.
-Ken