diff --git a/model/src/main/java/lcsb/mapviewer/model/map/model/SubmodelConnection.java b/model/src/main/java/lcsb/mapviewer/model/map/model/SubmodelConnection.java index d8b581c8c0409a529ae5a5b73241d95a8724ff21..d3fbc2027ff027de8c95169fd4c399baca2115ce 100644 --- a/model/src/main/java/lcsb/mapviewer/model/map/model/SubmodelConnection.java +++ b/model/src/main/java/lcsb/mapviewer/model/map/model/SubmodelConnection.java @@ -6,6 +6,8 @@ import javax.persistence.DiscriminatorColumn; import javax.persistence.DiscriminatorType; import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; import javax.persistence.FetchType; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; @@ -63,6 +65,7 @@ public abstract class SubmodelConnection implements Serializable { /** * Type of the connection. */ + @Enumerated(EnumType.STRING) private SubmodelType type; /** diff --git a/persist/src/main/resources/db/migration/12.2.0~alpha.0/V12.2.0.20181024.5__submodel_type_changed_to_string.sql b/persist/src/main/resources/db/migration/12.2.0~alpha.0/V12.2.0.20181024.5__submodel_type_changed_to_string.sql new file mode 100644 index 0000000000000000000000000000000000000000..e1de1b2d3369283088e84afad0713b75f56a562f --- /dev/null +++ b/persist/src/main/resources/db/migration/12.2.0~alpha.0/V12.2.0.20181024.5__submodel_type_changed_to_string.sql @@ -0,0 +1,8 @@ +-- change in layout +alter table submodel_connection_table add column type_string varchar(31); +update submodel_connection_table set type_string='DOWNSTREAM_TARGETS' where type=0; +update submodel_connection_table set type_string='PATHWAY' where type=1; +update submodel_connection_table set type_string='UNKNOWN' where type=2; + +alter table submodel_connection_table drop column type; +alter table submodel_connection_table rename column type_string to type;