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 committed Oct 28, 2020
1 parent d72217d commit 0a2a54f
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"}}]}}""")

This comment has been minimized.

Copy link
@rriclet

rriclet Oct 28, 2020

Author Contributor

No more Deleted CaseStatus so I removed it from the test

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 0a2a54f

Please # to comment.