Skip to content

Commit

Permalink
Allow for namespace override on migration rake task
Browse files Browse the repository at this point in the history
  • Loading branch information
mbklein committed Jun 16, 2017
1 parent 224cec4 commit 39e34dc
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions lib/tasks/avalon.rake
@@ -1,11 +1,11 @@
# Copyright 2011-2017, The Trustees of Indiana University and Northwestern
# University. Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
#
# You may obtain a copy of the License at
#
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#
# Unless required by applicable law or agreed to in writing, software distributed
# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
# CONDITIONS OF ANY KIND, either express or implied. See the License for the
Expand Down Expand Up @@ -43,13 +43,14 @@ EOC
ids = Array(ids) | File.readlines(ENV['pidfile']).map(&:strip) unless ENV['pidfile'].nil?
parallel_processes = ENV['parallel_processes']
overwrite = !!ENV['overwrite']
namespace = ENV['namespace'] || Settings&.fedora&.namespace || 'avalon'

#disable callbacks
Admin::Collection.skip_callback(:save, :around, :reindex_members)
#::MediaObject.skip_callback(:save, :before, :update_dependent_properties!)

models = [Admin::Collection, ::Lease, ::MediaObject, ::MasterFile, ::Derivative]
migrator = FedoraMigrate::ClassOrderedRepositoryMigrator.new('avalon', class_order: models, parallel_processes: parallel_processes)
migrator = FedoraMigrate::ClassOrderedRepositoryMigrator.new(namespace, class_order: models, parallel_processes: parallel_processes)
migrator.migrate_objects(ids, overwrite)
migrator
end
Expand Down

0 comments on commit 39e34dc

Please sign in to comment.