-
-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed DbMigration classes (put them in the right place) #3104
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
The migration dir contains 3 folders `v1_0`, `v1_1`, `v1_2`. | ||
|
||
The general idea is, that we try to perform a migration (=`v1.0` -> `v1.1`) and also if it is revertable (= `v1.1` -> `v1.0`) | ||
|
||
To achieve that, the directories `v1_0` and `v1_2` should be as equal as possible. Annomalies should be commented. | ||
|
||
It is also important, if new models are added, that all table names (also for M2M) are added in the `DbMigrationTest` | ||
cleanup routine. | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
package misc.migration.v1_0; | ||
package misc.migration.v1_1; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The classes form an earlier test exists only in |
||
|
||
import javax.persistence.*; | ||
import java.util.List; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,10 @@ | |
|
||
@Entity | ||
@Table(name = "migtest_e_basic") | ||
// Note: tablespaces are currently only supported for DB2 | ||
// to be prepared for future (when we support sql server filegroups), | ||
// we allow to specify the DB-platform here | ||
@Tablespace(value = "db2;TSTABLES;", index = "db2;INDEXTS;") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. copied from |
||
public class EBasic { | ||
|
||
public enum Status { | ||
|
@@ -86,7 +90,7 @@ public enum Status { | |
String indextest6; | ||
|
||
@NotNull | ||
@DbDefault("23") | ||
@DbDefault("23") // required for revert | ||
int user_id; | ||
|
||
public EBasic() { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,4 +45,13 @@ public class ETable { | |
|
||
@OneToMany(mappedBy = "foreign") | ||
List<ETable> foreigns; | ||
|
||
// @NotNull | ||
// @DbDefault("") | ||
// private String textfield; | ||
// FIXME: MariaDb produces an invalid quoted statement. We would need to fix quotes here. | ||
// but using reserved names for tables is a bad idea IMHO | ||
// actual: update "table" set textfield = '' where textfield is null; | ||
// expected: update `table` set textfield = '' where textfield is null; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is an open issue. I will not address that in this PR |
||
|
||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
1672735407, 1.0__initial.sql | ||
540706946, 1.1.sql | ||
-875723380, 1.2__dropsFor_1.1.sql | ||
688811494, 1.2__dropsFor_1.1.sql | ||
1015552567, 1.3.sql | ||
255653518, 1.4__dropsFor_1.3.sql | ||
677297367, 1.4__dropsFor_1.3.sql | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
1867456246, 1.0__initial.sql | ||
-412570267, 1.1.sql | ||
395394572, 1.2__dropsFor_1.1.sql | ||
-861259583, 1.3.sql | ||
-971909974, 1.4__dropsFor_1.3.sql | ||
1284257915, 1.1.sql | ||
856096334, 1.2__dropsFor_1.1.sql | ||
-279468991, 1.3.sql | ||
2137365848, 1.4__dropsFor_1.3.sql | ||
561281075, R__order_views.sql | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
-283216660, 1.0__initial.sql | ||
1120848440, 1.1.sql | ||
135256939, 1.2__dropsFor_1.1.sql | ||
-2139056187, 1.3.sql | ||
946163478, 1.4__dropsFor_1.3.sql | ||
-184000413, 1.1.sql | ||
-1187336846, 1.2__dropsFor_1.1.sql | ||
-1811865535, 1.3.sql | ||
-1255430844, 1.4__dropsFor_1.3.sql | ||
561281075, R__order_views.sql | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
-528359263, 1.0__initial.sql | ||
-1374084944, 1.1.sql | ||
-875723380, 1.2__dropsFor_1.1.sql | ||
-819139044, 1.3.sql | ||
255653518, 1.4__dropsFor_1.3.sql | ||
253988246, 1.1.sql | ||
688811494, 1.2__dropsFor_1.1.sql | ||
674925120, 1.3.sql | ||
677297367, 1.4__dropsFor_1.3.sql | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrote some documentation what is the intention of these tests.
@jonasPoehler FYI