Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

persist banners, logos and thumbnails for collection migration #2331

Merged
merged 4 commits into from
Sep 19, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ GIT

GIT
remote: https://github.com/samvera/hyrax.git
revision: e1160bbbb1b917640515f8db1f3ad3dcdc376c47
revision: e4886f1e70a1ee9962c604a76a523ef4b32ccd46
branch: main
specs:
hyrax (5.0.1)
Expand Down
5 changes: 4 additions & 1 deletion app/jobs/migrate_resources_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,10 @@ def perform(models: [])
fm = form_for(model:).constantize.new(resource: res)
# save the form
result = Hyrax::Transactions::Container[collection_model_event_mapping[model]]
.call(fm)
.with_step_args(
'collection_resource.save_collection_banner' => { banner_unchanged_indicator: true },
'collection_resource.save_collection_logo' => { logo_unchanged_indicator: true }
).call(fm)
result.value!
end
end
Expand Down
1 change: 1 addition & 0 deletions app/models/collection_resource.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class CollectionResource < Hyrax::PcdmCollection
include Hyrax::Schema(:basic_metadata)
include Hyrax::Schema(:bulkrax_metadata)
include Hyrax::Schema(:collection_resource)
include Hyrax::Schema(:with_thumbnail)
include Hyrax::ArResource
include HykuIndexing

Expand Down
12 changes: 12 additions & 0 deletions config/metadata/with_thumbnail.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
attributes:
thumbnail_id:
type: string
predicate: http://www.ebu.ch/metadata/ontologies/ebucore/ebucore#hasRelatedImage
multiple: false
form:
display: false
primary: false
required: false
multiple: false
index_keys:
- "thumbnail_id_ssim"
17 changes: 16 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 2024_08_20_200440) do
ActiveRecord::Schema.define(version: 2024_08_23_173525) do

# These are extensions that must be enabled in order to support this database
enable_extension "hstore"
Expand Down Expand Up @@ -161,6 +161,7 @@
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "order", default: 0
t.string "status_message", default: "Pending"
t.index ["child_id"], name: "index_bulkrax_pending_relationships_on_child_id"
t.index ["importer_run_id"], name: "index_bulkrax_pending_relationships_on_importer_run_id"
t.index ["parent_id"], name: "index_bulkrax_pending_relationships_on_parent_id"
Expand Down Expand Up @@ -947,6 +948,20 @@
t.datetime "updated_at"
end

create_table "work_authorizations", force: :cascade do |t|
t.string "work_title"
t.bigint "user_id"
t.datetime "expires_at"
t.string "work_pid", null: false
t.string "scope"
t.string "error"
t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false
t.index ["expires_at"], name: "index_work_authorizations_on_expires_at"
t.index ["user_id"], name: "index_work_authorizations_on_user_id"
t.index ["work_pid"], name: "index_work_authorizations_on_work_pid"
end

create_table "work_view_stats", id: :serial, force: :cascade do |t|
t.datetime "date"
t.integer "work_views"
Expand Down
Loading