mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#374 - ChangeSetType ... baseline, CreateHistoryTable whenCreatedColumn
This commit is contained in:
@@ -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<Object> 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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -45,11 +45,21 @@
|
||||
<xsd:group ref="changeSetChildren" minOccurs="0" maxOccurs="unbounded"/>
|
||||
</xsd:choice>
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="id" type="xsd:positiveInteger" use="required"/>
|
||||
<xsd:attribute name="type" type="changeSetType" use="required"/>
|
||||
<xsd:attribute name="generated" type="xsd:boolean"/>
|
||||
<xsd:attribute name="author" type="xsd:string"/>
|
||||
<xsd:attribute name="comment" type="xsd:string"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:simpleType name="changeSetType">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="apply"/>
|
||||
<xsd:enumeration value="drop"/>
|
||||
<xsd:enumeration value="baseline"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
<!-- =========================================================== -->
|
||||
<!-- CHANGE SET CHILDREN -->
|
||||
<!-- =========================================================== -->
|
||||
@@ -120,11 +130,11 @@
|
||||
|
||||
<xsd:simpleType name="identityType">
|
||||
<xsd:restriction base="xsd:string">
|
||||
<xsd:enumeration value="IDENTITY"/>
|
||||
<xsd:enumeration value="SEQUENCE"/>
|
||||
<xsd:enumeration value="GENERATOR"/>
|
||||
<xsd:enumeration value="EXTERNAL"/>
|
||||
<xsd:enumeration value="DEFAULT"/>
|
||||
<xsd:enumeration value="identity"/>
|
||||
<xsd:enumeration value="sequence"/>
|
||||
<xsd:enumeration value="generator"/>
|
||||
<xsd:enumeration value="external"/>
|
||||
<xsd:enumeration value="default"/>
|
||||
</xsd:restriction>
|
||||
</xsd:simpleType>
|
||||
|
||||
@@ -163,6 +173,7 @@
|
||||
<xsd:element name="createHistoryTable">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="baseTable" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="whenCreatedColumn" type="xsd:string"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
@@ -249,36 +260,25 @@
|
||||
|
||||
<xsd:element name="column">
|
||||
<xsd:complexType mixed="true">
|
||||
<xsd:attributeGroup ref="column"/>
|
||||
<xsd:attributeGroup ref="columnAttributes"/>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="type" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="defaultValue" type="xsd:string"/>
|
||||
<!--<xsd:attributeGroup ref="columnAttributes"/>-->
|
||||
<xsd:attribute name="notnull" type="xsd:boolean"/>
|
||||
<xsd:attribute name="checkConstraint" type="xsd:string"/>
|
||||
<xsd:attribute name="unique" type="xsd:boolean"/>
|
||||
<xsd:attribute name="uniqueOneToOne" type="xsd:boolean"/>
|
||||
<xsd:attribute name="primaryKey" type="xsd:boolean"/>
|
||||
<xsd:attribute name="identity" type="xsd:boolean"/> <!-- aka autoincrement/identity -->
|
||||
<xsd:attribute name="references" type="xsd:string"/>
|
||||
<xsd:attribute name="comment" type="xsd:string"/>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
|
||||
<xsd:attributeGroup name="tablespaceAttributes">
|
||||
<xsd:attribute name="tablespace" type="xsd:string"/>
|
||||
<xsd:attribute name="indexTablespace" type="xsd:string"/>
|
||||
<xsd:attribute name="remarks" type="xsd:string"/>
|
||||
</xsd:attributeGroup>
|
||||
|
||||
<xsd:attributeGroup name="columnAttributes">
|
||||
<xsd:attribute name="notnull" type="xsd:boolean"/>
|
||||
<xsd:attribute name="checkConstraint" type="xsd:string"/>
|
||||
<xsd:attribute name="unique" type="xsd:boolean"/>
|
||||
<xsd:attribute name="uniqueOneToOne" type="xsd:boolean"/>
|
||||
<xsd:attribute name="primaryKey" type="xsd:boolean"/>
|
||||
<xsd:attribute name="identity" type="xsd:boolean"/> <!-- aka autoincrement/identity -->
|
||||
<xsd:attribute name="references" type="xsd:string"/>
|
||||
<!--<xsd:attribute name="primaryKeyTablespace" type="xsd:string"/>-->
|
||||
<!--<xsd:attribute name="deleteCascade" type="xsd:boolean"/>-->
|
||||
<!--<xsd:attribute name="deferrable" type="xsd:boolean"/>-->
|
||||
<!--<xsd:attribute name="initiallyDeferred" type="xsd:boolean"/>-->
|
||||
</xsd:attributeGroup>
|
||||
|
||||
<xsd:attributeGroup name="column">
|
||||
<xsd:attribute name="name" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="type" type="xsd:string" use="required"/>
|
||||
<xsd:attribute name="defaultValue" type="xsd:string"/>
|
||||
<xsd:attribute name="remarks" type="xsd:string"/>
|
||||
</xsd:attributeGroup>
|
||||
|
||||
<!-- Children for changeSet -->
|
||||
@@ -315,7 +315,6 @@
|
||||
<!--<xsd:element ref="addNotNullConstraint" maxOccurs="unbounded"/>-->
|
||||
<!--<xsd:element ref="dropNotNullConstraint" maxOccurs="unbounded"/>-->
|
||||
|
||||
|
||||
<!--<xsd:element ref="addPrimaryKey" maxOccurs="unbounded"/>-->
|
||||
<!--<xsd:element ref="dropPrimaryKey" maxOccurs="unbounded"/>-->
|
||||
|
||||
|
||||
Reference in New Issue
Block a user