Skip to content

Commit

Permalink
Updating to set mediaflux id and storage performance to Standard for …
Browse files Browse the repository at this point in the history
…imported works (#1009)
  • Loading branch information
carolyncole authored Oct 28, 2024
1 parent 34f34eb commit ed63d3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/tasks/import.rake
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ namespace :import do
mediaflux_projects = CSV.read(project_file, headers: true)
mediaflux_projects.each do |project_metadata|
project_id = project_metadata["projectID"]
byebug
existing_project = Project.where("metadata_json @> ?", JSON.dump(project_id:))
if existing_project.count > 0
puts "Skipping project #{project_id}. There are already #{existing_project.count} version of that project in the system"
Expand All @@ -60,13 +59,14 @@ namespace :import do
data_user_read_only: data_user,
project_directory: project_metadata["path"],
storage_capacity: {size: { approved: storage_size_gb, requested: storage_size_gb}, unit: {approved: "GB", requested: "GB"}},
storage_performance_expectations: { requested: "Standard", approved: "Standard" },
created_by: project_metadata["creatorUser"],
created_on: project_metadata["createdOn"]
})
if test_run
puts metadata.to_json
else
project = Project.create!(metadata:)
project = Project.create!(metadata:, mediaflux_id: project_metadata["asset"])
puts "Created project for #{project_id}"
end
end
Expand Down

0 comments on commit ed63d3a

Please sign in to comment.