mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-19 23:02:24 +00:00
Regenerated scripts & tests
This commit is contained in:
1 parent
a93e2e05c5
commit
cb89b903fd
101 files changed
+315
-5981
No files matched your search
@@ -1,89 +0,0 @@
|
||||
package misc.migration.mysql_v1_0;
|
||||
|
||||
import io.ebean.annotation.DbDefault;
|
||||
import io.ebean.annotation.EnumValue;
|
||||
import io.ebean.annotation.NotNull;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_e_basic")
|
||||
public class EBasic {
|
||||
|
||||
public enum Status {
|
||||
@EnumValue("N")
|
||||
NEW,
|
||||
|
||||
@EnumValue("A")
|
||||
ACTIVE,
|
||||
|
||||
@EnumValue("I")
|
||||
INACTIVE,
|
||||
}
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
Status status;
|
||||
|
||||
@DbDefault("N")
|
||||
@NotNull
|
||||
Status status2;
|
||||
|
||||
@Size(max=127)
|
||||
String name;
|
||||
|
||||
@Size(max=127)
|
||||
String description;
|
||||
|
||||
public EBasic() {
|
||||
|
||||
}
|
||||
|
||||
public EBasic(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDescription() {
|
||||
return description;
|
||||
}
|
||||
|
||||
public void setDescription(String description) {
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Status getStatus2() {
|
||||
return status2;
|
||||
}
|
||||
|
||||
public void setStatus2(final Status status2) {
|
||||
this.status2 = status2;
|
||||
}
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
package misc.migration.mysql_v1_1;
|
||||
|
||||
import io.ebean.annotation.EnumValue;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.Table;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
@Entity
|
||||
@Table(name = "migtest_e_basic")
|
||||
public class EBasic {
|
||||
|
||||
public enum Status {
|
||||
@EnumValue("N")
|
||||
NEW,
|
||||
|
||||
@EnumValue("A")
|
||||
ACTIVE,
|
||||
|
||||
@EnumValue("I")
|
||||
INACTIVE,
|
||||
}
|
||||
|
||||
@Id
|
||||
Integer id;
|
||||
|
||||
Status status;
|
||||
|
||||
@Size(max=127)
|
||||
String name;
|
||||
|
||||
public EBasic() {
|
||||
|
||||
}
|
||||
|
||||
public EBasic(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Integer getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(Integer id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public Status getStatus() {
|
||||
return status;
|
||||
}
|
||||
|
||||
public void setStatus(Status status) {
|
||||
this.status = status;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
@@ -51,7 +51,8 @@ public class EBasic {
|
||||
@Size(max=127)
|
||||
String name;
|
||||
|
||||
|
||||
@DbMigration(preAlter = { "-- db2 does not support parial null indices :( - so we have to clean",
|
||||
"update ${table} set status = 'N' where id = 1" }, platforms = Platform.DB2)
|
||||
@DbMigration(preAlter = "-- rename all collisions")
|
||||
@Column(unique = true)
|
||||
@Size(max=127)
|
||||
|
||||
@@ -2,9 +2,11 @@ package misc.migration.v1_1;
|
||||
|
||||
|
||||
import io.ebean.annotation.DbDefault;
|
||||
import io.ebean.annotation.DbMigration;
|
||||
import io.ebean.annotation.History;
|
||||
import io.ebean.annotation.HistoryExclude;
|
||||
import io.ebean.annotation.NotNull;
|
||||
import io.ebean.annotation.Platform;
|
||||
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
@@ -20,6 +22,13 @@ public class EHistory2 {
|
||||
Integer id;
|
||||
|
||||
@NotNull
|
||||
// see: https://mariadb.com/de/resources/blog/use-cases-for-mariadb-data-versioning/
|
||||
@DbMigration(preAlter = {
|
||||
"SET @@system_versioning_alter_history = 1",
|
||||
"update ${table} set ${column} = 'unknown' where ${column} is null"}, platforms = Platform.MARIADB)
|
||||
|
||||
// other platforms
|
||||
@DbMigration(preAlter = "update ${table} set ${column} = 'unknown' where ${column} is null")
|
||||
@DbDefault("unknown")
|
||||
String testString;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package misc.migration.v1_1;
|
||||
|
||||
import javax.persistence.ElementCollection;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.ManyToMany;
|
||||
@@ -18,6 +19,9 @@ public class MtmMaster {
|
||||
@ManyToMany
|
||||
List<MtmChild> children;
|
||||
|
||||
@ElementCollection
|
||||
List<String> phoneNumbers;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user