-
Notifications
You must be signed in to change notification settings - Fork 640
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#1731 Accept missing values in sorts
- Loading branch information
Showing
6 changed files
with
16 additions
and
16 deletions.
There are no files selected for viewing
Submodule ScalliGraph
updated
20 files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,8 +11,8 @@ import org.thp.scalligraph.EntityId | |
import org.thp.scalligraph.auth.AuthContext | ||
import org.thp.scalligraph.janus.JanusDatabase | ||
import org.thp.scalligraph.models._ | ||
import org.thp.scalligraph.traversal.Graph | ||
import org.thp.scalligraph.traversal.TraversalOps._ | ||
import org.thp.scalligraph.traversal.{Graph, Traversal} | ||
import org.thp.thehive.services.LocalUserSrv | ||
import play.api.Logger | ||
|
||
|
@@ -101,17 +101,17 @@ class TheHiveSchemaDefinition @Inject() extends Schema with UpdatableSchema { | |
.addProperty[String]("Taxonomy", "description") | ||
.addProperty[Int]("Taxonomy", "version") | ||
.dbOperation[Database]("Add Custom taxonomy vertex for each Organisation") { db => | ||
db.tryTransaction { implicit g => | ||
db.tryTransaction { implicit graph => | ||
// For each organisation, if there is no custom taxonomy, create it | ||
db.labelFilter("Organisation", Traversal.V()).unsafeHas("name", P.neq("admin")).foreach { o => | ||
val hasFreetagsTaxonomy = Traversal | ||
.V(EntityId(o.id)) | ||
graph.V("Organisation").unsafeHas("name", P.neq("admin")).foreach { o => | ||
val hasFreetagsTaxonomy = graph | ||
.V("Organisation", EntityId(o.id)) | ||
.out[OrganisationTaxonomy] | ||
.v[Taxonomy] | ||
.unsafeHas("namespace", s"_freetags_${o.id()}") | ||
.exists | ||
if (!hasFreetagsTaxonomy) { | ||
val taxoVertex = g.addVertex("Taxonomy") | ||
val taxoVertex = graph.addVertex("Taxonomy") | ||
taxoVertex.property("_label", "Taxonomy") | ||
taxoVertex.property("_createdBy", "[email protected]") | ||
taxoVertex.property("_createdAt", new Date()) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters