Skip to content

Commit

Permalink
Merge pull request #1156 from NASA-AMMOS/fix/schema-mismatch-constraints
Browse files Browse the repository at this point in the history
Standardize the cached Constraint results to match action results
  • Loading branch information
Mythicaeda authored Oct 3, 2023
2 parents aeb8710 + 68e0b2a commit e72ed05
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ static JsonParser<SpansSelectWhenTrue> spansSelectWhenTrueF(JsonParser<Expressio

public static final JsonParser<Violation> violationP =
productP
.field("violationWindows", listP(intervalP))
.field("windows", listP(intervalP))
.field("activityInstanceIds", listP(longP))
.map(
untuple(Violation::new),
Expand All @@ -310,8 +310,8 @@ static JsonParser<SpansSelectWhenTrue> spansSelectWhenTrueF(JsonParser<Expressio
productP
.field("violations", listP(violationP))
.field("gaps", listP(intervalP))
.field("constraintType", enumP(ConstraintType.class, Enum::name))
.field("resourceNames", listP(stringP))
.field("type", enumP(ConstraintType.class, Enum::name))
.field("resourceIds", listP(stringP))
.field("constraintId", longP)
.field("constraintName", stringP)
.map(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- The JSON schema of the constraint violations in constraint_run is changed.
-- Because the table is a cache it is safer to clear it than to attempt to transform it using SQL
truncate constraint_run;
call migrations.mark_migration_rolled_back('29');
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
-- The JSON schema of the constraint violations in constraint_run is changed.
-- Because the table is a cache it is safer to clear it than to attempt to transform it using SQL
truncate constraint_run;
call migrations.mark_migration_applied('29');
1 change: 1 addition & 0 deletions merlin-server/sql/merlin/applied_migrations.sql
Original file line number Diff line number Diff line change
Expand Up @@ -31,3 +31,4 @@ call migrations.mark_migration_applied('25');
call migrations.mark_migration_applied('26');
call migrations.mark_migration_applied('27');
call migrations.mark_migration_applied('28');
call migrations.mark_migration_applied('29');

0 comments on commit e72ed05

Please sign in to comment.