DDL - Add support for creating schema via database migrations (and create all ddl)

Initially for H2 and Postgres, with commented out DDL for other platforms.
This commit is contained in:
Rob Bygrave committed 2022-05-16 21:17:41 +12:00
1 parent 9dea51b7a0
commit 71b7aa5946
44 files changed
+756 -856

No files matched your search

@@ -3,25 +3,12 @@ package io.ebeaninternal.dbmigration.ddlgeneration;
import io.ebean.config.DatabaseConfig; import io.ebean.config.DatabaseConfig;
import io.ebeaninternal.dbmigration.ddlgeneration.platform.BaseTableDdl; import io.ebeaninternal.dbmigration.ddlgeneration.platform.BaseTableDdl;
import io.ebeaninternal.dbmigration.ddlgeneration.platform.PlatformDdl; import io.ebeaninternal.dbmigration.ddlgeneration.platform.PlatformDdl;
import io.ebeaninternal.dbmigration.migration.AddColumn; import io.ebeaninternal.dbmigration.migration.*;
import io.ebeaninternal.dbmigration.migration.AddHistoryTable;
import io.ebeaninternal.dbmigration.migration.AddTableComment;
import io.ebeaninternal.dbmigration.migration.AddUniqueConstraint;
import io.ebeaninternal.dbmigration.migration.AlterColumn;
import io.ebeaninternal.dbmigration.migration.AlterForeignKey;
import io.ebeaninternal.dbmigration.migration.AlterTable;
import io.ebeaninternal.dbmigration.migration.ChangeSet;
import io.ebeaninternal.dbmigration.migration.CreateIndex;
import io.ebeaninternal.dbmigration.migration.CreateTable;
import io.ebeaninternal.dbmigration.migration.DropColumn;
import io.ebeaninternal.dbmigration.migration.DropHistoryTable;
import io.ebeaninternal.dbmigration.migration.DropIndex;
import io.ebeaninternal.dbmigration.migration.DropTable;
import java.util.List; import java.util.List;
/** /**
* * Base DDL handler.
*/ */
public class BaseDdlHandler implements DdlHandler { public class BaseDdlHandler implements DdlHandler {
@@ -37,16 +24,12 @@ public class BaseDdlHandler implements DdlHandler {
@Override @Override
public void generate(DdlWrite writer, ChangeSet changeSet) { public void generate(DdlWrite writer, ChangeSet changeSet) {
List<Object> changeSetChildren = changeSet.getChangeSetChildren(); List<Object> changeSetChildren = changeSet.getChangeSetChildren();
createSchemas(writer, changeSetChildren);
createTables(writer, changeSetChildren);
for (Object change : changeSetChildren) { for (Object change : changeSetChildren) {
if (change instanceof CreateTable) { if (change instanceof CreateTable || change instanceof CreateSchema) {
generate(writer, (CreateTable) change); // ignore, CreateSchema and CreateTable always done first
}
}
for (Object change : changeSetChildren) {
if (change instanceof CreateTable) {
// ignore
} else if (change instanceof DropTable) { } else if (change instanceof DropTable) {
generate(writer, (DropTable) change); generate(writer, (DropTable) change);
} else if (change instanceof AlterTable) { } else if (change instanceof AlterTable) {
@@ -77,6 +60,27 @@ public class BaseDdlHandler implements DdlHandler {
} }
} }
private void createTables(DdlWrite writer, List<Object> changeSetChildren) {
for (Object change : changeSetChildren) {
if (change instanceof CreateTable) {
generate(writer, (CreateTable) change);
}
}
}
private void createSchemas(DdlWrite writer, List<Object> changeSetChildren) {
boolean createdSchemas = false;
for (Object change : changeSetChildren) {
if (change instanceof CreateSchema) {
generate(writer, (CreateSchema) change);
createdSchemas = true;
}
}
if (createdSchemas) {
writer.apply().newLine();
}
}
@Override @Override
public void generateProlog(DdlWrite writer) { public void generateProlog(DdlWrite writer) {
tableDdl.generateProlog(writer); tableDdl.generateProlog(writer);
@@ -87,6 +91,11 @@ public class BaseDdlHandler implements DdlHandler {
tableDdl.generateEpilog(writer); tableDdl.generateEpilog(writer);
} }
@Override
public void generate(DdlWrite writer, CreateSchema createSchema) {
tableDdl.generate(writer, createSchema);
}
@Override @Override
public void generate(DdlWrite writer, CreateTable createTable) { public void generate(DdlWrite writer, CreateTable createTable) {
tableDdl.generate(writer, createTable); tableDdl.generate(writer, createTable);
@@ -1,19 +1,6 @@
package io.ebeaninternal.dbmigration.ddlgeneration; package io.ebeaninternal.dbmigration.ddlgeneration;
import io.ebeaninternal.dbmigration.migration.AddColumn; import io.ebeaninternal.dbmigration.migration.*;
import io.ebeaninternal.dbmigration.migration.AddHistoryTable;
import io.ebeaninternal.dbmigration.migration.AddTableComment;
import io.ebeaninternal.dbmigration.migration.AddUniqueConstraint;
import io.ebeaninternal.dbmigration.migration.AlterColumn;
import io.ebeaninternal.dbmigration.migration.AlterForeignKey;
import io.ebeaninternal.dbmigration.migration.AlterTable;
import io.ebeaninternal.dbmigration.migration.ChangeSet;
import io.ebeaninternal.dbmigration.migration.CreateIndex;
import io.ebeaninternal.dbmigration.migration.CreateTable;
import io.ebeaninternal.dbmigration.migration.DropColumn;
import io.ebeaninternal.dbmigration.migration.DropHistoryTable;
import io.ebeaninternal.dbmigration.migration.DropIndex;
import io.ebeaninternal.dbmigration.migration.DropTable;
/** /**
* DDL generation interface. * DDL generation interface.
@@ -22,6 +9,8 @@ public interface DdlHandler {
void generate(DdlWrite writer, ChangeSet changeSet); void generate(DdlWrite writer, ChangeSet changeSet);
void generate(DdlWrite writer, CreateSchema createSchema);
void generate(DdlWrite writer, CreateTable createTable); void generate(DdlWrite writer, CreateTable createTable);
void generate(DdlWrite writer, DropTable dropTable); void generate(DdlWrite writer, DropTable dropTable);
@@ -1,24 +1,17 @@
package io.ebeaninternal.dbmigration.ddlgeneration; package io.ebeaninternal.dbmigration.ddlgeneration;
import io.ebeaninternal.dbmigration.migration.AddColumn; import io.ebeaninternal.dbmigration.migration.*;
import io.ebeaninternal.dbmigration.migration.AddHistoryTable;
import io.ebeaninternal.dbmigration.migration.AddTableComment;
import io.ebeaninternal.dbmigration.migration.AddUniqueConstraint;
import io.ebeaninternal.dbmigration.migration.AlterColumn;
import io.ebeaninternal.dbmigration.migration.AlterForeignKey;
import io.ebeaninternal.dbmigration.migration.AlterTable;
import io.ebeaninternal.dbmigration.migration.CreateIndex;
import io.ebeaninternal.dbmigration.migration.CreateTable;
import io.ebeaninternal.dbmigration.migration.DropColumn;
import io.ebeaninternal.dbmigration.migration.DropHistoryTable;
import io.ebeaninternal.dbmigration.migration.DropIndex;
import io.ebeaninternal.dbmigration.migration.DropTable;
/** /**
* Write table DDL. * Write table DDL.
*/ */
public interface TableDdl { public interface TableDdl {
/**
* Generate the create schema change.
*/
void generate(DdlWrite writer, CreateSchema createSchema);
/** /**
* Generate the create table change. * Generate the create table change.
*/ */
@@ -10,23 +10,7 @@ import io.ebeaninternal.dbmigration.ddlgeneration.DdlBuffer;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlOptions; import io.ebeaninternal.dbmigration.ddlgeneration.DdlOptions;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite; import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
import io.ebeaninternal.dbmigration.ddlgeneration.TableDdl; import io.ebeaninternal.dbmigration.ddlgeneration.TableDdl;
import io.ebeaninternal.dbmigration.migration.AddColumn; import io.ebeaninternal.dbmigration.migration.*;
import io.ebeaninternal.dbmigration.migration.AddHistoryTable;
import io.ebeaninternal.dbmigration.migration.AddTableComment;
import io.ebeaninternal.dbmigration.migration.AddUniqueConstraint;
import io.ebeaninternal.dbmigration.migration.AlterColumn;
import io.ebeaninternal.dbmigration.migration.AlterForeignKey;
import io.ebeaninternal.dbmigration.migration.AlterTable;
import io.ebeaninternal.dbmigration.migration.Column;
import io.ebeaninternal.dbmigration.migration.CreateIndex;
import io.ebeaninternal.dbmigration.migration.CreateTable;
import io.ebeaninternal.dbmigration.migration.DdlScript;
import io.ebeaninternal.dbmigration.migration.DropColumn;
import io.ebeaninternal.dbmigration.migration.DropHistoryTable;
import io.ebeaninternal.dbmigration.migration.DropIndex;
import io.ebeaninternal.dbmigration.migration.DropTable;
import io.ebeaninternal.dbmigration.migration.ForeignKey;
import io.ebeaninternal.dbmigration.migration.UniqueConstraint;
import io.ebeaninternal.dbmigration.model.MTable; import io.ebeaninternal.dbmigration.model.MTable;
import io.ebeaninternal.dbmigration.model.MTableIdentity; import io.ebeaninternal.dbmigration.model.MTableIdentity;
import io.ebeaninternal.server.deploy.IdentityMode; import io.ebeaninternal.server.deploy.IdentityMode;
@@ -195,6 +179,11 @@ public class BaseTableDdl implements TableDdl {
externalCompoundUnique.clear(); externalCompoundUnique.clear();
} }
@Override
public void generate(DdlWrite writer, CreateSchema createSchema) {
platformDdl.createSchema(writer, createSchema);
}
/** /**
* Generate the appropriate 'create table' and matching 'drop table' statements * Generate the appropriate 'create table' and matching 'drop table' statements
* and add them to the appropriate 'apply' and 'rollback' buffers. * and add them to the appropriate 'apply' and 'rollback' buffers.
@@ -12,6 +12,7 @@ public class H2Ddl extends PlatformDdl {
public H2Ddl(DatabasePlatform platform) { public H2Ddl(DatabasePlatform platform) {
super(platform); super(platform);
this.historyDdl = new H2HistoryDdl(); this.historyDdl = new H2HistoryDdl();
this.createSchemaSupport = true;
} }
/** /**
@@ -12,10 +12,7 @@ import io.ebean.util.StringHelper;
import io.ebeaninternal.dbmigration.ddlgeneration.*; import io.ebeaninternal.dbmigration.ddlgeneration.*;
import io.ebeaninternal.dbmigration.ddlgeneration.platform.util.PlatformTypeConverter; import io.ebeaninternal.dbmigration.ddlgeneration.platform.util.PlatformTypeConverter;
import io.ebeaninternal.dbmigration.ddlgeneration.platform.util.VowelRemover; import io.ebeaninternal.dbmigration.ddlgeneration.platform.util.VowelRemover;
import io.ebeaninternal.dbmigration.migration.AddHistoryTable; import io.ebeaninternal.dbmigration.migration.*;
import io.ebeaninternal.dbmigration.migration.AlterColumn;
import io.ebeaninternal.dbmigration.migration.Column;
import io.ebeaninternal.dbmigration.migration.DropHistoryTable;
import io.ebeaninternal.dbmigration.model.MTable; import io.ebeaninternal.dbmigration.model.MTable;
import java.util.List; import java.util.List;
@@ -101,6 +98,9 @@ public class PlatformDdl {
protected String updateNullWithDefault = "update ${table} set ${column} = ${default} where ${column} is null"; protected String updateNullWithDefault = "update ${table} set ${column} = ${default} where ${column} is null";
protected boolean createSchemaSupport;
protected String createSchema = "create schema if not exists";
protected String createTable = "create table"; protected String createTable = "create table";
protected String dropColumn = "drop column"; protected String dropColumn = "drop column";
@@ -816,4 +816,11 @@ public class PlatformDdl {
return checkConstraint; return checkConstraint;
} }
public void createSchema(DdlWrite writer, CreateSchema request) {
DdlBuffer apply = writer.apply();
if (!createSchemaSupport) {
apply.append("-- ");
}
apply.append(createSchema).append(" ").append(quote(request.getName())).endOfStatement();
}
} }
@@ -15,6 +15,7 @@ public class PostgresDdl extends PlatformDdl {
public PostgresDdl(DatabasePlatform platform) { public PostgresDdl(DatabasePlatform platform) {
super(platform); super(platform);
this.historyDdl = new PostgresHistoryDdl(); this.historyDdl = new PostgresHistoryDdl();
this.createSchemaSupport = true;
this.dropTableCascade = " cascade"; this.dropTableCascade = " cascade";
this.columnSetType = "type "; this.columnSetType = "type ";
this.alterTableIfExists = "if exists "; this.alterTableIfExists = "if exists ";
@@ -1,11 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -16,17 +11,17 @@ import java.util.List;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence> * &lt;sequence&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/> * &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/&gt;
* &lt;/sequence> * &lt;/sequence&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -49,7 +44,7 @@ public class AddColumn {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the column property. * This is why there is not a <CODE>set</CODE> method for the column property.
* *
* <p> * <p>
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,13 +9,13 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,14 +9,14 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="comment" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="comment" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,18 +9,18 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="constraintName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="constraintName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -15,40 +11,40 @@ import java.util.List;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence> * &lt;sequence&gt;
* &lt;element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence> * &lt;/sequence&gt;
* &lt;attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="currentType" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="currentType" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="currentDefaultValue" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="currentDefaultValue" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="currentNotnull" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="currentNotnull" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="dropCheckConstraint" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="dropCheckConstraint" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="dropUnique" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="dropUnique" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="dropForeignKey" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="dropForeignKey" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="dropForeignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="dropForeignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -116,7 +112,7 @@ public class AlterColumn {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the before property. * This is why there is not a <CODE>set</CODE> method for the before property.
* *
* <p> * <p>
@@ -143,7 +139,7 @@ public class AlterColumn {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the after property. * This is why there is not a <CODE>set</CODE> method for the after property.
* *
* <p> * <p>
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,20 +9,20 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="columnNames" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="columnNames" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="refColumnNames" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="refColumnNames" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="refTableName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="refTableName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,13 +9,13 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,20 +1,7 @@
//
// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
// See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
// Any modifications to this file will be lost upon recompilation of the source schema.
// Generated on: 2022.02.01 at 12:03:38 PM CET
//
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.*;
import java.math.BigInteger; import java.math.BigInteger;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -23,30 +10,28 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/> * &lt;attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="newName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="newName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" /> * &lt;attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" /&gt;
* &lt;attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*
*
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "") @XmlType(name = "")
@@ -98,10 +83,8 @@ public class AlterTable {
/** /**
* Gets the value of the name property. * Gets the value of the name property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getName() { public String getName() {
return name; return name;
@@ -110,10 +93,8 @@ public class AlterTable {
/** /**
* Sets the value of the name property. * Sets the value of the name property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setName(String value) { public void setName(String value) {
this.name = value; this.name = value;
@@ -122,10 +103,8 @@ public class AlterTable {
/** /**
* Gets the value of the newName property. * Gets the value of the newName property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getNewName() { public String getNewName() {
return newName; return newName;
@@ -134,10 +113,8 @@ public class AlterTable {
/** /**
* Sets the value of the newName property. * Sets the value of the newName property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setNewName(String value) { public void setNewName(String value) {
this.newName = value; this.newName = value;
@@ -146,10 +123,8 @@ public class AlterTable {
/** /**
* Gets the value of the partitionMode property. * Gets the value of the partitionMode property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getPartitionMode() { public String getPartitionMode() {
return partitionMode; return partitionMode;
@@ -158,10 +133,8 @@ public class AlterTable {
/** /**
* Sets the value of the partitionMode property. * Sets the value of the partitionMode property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setPartitionMode(String value) { public void setPartitionMode(String value) {
this.partitionMode = value; this.partitionMode = value;
@@ -170,10 +143,8 @@ public class AlterTable {
/** /**
* Gets the value of the partitionColumn property. * Gets the value of the partitionColumn property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getPartitionColumn() { public String getPartitionColumn() {
return partitionColumn; return partitionColumn;
@@ -182,10 +153,8 @@ public class AlterTable {
/** /**
* Sets the value of the partitionColumn property. * Sets the value of the partitionColumn property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setPartitionColumn(String value) { public void setPartitionColumn(String value) {
this.partitionColumn = value; this.partitionColumn = value;
@@ -194,10 +163,8 @@ public class AlterTable {
/** /**
* Gets the value of the identityType property. * Gets the value of the identityType property.
* *
* @return * @return possible object is
* possible object is
* {@link IdentityType } * {@link IdentityType }
*
*/ */
public IdentityType getIdentityType() { public IdentityType getIdentityType() {
return identityType; return identityType;
@@ -206,10 +173,8 @@ public class AlterTable {
/** /**
* Sets the value of the identityType property. * Sets the value of the identityType property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link IdentityType } * {@link IdentityType }
*
*/ */
public void setIdentityType(IdentityType value) { public void setIdentityType(IdentityType value) {
this.identityType = value; this.identityType = value;
@@ -218,10 +183,8 @@ public class AlterTable {
/** /**
* Gets the value of the identityStart property. * Gets the value of the identityStart property.
* *
* @return * @return possible object is
* possible object is
* {@link BigInteger } * {@link BigInteger }
*
*/ */
public BigInteger getIdentityStart() { public BigInteger getIdentityStart() {
return identityStart; return identityStart;
@@ -230,10 +193,8 @@ public class AlterTable {
/** /**
* Sets the value of the identityStart property. * Sets the value of the identityStart property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link BigInteger } * {@link BigInteger }
*
*/ */
public void setIdentityStart(BigInteger value) { public void setIdentityStart(BigInteger value) {
this.identityStart = value; this.identityStart = value;
@@ -242,10 +203,8 @@ public class AlterTable {
/** /**
* Gets the value of the identityIncrement property. * Gets the value of the identityIncrement property.
* *
* @return * @return possible object is
* possible object is
* {@link BigInteger } * {@link BigInteger }
*
*/ */
public BigInteger getIdentityIncrement() { public BigInteger getIdentityIncrement() {
return identityIncrement; return identityIncrement;
@@ -254,10 +213,8 @@ public class AlterTable {
/** /**
* Sets the value of the identityIncrement property. * Sets the value of the identityIncrement property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link BigInteger } * {@link BigInteger }
*
*/ */
public void setIdentityIncrement(BigInteger value) { public void setIdentityIncrement(BigInteger value) {
this.identityIncrement = value; this.identityIncrement = value;
@@ -266,10 +223,8 @@ public class AlterTable {
/** /**
* Gets the value of the identityCache property. * Gets the value of the identityCache property.
* *
* @return * @return possible object is
* possible object is
* {@link BigInteger } * {@link BigInteger }
*
*/ */
public BigInteger getIdentityCache() { public BigInteger getIdentityCache() {
return identityCache; return identityCache;
@@ -278,10 +233,8 @@ public class AlterTable {
/** /**
* Sets the value of the identityCache property. * Sets the value of the identityCache property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link BigInteger } * {@link BigInteger }
*
*/ */
public void setIdentityCache(BigInteger value) { public void setIdentityCache(BigInteger value) {
this.identityCache = value; this.identityCache = value;
@@ -290,10 +243,8 @@ public class AlterTable {
/** /**
* Gets the value of the identityGenerated property. * Gets the value of the identityGenerated property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getIdentityGenerated() { public String getIdentityGenerated() {
return identityGenerated; return identityGenerated;
@@ -302,10 +253,8 @@ public class AlterTable {
/** /**
* Sets the value of the identityGenerated property. * Sets the value of the identityGenerated property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setIdentityGenerated(String value) { public void setIdentityGenerated(String value) {
this.identityGenerated = value; this.identityGenerated = value;
@@ -314,10 +263,8 @@ public class AlterTable {
/** /**
* Gets the value of the sequenceName property. * Gets the value of the sequenceName property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getSequenceName() { public String getSequenceName() {
return sequenceName; return sequenceName;
@@ -326,10 +273,8 @@ public class AlterTable {
/** /**
* Sets the value of the sequenceName property. * Sets the value of the sequenceName property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setSequenceName(String value) { public void setSequenceName(String value) {
this.sequenceName = value; this.sequenceName = value;
@@ -338,10 +283,8 @@ public class AlterTable {
/** /**
* Gets the value of the sequenceInitial property. * Gets the value of the sequenceInitial property.
* *
* @return * @return possible object is
* possible object is
* {@link BigInteger } * {@link BigInteger }
*
*/ */
public BigInteger getSequenceInitial() { public BigInteger getSequenceInitial() {
return sequenceInitial; return sequenceInitial;
@@ -350,10 +293,8 @@ public class AlterTable {
/** /**
* Sets the value of the sequenceInitial property. * Sets the value of the sequenceInitial property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link BigInteger } * {@link BigInteger }
*
*/ */
public void setSequenceInitial(BigInteger value) { public void setSequenceInitial(BigInteger value) {
this.sequenceInitial = value; this.sequenceInitial = value;
@@ -362,10 +303,8 @@ public class AlterTable {
/** /**
* Gets the value of the sequenceAllocate property. * Gets the value of the sequenceAllocate property.
* *
* @return * @return possible object is
* possible object is
* {@link BigInteger } * {@link BigInteger }
*
*/ */
public BigInteger getSequenceAllocate() { public BigInteger getSequenceAllocate() {
return sequenceAllocate; return sequenceAllocate;
@@ -374,10 +313,8 @@ public class AlterTable {
/** /**
* Sets the value of the sequenceAllocate property. * Sets the value of the sequenceAllocate property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link BigInteger } * {@link BigInteger }
*
*/ */
public void setSequenceAllocate(BigInteger value) { public void setSequenceAllocate(BigInteger value) {
this.sequenceAllocate = value; this.sequenceAllocate = value;
@@ -386,10 +323,8 @@ public class AlterTable {
/** /**
* Gets the value of the pkName property. * Gets the value of the pkName property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getPkName() { public String getPkName() {
return pkName; return pkName;
@@ -398,10 +333,8 @@ public class AlterTable {
/** /**
* Sets the value of the pkName property. * Sets the value of the pkName property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setPkName(String value) { public void setPkName(String value) {
this.pkName = value; this.pkName = value;
@@ -410,10 +343,8 @@ public class AlterTable {
/** /**
* Gets the value of the storageEngine property. * Gets the value of the storageEngine property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getStorageEngine() { public String getStorageEngine() {
return storageEngine; return storageEngine;
@@ -422,10 +353,8 @@ public class AlterTable {
/** /**
* Sets the value of the storageEngine property. * Sets the value of the storageEngine property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setStorageEngine(String value) { public void setStorageEngine(String value) {
this.storageEngine = value; this.storageEngine = value;
@@ -434,10 +363,8 @@ public class AlterTable {
/** /**
* Gets the value of the tablespace property. * Gets the value of the tablespace property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getTablespace() { public String getTablespace() {
return tablespace; return tablespace;
@@ -446,10 +373,8 @@ public class AlterTable {
/** /**
* Sets the value of the tablespace property. * Sets the value of the tablespace property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setTablespace(String value) { public void setTablespace(String value) {
this.tablespace = value; this.tablespace = value;
@@ -458,10 +383,8 @@ public class AlterTable {
/** /**
* Gets the value of the indexTablespace property. * Gets the value of the indexTablespace property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getIndexTablespace() { public String getIndexTablespace() {
return indexTablespace; return indexTablespace;
@@ -470,10 +393,8 @@ public class AlterTable {
/** /**
* Sets the value of the indexTablespace property. * Sets the value of the indexTablespace property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setIndexTablespace(String value) { public void setIndexTablespace(String value) {
this.indexTablespace = value; this.indexTablespace = value;
@@ -502,10 +423,8 @@ public class AlterTable {
/** /**
* Gets the value of the comment property. * Gets the value of the comment property.
* *
* @return * @return possible object is
* possible object is
* {@link String } * {@link String }
*
*/ */
public String getComment() { public String getComment() {
return comment; return comment;
@@ -514,10 +433,8 @@ public class AlterTable {
/** /**
* Sets the value of the comment property. * Sets the value of the comment property.
* *
* @param value * @param value allowed object is
* allowed object is
* {@link String } * {@link String }
*
*/ */
public void setComment(String value) { public void setComment(String value) {
this.comment = value; this.comment = value;
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/** /**
@@ -13,12 +9,12 @@ import javax.xml.bind.annotation.XmlValue;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;simpleContent> * &lt;simpleContent&gt;
* &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
* &lt;/extension> * &lt;/extension&gt;
* &lt;/simpleContent> * &lt;/simpleContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,12 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
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.XmlType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -17,23 +11,23 @@ import java.util.List;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence> * &lt;sequence&gt;
* &lt;choice> * &lt;choice&gt;
* &lt;group ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetChildren" maxOccurs="unbounded" minOccurs="0"/> * &lt;group ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetChildren" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/choice> * &lt;/choice&gt;
* &lt;/sequence> * &lt;/sequence&gt;
* &lt;attribute name="type" use="required" type="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetType" /> * &lt;attribute name="type" use="required" type="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSetType" /&gt;
* &lt;attribute name="dropsFor" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="dropsFor" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="suppressDropsForever" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="suppressDropsForever" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="generated" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="generated" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="author" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="author" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -46,6 +40,7 @@ public class ChangeSet {
@XmlElements({ @XmlElements({
@XmlElement(name = "configuration", type = Configuration.class), @XmlElement(name = "configuration", type = Configuration.class),
@XmlElement(name = "sql", type = Sql.class), @XmlElement(name = "sql", type = Sql.class),
@XmlElement(name = "createSchema", type = CreateSchema.class),
@XmlElement(name = "createTable", type = CreateTable.class), @XmlElement(name = "createTable", type = CreateTable.class),
@XmlElement(name = "alterTable", type = AlterTable.class), @XmlElement(name = "alterTable", type = AlterTable.class),
@XmlElement(name = "dropTable", type = DropTable.class), @XmlElement(name = "dropTable", type = DropTable.class),
@@ -82,7 +77,7 @@ public class ChangeSet {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the changeSetChildren property. * This is why there is not a <CODE>set</CODE> method for the changeSetChildren property.
* *
* <p> * <p>
@@ -94,22 +89,24 @@ public class ChangeSet {
* *
* <p> * <p>
* Objects of the following type(s) are allowed in the list * Objects of the following type(s) are allowed in the list
* {@link Configuration } * {@link AddColumn }
* {@link Sql } * {@link AddHistoryTable }
* {@link CreateTable }
* {@link DropTable }
* {@link RenameTable }
* {@link AddTableComment } * {@link AddTableComment }
* {@link AddUniqueConstraint } * {@link AddUniqueConstraint }
* {@link AddHistoryTable }
* {@link DropHistoryTable }
* {@link AlterForeignKey }
* {@link AddColumn }
* {@link DropColumn }
* {@link AlterColumn } * {@link AlterColumn }
* {@link RenameColumn } * {@link AlterForeignKey }
* {@link AlterTable }
* {@link Configuration }
* {@link CreateIndex } * {@link CreateIndex }
* {@link CreateSchema }
* {@link CreateTable }
* {@link DropColumn }
* {@link DropHistoryTable }
* {@link DropIndex } * {@link DropIndex }
* {@link DropTable }
* {@link RenameColumn }
* {@link RenameTable }
* {@link Sql }
*/ */
public List<Object> getChangeSetChildren() { public List<Object> getChangeSetChildren() {
if (changeSetChildren == null) { if (changeSetChildren == null) {
@@ -9,16 +9,15 @@ import javax.xml.bind.annotation.XmlType;
* <p>Java class for changeSetType. * <p>Java class for changeSetType.
* *
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre> * <pre>
* &lt;simpleType name="changeSetType"> * &lt;simpleType name="changeSetType"&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"&gt;
* &lt;enumeration value="apply"/> * &lt;enumeration value="apply"/&gt;
* &lt;enumeration value="pendingDrops"/> * &lt;enumeration value="pendingDrops"/&gt;
* &lt;enumeration value="baseline"/> * &lt;enumeration value="baseline"/&gt;
* &lt;enumeration value="drop"/> * &lt;enumeration value="drop"/&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/simpleType> * &lt;/simpleType&gt;
* </pre> * </pre>
*/ */
@XmlType(name = "changeSetType") @XmlType(name = "changeSetType")
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -15,33 +11,33 @@ import java.util.List;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence> * &lt;sequence&gt;
* &lt;element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="before" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/> * &lt;element name="after" type="{http://ebean-orm.github.io/xml/ns/dbmigration}ddl-script" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence> * &lt;/sequence&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="defaultValue" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="notnull" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="historyExclude" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="primaryKey" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="primaryKey" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="identity" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="identity" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="checkConstraint" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="checkConstraintName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="uniqueOneToOne" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="references" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="foreignKeyName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="foreignKeyIndex" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="foreignKeyOnDelete" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="foreignKeyOnUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="comment" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -95,7 +91,7 @@ public class Column {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the before property. * This is why there is not a <CODE>set</CODE> method for the before property.
* *
* <p> * <p>
@@ -122,7 +118,7 @@ public class Column {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the after property. * This is why there is not a <CODE>set</CODE> method for the after property.
* *
* <p> * <p>
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,15 +9,15 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence> * &lt;sequence&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}defaultTablespace"/> * &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}defaultTablespace"/&gt;
* &lt;/sequence> * &lt;/sequence&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,19 +9,19 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="columns" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="columns" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="unique" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="definition" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="definition" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -0,0 +1,49 @@
package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.*;
/**
* <p>Java class for anonymous complex type.
*
* <p>The following schema fragment specifies the expected content contained within this class.
*
* <pre>
* &lt;complexType&gt;
* &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction&gt;
* &lt;/complexContent&gt;
* &lt;/complexType&gt;
* </pre>
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "")
@XmlRootElement(name = "createSchema")
public class CreateSchema {
@XmlAttribute(name = "name")
protected String name;
/**
* 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;
}
}
@@ -1,12 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlSchemaType;
import javax.xml.bind.annotation.XmlType;
import java.math.BigInteger; import java.math.BigInteger;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -18,33 +12,33 @@ import java.util.List;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence> * &lt;sequence&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/> * &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}column" maxOccurs="unbounded"/&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}uniqueConstraint" maxOccurs="unbounded" minOccurs="0"/> * &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}uniqueConstraint" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}foreignKey" maxOccurs="unbounded" minOccurs="0"/> * &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}foreignKey" maxOccurs="unbounded" minOccurs="0"/&gt;
* &lt;/sequence> * &lt;/sequence&gt;
* &lt;attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/> * &lt;attGroup ref="{http://ebean-orm.github.io/xml/ns/dbmigration}tablespaceAttributes"/&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="partitionMode" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="partitionColumn" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="draft" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="draft" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" /> * &lt;attribute name="identityType" type="{http://ebean-orm.github.io/xml/ns/dbmigration}identityType" /&gt;
* &lt;attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;attribute name="identityStart" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;attribute name="identityIncrement" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;attribute name="identityCache" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="identityGenerated" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;attribute name="sequenceInitial" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /> * &lt;attribute name="sequenceAllocate" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
* &lt;attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="pkName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="storageEngine" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -110,7 +104,7 @@ public class CreateTable {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the column property. * This is why there is not a <CODE>set</CODE> method for the column property.
* *
* <p> * <p>
@@ -137,7 +131,7 @@ public class CreateTable {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the uniqueConstraint property. * This is why there is not a <CODE>set</CODE> method for the uniqueConstraint property.
* *
* <p> * <p>
@@ -164,7 +158,7 @@ public class CreateTable {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the foreignKey property. * This is why there is not a <CODE>set</CODE> method for the foreignKey property.
* *
* <p> * <p>
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -15,16 +11,16 @@ import java.util.List;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType name="ddl-script"> * &lt;complexType name="ddl-script"&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence> * &lt;sequence&gt;
* &lt;element name="ddl" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/> * &lt;element name="ddl" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/&gt;
* &lt;/sequence> * &lt;/sequence&gt;
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -44,7 +40,7 @@ public class DdlScript {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the ddl property. * This is why there is not a <CODE>set</CODE> method for the ddl property.
* *
* <p> * <p>
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,15 +9,15 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="tables" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tables" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="indexes" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="indexes" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="history" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="history" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,15 +9,15 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="columnName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="withHistory" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,13 +9,13 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="baseTable" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,16 +9,16 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="indexName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="concurrent" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,15 +9,15 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceCol" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="sequenceCol" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="sequenceName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,19 +9,19 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="refColumnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="refColumnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="refTableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="refTableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="indexName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="onDelete" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="onUpdate" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -9,17 +9,16 @@ import javax.xml.bind.annotation.XmlType;
* <p>Java class for identityType. * <p>Java class for identityType.
* *
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* <p>
* <pre> * <pre>
* &lt;simpleType name="identityType"> * &lt;simpleType name="identityType"&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}string"&gt;
* &lt;enumeration value="identity"/> * &lt;enumeration value="identity"/&gt;
* &lt;enumeration value="sequence"/> * &lt;enumeration value="sequence"/&gt;
* &lt;enumeration value="generator"/> * &lt;enumeration value="generator"/&gt;
* &lt;enumeration value="external"/> * &lt;enumeration value="external"/&gt;
* &lt;enumeration value="default"/> * &lt;enumeration value="default"/&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/simpleType> * &lt;/simpleType&gt;
* </pre> * </pre>
*/ */
@XmlType(name = "identityType") @XmlType(name = "identityType")
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
@@ -15,15 +11,15 @@ import java.util.List;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence> * &lt;sequence&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSet" maxOccurs="unbounded"/> * &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}changeSet" maxOccurs="unbounded"/&gt;
* &lt;/sequence> * &lt;/sequence&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -42,7 +38,7 @@ public class Migration {
* <p> * <p>
* This accessor method returns a reference to the live list, * This accessor method returns a reference to the live list,
* not a snapshot. Therefore any modification you make to the * not a snapshot. Therefore any modification you make to the
* returned list will be present inside the JAXB object. * returned list will be present inside the Jakarta XML Binding object.
* This is why there is not a <CODE>set</CODE> method for the changeSet property. * This is why there is not a <CODE>set</CODE> method for the changeSet property.
* *
* <p> * <p>
@@ -27,10 +27,59 @@ public class ObjectFactory {
} }
/** /**
* Create an instance of {@link AddUniqueConstraint } * Create an instance of {@link Migration }
*/ */
public AddUniqueConstraint createAddUniqueConstraint() { public Migration createMigration() {
return new AddUniqueConstraint(); return new Migration();
}
/**
* Create an instance of {@link ChangeSet }
*/
public ChangeSet createChangeSet() {
return new ChangeSet();
}
/**
* Create an instance of {@link Configuration }
*/
public Configuration createConfiguration() {
return new Configuration();
}
/**
* Create an instance of {@link DefaultTablespace }
*/
public DefaultTablespace createDefaultTablespace() {
return new DefaultTablespace();
}
/**
* Create an instance of {@link Sql }
*/
public Sql createSql() {
return new Sql();
}
/**
* Create an instance of {@link Apply }
*/
public Apply createApply() {
return new Apply();
}
/**
* Create an instance of {@link Rollback }
*/
public Rollback createRollback() {
return new Rollback();
}
/**
* Create an instance of {@link CreateSchema }
*/
public CreateSchema createCreateSchema() {
return new CreateSchema();
} }
/** /**
@@ -69,17 +118,17 @@ public class ObjectFactory {
} }
/** /**
* Create an instance of {@link Configuration } * Create an instance of {@link AlterTable }
*/ */
public Configuration createConfiguration() { public AlterTable createAlterTable() {
return new Configuration(); return new AlterTable();
} }
/** /**
* Create an instance of {@link DefaultTablespace } * Create an instance of {@link DropTable }
*/ */
public DefaultTablespace createDefaultTablespace() { public DropTable createDropTable() {
return new DefaultTablespace(); return new DropTable();
} }
/** /**
@@ -89,6 +138,27 @@ public class ObjectFactory {
return new RenameTable(); return new RenameTable();
} }
/**
* Create an instance of {@link AddTableComment }
*/
public AddTableComment createAddTableComment() {
return new AddTableComment();
}
/**
* Create an instance of {@link AddUniqueConstraint }
*/
public AddUniqueConstraint createAddUniqueConstraint() {
return new AddUniqueConstraint();
}
/**
* Create an instance of {@link AddHistoryTable }
*/
public AddHistoryTable createAddHistoryTable() {
return new AddHistoryTable();
}
/** /**
* Create an instance of {@link DropHistoryTable } * Create an instance of {@link DropHistoryTable }
*/ */
@@ -103,55 +173,6 @@ public class ObjectFactory {
return new AlterForeignKey(); return new AlterForeignKey();
} }
/**
* Create an instance of {@link DropColumn }
*/
public DropColumn createDropColumn() {
return new DropColumn();
}
/**
* Create an instance of {@link Sql }
*/
public Sql createSql() {
return new Sql();
}
/**
* Create an instance of {@link Apply }
*/
public Apply createApply() {
return new Apply();
}
/**
* Create an instance of {@link Rollback }
*/
public Rollback createRollback() {
return new Rollback();
}
/**
* Create an instance of {@link DropIndex }
*/
public DropIndex createDropIndex() {
return new DropIndex();
}
/**
* Create an instance of {@link RenameColumn }
*/
public RenameColumn createRenameColumn() {
return new RenameColumn();
}
/**
* Create an instance of {@link DropTable }
*/
public DropTable createDropTable() {
return new DropTable();
}
/** /**
* Create an instance of {@link AddColumn } * Create an instance of {@link AddColumn }
*/ */
@@ -160,10 +181,10 @@ public class ObjectFactory {
} }
/** /**
* Create an instance of {@link AddTableComment } * Create an instance of {@link DropColumn }
*/ */
public AddTableComment createAddTableComment() { public DropColumn createDropColumn() {
return new AddTableComment(); return new DropColumn();
} }
/** /**
@@ -173,6 +194,13 @@ public class ObjectFactory {
return new AlterColumn(); return new AlterColumn();
} }
/**
* Create an instance of {@link RenameColumn }
*/
public RenameColumn createRenameColumn() {
return new RenameColumn();
}
/** /**
* Create an instance of {@link CreateIndex } * Create an instance of {@link CreateIndex }
*/ */
@@ -181,24 +209,10 @@ public class ObjectFactory {
} }
/** /**
* Create an instance of {@link ChangeSet } * Create an instance of {@link DropIndex }
*/ */
public ChangeSet createChangeSet() { public DropIndex createDropIndex() {
return new ChangeSet(); return new DropIndex();
}
/**
* Create an instance of {@link AlterTable }
*/
public AlterTable createAlterTable() {
return new AlterTable();
}
/**
* Create an instance of {@link AddHistoryTable }
*/
public AddHistoryTable createAddHistoryTable() {
return new AddHistoryTable();
} }
/** /**
@@ -208,11 +222,4 @@ public class ObjectFactory {
return new AlterHistoryTable(); return new AlterHistoryTable();
} }
/**
* Create an instance of {@link Migration }
*/
public Migration createMigration() {
return new Migration();
}
} }
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,16 +9,16 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="tableName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="dataType" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="dataType" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,14 +9,14 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="oldName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="newName" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
import javax.xml.bind.annotation.XmlValue;
/** /**
@@ -13,12 +9,12 @@ import javax.xml.bind.annotation.XmlValue;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;simpleContent> * &lt;simpleContent&gt;
* &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema>string"> * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
* &lt;/extension> * &lt;/extension&gt;
* &lt;/simpleContent> * &lt;/simpleContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,16 +9,16 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;sequence> * &lt;sequence&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}apply"/> * &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}apply"/&gt;
* &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}rollback"/> * &lt;element ref="{http://ebean-orm.github.io/xml/ns/dbmigration}rollback"/&gt;
* &lt;/sequence> * &lt;/sequence&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,10 +1,6 @@
package io.ebeaninternal.dbmigration.migration; package io.ebeaninternal.dbmigration.migration;
import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
/** /**
@@ -13,17 +9,17 @@ import javax.xml.bind.annotation.XmlType;
* <p>The following schema fragment specifies the expected content contained within this class. * <p>The following schema fragment specifies the expected content contained within this class.
* *
* <pre> * <pre>
* &lt;complexType> * &lt;complexType&gt;
* &lt;complexContent> * &lt;complexContent&gt;
* &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"> * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
* &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="columnNames" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" /> * &lt;attribute name="oneToOne" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
* &lt;attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="nullableColumns" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /> * &lt;attribute name="platforms" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
* &lt;/restriction> * &lt;/restriction&gt;
* &lt;/complexContent> * &lt;/complexContent&gt;
* &lt;/complexType> * &lt;/complexType&gt;
* </pre> * </pre>
*/ */
@XmlAccessorType(XmlAccessType.FIELD) @XmlAccessorType(XmlAccessType.FIELD)
@@ -1,23 +1,11 @@
package io.ebeaninternal.dbmigration.model; package io.ebeaninternal.dbmigration.model;
import io.ebeaninternal.dbmigration.migration.AddColumn; import io.ebeaninternal.dbmigration.migration.*;
import io.ebeaninternal.dbmigration.migration.AddHistoryTable;
import io.ebeaninternal.dbmigration.migration.AddTableComment;
import io.ebeaninternal.dbmigration.migration.AddUniqueConstraint;
import io.ebeaninternal.dbmigration.migration.AlterColumn;
import io.ebeaninternal.dbmigration.migration.AlterForeignKey;
import io.ebeaninternal.dbmigration.migration.AlterTable;
import io.ebeaninternal.dbmigration.migration.ChangeSet;
import io.ebeaninternal.dbmigration.migration.ChangeSetType;
import io.ebeaninternal.dbmigration.migration.CreateIndex;
import io.ebeaninternal.dbmigration.migration.DropColumn;
import io.ebeaninternal.dbmigration.migration.DropHistoryTable;
import io.ebeaninternal.dbmigration.migration.DropIndex;
import io.ebeaninternal.dbmigration.migration.Migration;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
import java.util.Set;
/** /**
* Used to prepare a diff in terms of changes required to migrate from * Used to prepare a diff in terms of changes required to migrate from
@@ -117,9 +105,15 @@ public class ModelDiff {
* Compare to a 'newer' model and collect the differences. * Compare to a 'newer' model and collect the differences.
*/ */
public void compareTo(ModelContainer newModel) { public void compareTo(ModelContainer newModel) {
Set<String> baseSchemas = baseModel.getSchemas();
for (String schema : newModel.getSchemas()) {
if (!baseSchemas.contains(schema)) {
addCreateSchema(schema);
}
}
Map<String, MTable> newTables = newModel.getTables(); Map<String, MTable> newTables = newModel.getTables();
for (MTable newTable : newTables.values()) { for (MTable newTable : newTables.values()) {
MTable currentTable = baseModel.getTable(newTable.getName()); MTable currentTable = baseModel.getTable(newTable.getName());
if (currentTable == null) { if (currentTable == null) {
addNewTable(newTable); addNewTable(newTable);
@@ -159,6 +153,12 @@ public class ModelDiff {
} }
} }
protected void addCreateSchema(String schema) {
CreateSchema createSchema = new CreateSchema();
createSchema.setName(schema);
applyChanges.add(createSchema);
}
protected void addDropTable(MTable existingTable) { protected void addDropTable(MTable existingTable) {
dropChanges.add(existingTable.dropTable()); dropChanges.add(existingTable.dropTable());
} }
@@ -97,6 +97,12 @@
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="createSchema">
<xsd:complexType>
<xsd:attribute name="name" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
<!-- TABLE --> <!-- TABLE -->
<xsd:element name="createTable"> <xsd:element name="createTable">
@@ -372,6 +378,7 @@
<xsd:element ref="configuration" maxOccurs="1"/> <xsd:element ref="configuration" maxOccurs="1"/>
<xsd:element ref="sql" maxOccurs="unbounded"/> <xsd:element ref="sql" maxOccurs="unbounded"/>
<xsd:element ref="createSchema" maxOccurs="unbounded"/>
<xsd:element ref="createTable" maxOccurs="unbounded"/> <xsd:element ref="createTable" maxOccurs="unbounded"/>
<xsd:element ref="alterTable" maxOccurs="unbounded"/> <xsd:element ref="alterTable" maxOccurs="unbounded"/>
<xsd:element ref="dropTable" maxOccurs="unbounded"/> <xsd:element ref="dropTable" maxOccurs="unbounded"/>
@@ -390,7 +397,6 @@
<xsd:element ref="createIndex" maxOccurs="unbounded"/> <xsd:element ref="createIndex" maxOccurs="unbounded"/>
<xsd:element ref="dropIndex" maxOccurs="unbounded"/> <xsd:element ref="dropIndex" maxOccurs="unbounded"/>
</xsd:choice> </xsd:choice>
</xsd:group> </xsd:group>
@@ -5,13 +5,11 @@ import io.ebean.platform.clickhouse.ClickHousePlatform;
import io.ebean.platform.h2.H2Platform; import io.ebean.platform.h2.H2Platform;
import io.ebean.platform.mysql.MySqlPlatform; import io.ebean.platform.mysql.MySqlPlatform;
import io.ebean.platform.oracle.OraclePlatform; import io.ebean.platform.oracle.OraclePlatform;
import io.ebeaninternal.dbmigration.ddlgeneration.BaseDdlHandler;
import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite; import io.ebeaninternal.dbmigration.ddlgeneration.DdlWrite;
import io.ebeaninternal.dbmigration.ddlgeneration.Helper; import io.ebeaninternal.dbmigration.ddlgeneration.Helper;
import io.ebeaninternal.dbmigration.ddlgeneration.PlatformDdlBuilder; import io.ebeaninternal.dbmigration.ddlgeneration.PlatformDdlBuilder;
import io.ebeaninternal.dbmigration.migration.AddTableComment; import io.ebeaninternal.dbmigration.migration.*;
import io.ebeaninternal.dbmigration.migration.AlterColumn;
import io.ebeaninternal.dbmigration.migration.Column;
import io.ebeaninternal.dbmigration.migration.CreateTable;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.util.List; import java.util.List;
@@ -19,14 +17,53 @@ import java.util.List;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertEquals;
class BaseTableDdlTest {
public class BaseTableDdlTest {
private final DatabaseConfig serverConfig = new DatabaseConfig(); private final DatabaseConfig serverConfig = new DatabaseConfig();
private final PlatformDdl h2ddl = PlatformDdlBuilder.create(new H2Platform()); private final PlatformDdl h2ddl = PlatformDdlBuilder.create(new H2Platform());
@Test @Test
public void testAlterColumn() { void createSchema_h2() {
BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl);
CreateSchema createSchema = new CreateSchema();
createSchema.setName("foo");
DdlWrite writer = new DdlWrite();
ddlGen.generate(writer, createSchema);
String ddl = writer.toString();
assertThat(ddl).contains("-- apply changes\n");
assertThat(ddl).contains("create schema if not exists foo;");
}
@Test
void createSchema_oracle() {
final PlatformDdl oraDDL = PlatformDdlBuilder.create(new OraclePlatform());
BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, oraDDL);
CreateSchema createSchema = new CreateSchema();
createSchema.setName("foo");
DdlWrite writer = new DdlWrite();
ddlGen.generate(writer, createSchema);
assertThat(writer.toString())
.contains("-- apply changes\n")
.contains("-- create schema if not exists foo;");
ChangeSet changeSet = new ChangeSet();
changeSet.getChangeSetChildren().add(createSchema);
BaseDdlHandler ddlHandler = new BaseDdlHandler(new DatabaseConfig(), oraDDL);
DdlWrite writer2 = new DdlWrite();
ddlHandler.generate(writer2, changeSet);
assertThat(writer.toString())
.contains("-- apply changes\n")
.contains("-- create schema if not exists foo;");
}
@Test
void testAlterColumn() {
BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl); BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl);
DdlWrite writer = new DdlWrite(); DdlWrite writer = new DdlWrite();
@@ -44,8 +81,7 @@ public class BaseTableDdlTest {
} }
@Test @Test
public void testAddColumn_withTypeConversion() { void testAddColumn_withTypeConversion() {
BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, PlatformDdlBuilder.create(new OraclePlatform())); BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, PlatformDdlBuilder.create(new OraclePlatform()));
DdlWrite writer = new DdlWrite(); DdlWrite writer = new DdlWrite();
@@ -61,8 +97,7 @@ public class BaseTableDdlTest {
} }
@Test @Test
public void testAddColumn_withTypeConversion_clickHouseVarchar() { void testAddColumn_withTypeConversion_clickHouseVarchar() {
ClickHouseTableDdl ddlGen = new ClickHouseTableDdl(serverConfig, PlatformDdlBuilder.create(new ClickHousePlatform())); ClickHouseTableDdl ddlGen = new ClickHouseTableDdl(serverConfig, PlatformDdlBuilder.create(new ClickHousePlatform()));
DdlWrite writer = new DdlWrite(); DdlWrite writer = new DdlWrite();
@@ -78,8 +113,7 @@ public class BaseTableDdlTest {
} }
@Test @Test
public void testAlterColumnComment() { void testAlterColumnComment() {
BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl); BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl);
DdlWrite writer = new DdlWrite(); DdlWrite writer = new DdlWrite();
@@ -96,7 +130,7 @@ public class BaseTableDdlTest {
} }
@Test @Test
public void alterTableAddColumnWithComment() { void alterTableAddColumnWithComment() {
BaseTableDdl ddl = new BaseTableDdl(serverConfig, h2ddl); BaseTableDdl ddl = new BaseTableDdl(serverConfig, h2ddl);
DdlWrite writer = new DdlWrite(); DdlWrite writer = new DdlWrite();
Column column = new Column(); Column column = new Column();
@@ -111,8 +145,7 @@ public class BaseTableDdlTest {
} }
@Test @Test
public void testAddTableComment() { void testAddTableComment() {
BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl); BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl);
DdlWrite writer = new DdlWrite(); DdlWrite writer = new DdlWrite();
@@ -128,8 +161,7 @@ public class BaseTableDdlTest {
} }
@Test @Test
public void testAddTableComment_mysql() { void testAddTableComment_mysql() {
BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, PlatformDdlBuilder.create(new MySqlPlatform())); BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, PlatformDdlBuilder.create(new MySqlPlatform()));
DdlWrite writer = new DdlWrite(); DdlWrite writer = new DdlWrite();
@@ -145,8 +177,7 @@ public class BaseTableDdlTest {
} }
@Test @Test
public void testGenerate() throws Exception { void testGenerate() throws Exception {
BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl); BaseTableDdl ddlGen = new BaseTableDdl(serverConfig, h2ddl);
DdlWrite writer = new DdlWrite(); DdlWrite writer = new DdlWrite();
@@ -2,10 +2,7 @@ package io.ebeaninternal.dbmigration.model;
import io.ebean.migration.MigrationVersion; import io.ebean.migration.MigrationVersion;
import io.ebeaninternal.dbmigration.migration.DropHistoryTable; import io.ebeaninternal.dbmigration.migration.*;
import io.ebeaninternal.dbmigration.migration.DropIndex;
import io.ebeaninternal.dbmigration.migration.DropTable;
import io.ebeaninternal.dbmigration.migration.Migration;
import io.ebeaninternal.dbmigration.migrationreader.MigrationXmlReader; import io.ebeaninternal.dbmigration.migrationreader.MigrationXmlReader;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
@@ -14,11 +11,10 @@ import java.util.Set;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
public class ModelContainerTest { class ModelContainerTest {
@Test @Test
public void elementCollectionTable_single_expect_foreignKeys() { void elementCollectionTable_single_expect_foreignKeys() {
ModelContainer container = new ModelContainer(); ModelContainer container = new ModelContainer();
container.addTableElementCollection(createElementCollectionTable("ec_bean.id", "fk_ec_bean_ec_table")); container.addTableElementCollection(createElementCollectionTable("ec_bean.id", "fk_ec_bean_ec_table"));
@@ -29,8 +25,7 @@ public class ModelContainerTest {
} }
@Test @Test
public void elementCollectionTable_reused_expect_noForeignKeys() { void elementCollectionTable_reused_expect_noForeignKeys() {
ModelContainer container = new ModelContainer(); ModelContainer container = new ModelContainer();
container.addTableElementCollection(createElementCollectionTable("ec_bean.id", "fk_ec_bean_ec_table")); container.addTableElementCollection(createElementCollectionTable("ec_bean.id", "fk_ec_bean_ec_table"));
@@ -47,7 +42,6 @@ public class ModelContainerTest {
} }
private MTable createElementCollectionTable(String references, String fkName) { private MTable createElementCollectionTable(String references, String fkName) {
MTable ecTable = new MTable("ec_table"); MTable ecTable = new MTable("ec_table");
final MColumn colFk = new MColumn("fk_col", "varchar", true); final MColumn colFk = new MColumn("fk_col", "varchar", true);
colFk.setReferences(references); colFk.setReferences(references);
@@ -62,8 +56,7 @@ public class ModelContainerTest {
} }
@Test @Test
public void apply_when_noPendingDrops_then_emptyPending() { void apply_when_noPendingDrops_then_emptyPending() {
ModelContainer container = new ModelContainer(); ModelContainer container = new ModelContainer();
container.apply(mig("1.0.model.xml"), ver("1.1")); container.apply(mig("1.0.model.xml"), ver("1.1"));
assertThat(container.getPendingDrops()).isEmpty(); assertThat(container.getPendingDrops()).isEmpty();
@@ -71,8 +64,7 @@ public class ModelContainerTest {
@Test @Test
public void apply_when_pendingDrops_then_registeredHistoryTable() { void apply_when_pendingDrops_then_registeredHistoryTable() {
ModelContainer base = container_1_1(); ModelContainer base = container_1_1();
MTable table = base.getTable("document"); MTable table = base.getTable("document");
@@ -85,8 +77,7 @@ public class ModelContainerTest {
@Test @Test
public void apply_when_pendingDropsApplied_then_droppedTableNotInHistory() { void apply_when_pendingDropsApplied_then_droppedTableNotInHistory() {
ModelContainer container = container_1_1(); ModelContainer container = container_1_1();
container.apply(mig("1.1_2__drops.model.xml"), ver("1.1_2")); container.apply(mig("1.1_2__drops.model.xml"), ver("1.1_2"));
@@ -99,8 +90,7 @@ public class ModelContainerTest {
} }
@Test @Test
public void apply_when_apply_partial_pendingDrops_then_some_remainder() { void apply_when_apply_partial_pendingDrops_then_some_remainder() {
ModelContainer container = container_2_1(); ModelContainer container = container_2_1();
container.apply(mig("2.2__drops.model.xml"), ver("2.2")); container.apply(mig("2.2__drops.model.xml"), ver("2.2"));
@@ -116,30 +106,28 @@ public class ModelContainerTest {
} }
@Test @Test
public void apply_sql() { void apply_sql() {
ModelContainer container = new ModelContainer(); ModelContainer container = new ModelContainer();
container.apply(mig("3.0__rawSql.model.xml"), ver("3.0")); container.apply(mig("3.0__rawSql.model.xml"), ver("3.0"));
assertThat(container.getPendingDrops()).isEmpty(); assertThat(container.getPendingDrops()).isEmpty();
} }
@Test @Test
public void apply_alterForeignKey() { void apply_alterForeignKey() {
ModelContainer container = new ModelContainer(); ModelContainer container = new ModelContainer();
container.apply(mig("4.0__alterForeignKey.model.xml"), ver("4.0")); container.apply(mig("4.0__alterForeignKey.model.xml"), ver("4.0"));
assertThat(container.getPendingDrops()).isEmpty(); assertThat(container.getPendingDrops()).isEmpty();
} }
@Test @Test
public void apply_dropTable_when_notInModel_then_ok() { void apply_dropTable_when_notInModel_then_ok() {
ModelContainer container = new ModelContainer(); ModelContainer container = new ModelContainer();
container.apply(mig("5.0__dropTable.model.xml"), ver("5.0")); container.apply(mig("5.0__dropTable.model.xml"), ver("5.0"));
assertThat(container.getTables()).isEmpty(); assertThat(container.getTables()).isEmpty();
} }
@Test @Test
public void apply_drop_when_notInModel_then_ok() { void apply_drop_when_notInModel_then_ok() {
ModelContainer container = new ModelContainer(); ModelContainer container = new ModelContainer();
DropTable dropTable = new DropTable(); DropTable dropTable = new DropTable();
dropTable.setName("DoesNotExist"); dropTable.setName("DoesNotExist");
@@ -155,7 +143,7 @@ public class ModelContainerTest {
} }
@Test @Test
public void apply_renameColumn() { void apply_renameColumn() {
ModelContainer container = new ModelContainer(); ModelContainer container = new ModelContainer();
container.apply(mig("6.0__renameColumn.model.xml"), ver("6.0")); container.apply(mig("6.0__renameColumn.model.xml"), ver("6.0"));
@@ -165,8 +153,7 @@ public class ModelContainerTest {
} }
@Test @Test
public void getSchemas() { void getSchemas() {
MTable t0 = new MTable("foo.one"); MTable t0 = new MTable("foo.one");
MTable t1 = new MTable("foo.two"); MTable t1 = new MTable("foo.two");
MTable t2 = new MTable("bar.three"); MTable t2 = new MTable("bar.three");
@@ -1,15 +1,18 @@
package io.ebeaninternal.dbmigration.model; package io.ebeaninternal.dbmigration.model;
import io.ebeaninternal.dbmigration.migration.ChangeSet;
import io.ebeaninternal.dbmigration.migration.CreateSchema;
import io.ebeaninternal.dbmigration.migration.CreateTable;
import org.junit.jupiter.api.Test; import org.junit.jupiter.api.Test;
import java.util.List;
import static org.assertj.core.api.Assertions.assertThat; import static org.assertj.core.api.Assertions.assertThat;
class ModelDiffTest {
public class ModelDiffTest {
@Test @Test
public void test_compareTo_with_dropColumnOnHistoryTable_then_historyColumnRegistered() throws Exception { void test_compareTo_with_dropColumnOnHistoryTable_then_historyColumnRegistered() throws Exception {
ModelContainer base = new ModelContainer(); ModelContainer base = new ModelContainer();
base.addTable(MTableTest.base().setWithHistory(true)); base.addTable(MTableTest.base().setWithHistory(true));
@@ -24,4 +27,27 @@ public class ModelDiffTest {
assertThat(tab.allHistoryColumns(true)).contains("status"); assertThat(tab.allHistoryColumns(true)).contains("status");
assertThat(tab.allColumns()).extracting("name").doesNotContain("status"); assertThat(tab.allColumns()).extracting("name").doesNotContain("status");
} }
@Test
void schemaDiff() {
ModelContainer base = new ModelContainer();
base.addTable(new MTable("foo.one"));
base.addTable(new MTable("bar.two"));
ModelDiff modelDiff = new ModelDiff(base);
ModelContainer newOne = new ModelContainer();
newOne.addTable(new MTable("bazz.three"));
newOne.addTable(new MTable("foo.one"));
newOne.addTable(new MTable("buzz.four"));
modelDiff.compareTo(newOne);
ChangeSet apply = modelDiff.getApplyChangeSet();
List<Object> children = apply.getChangeSetChildren();
assertThat(children).hasSize(4);
assertThat(((CreateSchema) children.get(0)).getName()).isEqualTo("bazz");
assertThat(((CreateSchema) children.get(1)).getName()).isEqualTo("buzz");
assertThat(children.get(2)).isInstanceOf(CreateTable.class);
assertThat(children.get(3)).isInstanceOf(CreateTable.class);
}
} }