Skip to content

Commit

Permalink
Remove explicit schema version in updater
Browse files Browse the repository at this point in the history
  • Loading branch information
To-om committed May 25, 2020
1 parent 28611b9 commit a2232ba
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 1 addition & 1 deletion ScalliGraph
3 changes: 0 additions & 3 deletions thehive/app/org/thp/thehive/models/SchemaUpdater.scala
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,11 @@ class SchemaUpdater @Inject() (theHiveSchema: TheHiveSchema, db: Database, userS
applicationLifeCycle.addStopHook(() => Future.successful(db.close()))

Operations("thehive", theHiveSchema)
.forVersion(2)
.addProperty[Option[Boolean]]("Observable", "seen")
.updateGraph("Add manageConfig permission to org-admin profile", "Profile") { traversal =>
Try(traversal.has("name", "org-admin").raw.property(Key("permissions") -> "manageConfig").iterate())
Success(())
}
.forVersion(3)
.updateGraph("Remove duplicate custom fields", "CustomField") { traversal =>
traversal.toIterator.foldLeft(Set.empty[String]) { (names, vertex) =>
val name = vertex.value[String]("name")
Expand All @@ -39,7 +37,6 @@ class SchemaUpdater @Inject() (theHiveSchema: TheHiveSchema, db: Database, userS
Success(())
}
.addIndex("CustomField", IndexType.unique, "name")
.forVersion(4)
.dbOperation[JanusDatabase]("Remove locks") { db =>
def removePropertyLock(name: String) =
db.managementTransaction { mgmt =>
Expand Down

0 comments on commit a2232ba

Please sign in to comment.