Feature extend target attributes constraints (#799)

* extended target attributes key limit to 128 characters

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>

* fixed tests

Signed-off-by: Bogdan Bondar <Bogdan.Bondar@bosch-si.com>
This commit is contained in:
Bondar Bogdan
2019-02-25 14:54:30 +01:00
committed by Dominic Schabel
parent caca308f47
commit 473b6b2cc5
10 changed files with 36 additions and 15 deletions

View File

@@ -156,8 +156,8 @@ public class JpaTarget extends AbstractJpaNamedEntity implements Target, EventAw
*/
@CascadeOnDelete
@ElementCollection
@Column(name = "attribute_value", length = 128)
@MapKeyColumn(name = "attribute_key", nullable = false, length = 32)
@Column(name = "attribute_value", length = Target.CONTROLLER_ATTRIBUTE_VALUE_SIZE)
@MapKeyColumn(name = "attribute_key", nullable = false, length = Target.CONTROLLER_ATTRIBUTE_KEY_SIZE)
@CollectionTable(name = "sp_target_attributes", joinColumns = {
@JoinColumn(name = "target_id", nullable = false, updatable = false) }, foreignKey = @ForeignKey(value = ConstraintMode.CONSTRAINT, name = "fk_targ_attrib_target"))
private final Map<String, String> controllerAttributes = Collections.synchronizedMap(new HashMap<String, String>());

View File

@@ -0,0 +1 @@
ALTER TABLE sp_target_attributes ALTER COLUMN attribute_key SET DATA TYPE VARCHAR(128);

View File

@@ -0,0 +1 @@
ALTER TABLE sp_target_attributes ALTER COLUMN attribute_key VARCHAR(128);

View File

@@ -0,0 +1 @@
ALTER TABLE sp_target_attributes MODIFY attribute_key VARCHAR(128);

View File

@@ -0,0 +1 @@
ALTER TABLE sp_target_attributes ALTER COLUMN attribute_key VARCHAR(128);