mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
Merge pull request #1702 from FOCONIS/fix-mig-default-value
Fix: Migration when dbdefault is involved
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package misc.migration.v1_0;
|
||||
|
||||
import io.ebean.annotation.DbDefault;
|
||||
import io.ebean.annotation.EnumValue;
|
||||
import io.ebean.annotation.Index;
|
||||
import io.ebean.annotation.NotNull;
|
||||
@@ -32,6 +33,10 @@ public class EBasic {
|
||||
|
||||
Status status;
|
||||
|
||||
@DbDefault("N")
|
||||
@NotNull
|
||||
Status status2;
|
||||
|
||||
@Size(max=127)
|
||||
String name;
|
||||
|
||||
@@ -39,11 +44,11 @@ public class EBasic {
|
||||
String description;
|
||||
|
||||
Timestamp someDate;
|
||||
|
||||
|
||||
boolean old_boolean;
|
||||
|
||||
Boolean old_boolean2;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
ERef eref;
|
||||
|
||||
|
||||
@@ -52,6 +52,9 @@ public class EBasic {
|
||||
@DbDefault("A")
|
||||
Status status;
|
||||
|
||||
@Size(max=127)
|
||||
String status2;
|
||||
|
||||
@Index(unique = true)
|
||||
@Size(max=127)
|
||||
String name;
|
||||
|
||||
@@ -33,6 +33,10 @@ public class EBasic {
|
||||
|
||||
Status status;
|
||||
|
||||
@DbDefault("N")
|
||||
@NotNull
|
||||
Status status2;
|
||||
|
||||
@Size(max=127)
|
||||
String name;
|
||||
|
||||
@@ -40,15 +44,15 @@ public class EBasic {
|
||||
String description;
|
||||
|
||||
Timestamp someDate;
|
||||
|
||||
|
||||
boolean old_boolean;
|
||||
|
||||
Boolean old_boolean2;
|
||||
|
||||
|
||||
@ManyToOne
|
||||
ERef eref;
|
||||
|
||||
|
||||
|
||||
|
||||
// test add & remove indices
|
||||
@Index
|
||||
@Size(max=127)
|
||||
@@ -75,7 +79,7 @@ public class EBasic {
|
||||
@NotNull
|
||||
@DbDefault("23")
|
||||
int user_id;
|
||||
|
||||
|
||||
public EBasic() {
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user