Skip to content

Commit

Permalink
#1340 Add missing index on tags
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed Jun 3, 2020
1 parent 107e558 commit 0c7bc08
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions thehive/app/org/thp/thehive/models/SchemaUpdater.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ class SchemaUpdater @Inject() (theHiveSchema: TheHiveSchema, db: Database, userS
removeIndexLock("DataData")
removePropertyLock("data")
}
.addIndex("Tag", IndexType.tryUnique, "namespace", "predicate", "value")
.execute(db)(userSrv.getSystemAuthContext)
}
9 changes: 5 additions & 4 deletions thehive/app/org/thp/thehive/models/Tag.scala
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
package org.thp.thehive.models

import scala.util.Try
import scala.util.matching.Regex

import org.thp.scalligraph.VertexEntity
import org.thp.scalligraph.models.{DefineIndex, IndexType}
import play.api.Logger

import org.thp.scalligraph.VertexEntity
import scala.util.Try
import scala.util.matching.Regex

@DefineIndex(IndexType.tryUnique, "namespace", "predicate", "value")
@VertexEntity
case class Tag(
namespace: String,
Expand Down

0 comments on commit 0c7bc08

Please sign in to comment.