Skip to content

Commit

Permalink
#1543 Updated the database's schema
Browse files Browse the repository at this point in the history
  • Loading branch information
rriclet authored and To-om committed Nov 13, 2020
1 parent b50e646 commit 241c0be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema {
.noop // .addIndex("Tag", IndexType.unique, "namespace", "predicate", "value")
.noop // .addIndex("Audit", IndexType.basic, "requestId", "mainAction")
.rebuildIndexes
.updateGraph("Remove cases with a Deleted status", "Case") { traversal =>
traversal.unsafeHas("status", "Deleted").remove()
Success(())
}

val reflectionClasses = new Reflections(
new ConfigurationBuilder()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ class CaseCtrlTest extends PlaySpecification with TestAppBuilder {
val requestSearch = FakeRequest("POST", s"/api/v0/case/_search?range=0-15&sort=-flag&sort=-startDate&nstats=true")
.withHeaders("user" -> "socuser@thehive.local")
.withJsonBody(
Json.parse("""{"query":{"_and":[{"_field":"customFields.boolean1","_value":true},{"_not":{"status":"Deleted"}}]}}""")
Json.parse("""{"query":{"_and":[{"_field":"customFields.boolean1","_value":true}]}}""")
)
val resultSearch = app[CaseCtrl].search()(requestSearch)
status(resultSearch) must equalTo(200).updateMessage(s => s"$s\n${contentAsString(resultSearch)}")
Expand Down

0 comments on commit 241c0be

Please # to comment.