Module: Neo4j::Migrations::Schema

Defined in:
lib/neo4j/migrations/schema.rb

Class Method Summary collapse

Class Method Details

.fetch_schema_data(session) ⇒ Object



5
6
7
8
# File 'lib/neo4j/migrations/schema.rb', line 5

def fetch_schema_data(session)
  {constraints: fetch_constraint_descriptions(session).sort,
   indexes: fetch_index_descriptions(session).sort}
end

.synchronize_schema_data(session, schema_data, remove_missing) ⇒ Object



10
11
12
13
14
15
16
17
# File 'lib/neo4j/migrations/schema.rb', line 10

def synchronize_schema_data(session, schema_data, remove_missing)
  queries = []
  queries += drop_and_create_queries(fetch_constraint_descriptions(session), schema_data[:constraints], remove_missing)
  queries += drop_and_create_queries(fetch_index_descriptions(session), schema_data[:indexes], remove_missing)
  session.queries do
    queries.each { |query| append query }
  end
end