lib/active_graph/migrations/schema.rb in activegraph-10.0.0.pre.beta.3 vs lib/active_graph/migrations/schema.rb in activegraph-10.0.0.pre.beta.4

- old
+ new

@@ -1,30 +1,30 @@ module ActiveGraph module Migrations module Schema class << self - def fetch_schema_data(driver) - {constraints: fetch_constraint_descriptions(driver).sort, - indexes: fetch_index_descriptions(driver).sort} + def fetch_schema_data + {constraints: fetch_constraint_descriptions.sort, + indexes: fetch_index_descriptions.sort} end - def synchronize_schema_data(driver, schema_data, remove_missing) + def synchronize_schema_data(schema_data, remove_missing) queries = [] queries += drop_and_create_queries(fetch_constraint_descriptions(driver), schema_data[:constraints], remove_missing) queries += drop_and_create_queries(fetch_index_descriptions(driver), schema_data[:indexes], remove_missing) - driver.queries do + ActiveGraph::Base.queries do queries.each { |query| append query } end end private def fetch_constraint_descriptions(driver) - driver.query('CALL db.constraints()').map(&:description) + ActiveGraph::Base.query('CALL db.constraints()').map(&:description) end def fetch_index_descriptions(driver) - result = driver.query('CALL db.indexes()') + result = ActiveGraph::Base.query('CALL db.indexes()') if result.columns.include?(:description) v3_indexes(result) else v4_indexes(result) end