forked from nickthecook/archyve
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
nick
committed
Aug 21, 2024
1 parent
886d216
commit 8b699e2
Showing
13 changed files
with
181 additions
and
7 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module Graph | ||
class CleanGraph | ||
def initialize(collection_id = nil) | ||
@collection_id = collection_id | ||
end | ||
|
||
def execute | ||
Nodes::Entity.find_each do |entity| | ||
entity.destroy if entity.collection == @collection_id | ||
end | ||
end | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
class CleanGraphJob | ||
include Sidekiq::Job | ||
|
||
def perform(*args) | ||
collection_id = args.first | ||
|
||
# need to pass the ID here, since the Collection may be gone from the database | ||
Graph::CleanGraph.new(collection_id).clean! | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
development: | ||
url: neo4j://localhost:7687 | ||
username: neo4j | ||
password: password | ||
|
||
test: | ||
url: neo4j://localhost:7688 | ||
username: neo4j | ||
password: password | ||
|
||
production: | ||
url: | ||
- neo4j://core1:7687 | ||
- neo4j://core2:7687 | ||
- neo4j://core3:7687 | ||
username: neo4j | ||
password: password |
9 changes: 9 additions & 0 deletions
9
db/neo4j/migrate/20240723170834_force_create_nodes_entity_uuid_constraint.rb
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class ForceCreateNodesEntityUuidConstraint < ActiveGraph::Migrations::Base | ||
def up | ||
add_constraint :"Nodes::Entity", :uuid, force: true | ||
end | ||
|
||
def down | ||
drop_constraint :"Nodes::Entity", :uuid | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
db/neo4j/migrate/20240723171655_force_create_nodesentity_uuid_constraint.rb
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class ForceCreateNodesentityUuidConstraint < ActiveGraph::Migrations::Base | ||
def up | ||
add_constraint :"Nodes::entity", :uuid, force: true | ||
end | ||
|
||
def down | ||
drop_constraint :"Nodes::entity", :uuid | ||
end | ||
end |
9 changes: 9 additions & 0 deletions
9
db/neo4j/migrate/20240723174748_force_create_entity_uuid_constraint.rb
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
class ForceCreateEntityUuidConstraint < ActiveGraph::Migrations::Base | ||
def up | ||
add_constraint :Entity, :uuid, force: true | ||
end | ||
|
||
def down | ||
drop_constraint :Entity, :uuid | ||
end | ||
end |
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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
# This file is auto-generated from the current state of the database. Instead | ||
# of editing this file, please use the migrations feature of Node to | ||
# incrementally modify your database, and then regenerate this schema definition. | ||
# | ||
# Note that this schema.yml definition is the authoritative source for your | ||
# database schema. If you need to create the application database on another | ||
# system, you should be using neo4j:schema:load, not running all the migrations | ||
# from scratch. The latter is a flawed and unsustainable approach (the more migrations | ||
# you'll amass, the slower it'll run and the greater likelihood for issues). | ||
# | ||
# It's strongly recommended that you check this file into your version control system. | ||
|
||
--- | ||
:constraints: | ||
- CREATE CONSTRAINT `constraint_af0384` FOR (n:`Nodes::Entity`) REQUIRE (n.`uuid`) | ||
IS UNIQUE | ||
- CREATE CONSTRAINT `constraint_c11d06c2` FOR (n:`Nodes::entity`) REQUIRE (n.`uuid`) | ||
IS UNIQUE | ||
- CREATE CONSTRAINT `constraint_db82530b` FOR (n:`Entity`) REQUIRE (n.`uuid`) IS UNIQUE | ||
- CREATE CONSTRAINT `constraint_dbcee0a4` FOR (n:`ActiveGraph::Migrations::SchemaMigration`) | ||
REQUIRE (n.`migration_id`) IS UNIQUE | ||
:indexes: [] | ||
:versions: | ||
- '20240723170834' | ||
- '20240723171655' | ||
- '20240723174748' |
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