diff --git a/src/main/java/com/avaje/ebean/dbmigration/migration/ChangeSet.java b/src/main/java/com/avaje/ebean/dbmigration/migration/ChangeSet.java index 586eb125e..4024e6f50 100644 --- a/src/main/java/com/avaje/ebean/dbmigration/migration/ChangeSet.java +++ b/src/main/java/com/avaje/ebean/dbmigration/migration/ChangeSet.java @@ -1,7 +1,6 @@ package com.avaje.ebean.dbmigration.migration; -import java.math.BigInteger; import java.util.ArrayList; import java.util.List; import javax.xml.bind.annotation.XmlAccessType; @@ -10,7 +9,6 @@ import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlElements; import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlSchemaType; import javax.xml.bind.annotation.XmlType; @@ -28,7 +26,9 @@ import javax.xml.bind.annotation.XmlType; * <group ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetChildren" maxOccurs="unbounded" minOccurs="0"/> * </choice> * </sequence> - * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> + * <attribute name="type" use="required" type="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetType" /> + * <attribute name="generated" type="{http://www.w3.org/2001/XMLSchema}boolean" /> + * <attribute name="author" type="{http://www.w3.org/2001/XMLSchema}string" /> * <attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> * </complexContent> @@ -61,9 +61,12 @@ public class ChangeSet { @XmlElement(name = "dropForeignKey", type = DropForeignKey.class) }) protected List changeSetChildren; - @XmlAttribute(name = "id", required = true) - @XmlSchemaType(name = "positiveInteger") - protected BigInteger id; + @XmlAttribute(name = "type", required = true) + protected ChangeSetType type; + @XmlAttribute(name = "generated") + protected Boolean generated; + @XmlAttribute(name = "author") + protected String author; @XmlAttribute(name = "comment") protected String comment; @@ -110,27 +113,75 @@ public class ChangeSet { } /** - * Gets the value of the id property. + * Gets the value of the type property. * * @return * possible object is - * {@link BigInteger } + * {@link ChangeSetType } * */ - public BigInteger getId() { - return id; + public ChangeSetType getType() { + return type; } /** - * Sets the value of the id property. + * Sets the value of the type property. * * @param value * allowed object is - * {@link BigInteger } + * {@link ChangeSetType } * */ - public void setId(BigInteger value) { - this.id = value; + public void setType(ChangeSetType value) { + this.type = value; + } + + /** + * Gets the value of the generated property. + * + * @return + * possible object is + * {@link Boolean } + * + */ + public Boolean isGenerated() { + return generated; + } + + /** + * Sets the value of the generated property. + * + * @param value + * allowed object is + * {@link Boolean } + * + */ + public void setGenerated(Boolean value) { + this.generated = value; + } + + /** + * Gets the value of the author property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getAuthor() { + return author; + } + + /** + * Sets the value of the author property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setAuthor(String value) { + this.author = value; } /** diff --git a/src/main/java/com/avaje/ebean/dbmigration/migration/Column.java b/src/main/java/com/avaje/ebean/dbmigration/migration/Column.java index 9c7f881fe..0825264e3 100644 --- a/src/main/java/com/avaje/ebean/dbmigration/migration/Column.java +++ b/src/main/java/com/avaje/ebean/dbmigration/migration/Column.java @@ -18,8 +18,17 @@ import javax.xml.bind.annotation.XmlValue; * <complexType> * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> - * <attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}columnAttributes"/> - * <attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column"/> + * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" /> + * <attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}boolean" /> + * <attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" /> + * <attribute name="primaryKey" type="{http://www.w3.org/2001/XMLSchema}boolean" /> + * <attribute name="identity" type="{http://www.w3.org/2001/XMLSchema}boolean" /> + * <attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> * </complexContent> * </complexType> @@ -36,6 +45,12 @@ public class Column { @XmlValue protected String content; + @XmlAttribute(name = "name", required = true) + protected String name; + @XmlAttribute(name = "type", required = true) + protected String type; + @XmlAttribute(name = "defaultValue") + protected String defaultValue; @XmlAttribute(name = "notnull") protected Boolean notnull; @XmlAttribute(name = "checkConstraint") @@ -50,14 +65,8 @@ public class Column { protected Boolean identity; @XmlAttribute(name = "references") protected String references; - @XmlAttribute(name = "name", required = true) - protected String name; - @XmlAttribute(name = "type", required = true) - protected String type; - @XmlAttribute(name = "defaultValue") - protected String defaultValue; - @XmlAttribute(name = "remarks") - protected String remarks; + @XmlAttribute(name = "comment") + protected String comment; /** * Gets the value of the content property. @@ -83,6 +92,78 @@ public class Column { this.content = value; } + /** + * Gets the value of the name property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getName() { + return name; + } + + /** + * Sets the value of the name property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setName(String value) { + this.name = value; + } + + /** + * Gets the value of the type property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getType() { + return type; + } + + /** + * Sets the value of the type property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setType(String value) { + this.type = value; + } + + /** + * Gets the value of the defaultValue property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getDefaultValue() { + return defaultValue; + } + + /** + * Sets the value of the defaultValue property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setDefaultValue(String value) { + this.defaultValue = value; + } + /** * Gets the value of the notnull property. * @@ -252,99 +333,27 @@ public class Column { } /** - * Gets the value of the name property. + * Gets the value of the comment property. * * @return * possible object is * {@link String } * */ - public String getName() { - return name; + public String getComment() { + return comment; } /** - * Sets the value of the name property. + * Sets the value of the comment property. * * @param value * allowed object is * {@link String } * */ - public void setName(String value) { - this.name = value; - } - - /** - * Gets the value of the type property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getType() { - return type; - } - - /** - * Sets the value of the type property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setType(String value) { - this.type = value; - } - - /** - * Gets the value of the defaultValue property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getDefaultValue() { - return defaultValue; - } - - /** - * Sets the value of the defaultValue property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setDefaultValue(String value) { - this.defaultValue = value; - } - - /** - * Gets the value of the remarks property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getRemarks() { - return remarks; - } - - /** - * Sets the value of the remarks property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRemarks(String value) { - this.remarks = value; + public void setComment(String value) { + this.comment = value; } } diff --git a/src/main/java/com/avaje/ebean/dbmigration/migration/CreateHistoryTable.java b/src/main/java/com/avaje/ebean/dbmigration/migration/CreateHistoryTable.java index c495260c0..2784c4f3a 100644 --- a/src/main/java/com/avaje/ebean/dbmigration/migration/CreateHistoryTable.java +++ b/src/main/java/com/avaje/ebean/dbmigration/migration/CreateHistoryTable.java @@ -18,6 +18,7 @@ import javax.xml.bind.annotation.XmlType; * <complexContent> * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * <attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> + * <attribute name="whenCreatedColumn" type="{http://www.w3.org/2001/XMLSchema}string" /> * </restriction> * </complexContent> * </complexType> @@ -32,6 +33,8 @@ public class CreateHistoryTable { @XmlAttribute(name = "baseTable", required = true) protected String baseTable; + @XmlAttribute(name = "whenCreatedColumn") + protected String whenCreatedColumn; /** * Gets the value of the baseTable property. @@ -57,4 +60,28 @@ public class CreateHistoryTable { this.baseTable = value; } + /** + * Gets the value of the whenCreatedColumn property. + * + * @return + * possible object is + * {@link String } + * + */ + public String getWhenCreatedColumn() { + return whenCreatedColumn; + } + + /** + * Sets the value of the whenCreatedColumn property. + * + * @param value + * allowed object is + * {@link String } + * + */ + public void setWhenCreatedColumn(String value) { + this.whenCreatedColumn = value; + } + } diff --git a/src/main/java/com/avaje/ebean/dbmigration/migration/CreateTable.java b/src/main/java/com/avaje/ebean/dbmigration/migration/CreateTable.java index cef24083d..3435a6d17 100644 --- a/src/main/java/com/avaje/ebean/dbmigration/migration/CreateTable.java +++ b/src/main/java/com/avaje/ebean/dbmigration/migration/CreateTable.java @@ -72,8 +72,6 @@ public class CreateTable { protected String tablespace; @XmlAttribute(name = "indexTablespace") protected String indexTablespace; - @XmlAttribute(name = "remarks") - protected String remarks; /** * Gets the value of the column property. @@ -354,28 +352,4 @@ public class CreateTable { this.indexTablespace = value; } - /** - * Gets the value of the remarks property. - * - * @return - * possible object is - * {@link String } - * - */ - public String getRemarks() { - return remarks; - } - - /** - * Sets the value of the remarks property. - * - * @param value - * allowed object is - * {@link String } - * - */ - public void setRemarks(String value) { - this.remarks = value; - } - } diff --git a/src/main/resources/ebean-dbmigration-1.0.xsd b/src/main/resources/ebean-dbmigration-1.0.xsd index ea3a3cd04..96394a3c4 100644 --- a/src/main/resources/ebean-dbmigration-1.0.xsd +++ b/src/main/resources/ebean-dbmigration-1.0.xsd @@ -45,11 +45,21 @@ - + + + + + + + + + + + @@ -120,11 +130,11 @@ - - - - - + + + + + @@ -163,6 +173,7 @@ + @@ -249,36 +260,25 @@ - - + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - @@ -315,7 +315,6 @@ -