Sha256: 500b4f2207240230fd2e4bbd55402bfbffccc62347e43dfeeae1979794f37fdd

Contents?: true

Size: 764 Bytes

Versions: 7

Compression:

Stored size: 764 Bytes

Contents

require 'neo4j/migration'

namespace :neo4j do
  desc "Run a script against the database to perform system-wide changes"
  task :migrate, [:task_name, :subtask] => :environment do |_, args|
    path = Rake.original_dir
    migration_task = args[:task_name]
    task_name_constant = migration_task.split('_').map { |word| word.capitalize }.join('')
    begin
    migration_class = "Neo4j::Migration::#{task_name_constant}".constantize
    rescue NameError
      load File.join(path, 'db', 'neo4j-migrate', "#{migration_task}.rb")
      migration_class = "#{task_name_constant}".constantize
    end
    migration = migration_class.new(path)

    subtask = args[:subtask]
    if subtask
      migration.send(subtask)
    else
      migration.migrate
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
neo4j-4.0.0 lib/neo4j/tasks/migration.rake
neo4j-4.0.0.rc.4 lib/neo4j/tasks/migration.rake
neo4j-4.0.0.rc.3 lib/neo4j/tasks/migration.rake
neo4j-4.0.0.rc.1 lib/neo4j/tasks/migration.rake
neo4j-3.0.4 lib/neo4j/tasks/migration.rake
neo4j-3.0.3 lib/neo4j/tasks/migration.rake
neo4j-3.0.2 lib/neo4j/tasks/migration.rake