-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
First run at updating Spotlight/Rails
- Loading branch information
1 parent
4ccbf02
commit bf66235
Showing
13 changed files
with
88 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
Spotlight::Engine.config.thumbnail_field = :thumbnail_ssim | ||
Spotlight::Engine.config.default_browse_index_view_type = :list | ||
Spotlight::Engine.config.upload_fields = [] | ||
Spotlight::Engine.config.metadata_class = -> { ManifestMetadata } | ||
Spotlight::Engine.config.iiif_metadata_class = -> { ManifestMetadata } | ||
Spotlight::Engine.config.iiif_manifest_field = :content_metadata_iiif_manifest_field_ssi |
18 changes: 18 additions & 0 deletions
18
db/migrate/20180219235714_migrate_tags_to_sidecars.spotlight.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
# This migration comes from spotlight (originally 20170803152134) | ||
class MigrateTagsToSidecars < ActiveRecord::Migration[5.0] | ||
def up | ||
Spotlight::SolrDocumentSidecar.reset_column_information | ||
ActsAsTaggableOn::Tagging.reset_column_information | ||
|
||
ActsAsTaggableOn::Tagging.where(taggable_type: 'SolrDocument', tagger_type: 'Spotlight::Exhibit').find_each do |e| | ||
sidecar = Spotlight::SolrDocumentSidecar.find_or_create_by(document_id: e.taggable_id, document_type: 'SolrDocument', exhibit_id: e.tagger_id) | ||
e.update(taggable: sidecar) | ||
end | ||
end | ||
|
||
def down | ||
ActsAsTaggableOn::Tagging.where(taggable_type: 'Spotlight::SolrDocumentSidecar').find_each do |e| | ||
e.update(taggable: e.taggable.document) | ||
end | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
db/migrate/20180219235715_change_index_status_to_longblob.spotlight.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from spotlight (originally 20170821165811) | ||
class ChangeIndexStatusToLongblob < ActiveRecord::Migration[5.0] | ||
def change | ||
change_column :spotlight_solr_document_sidecars, :index_status, :binary, limit: 10.megabytes | ||
end | ||
end |
24 changes: 24 additions & 0 deletions
24
db/migrate/20180219235716_add_missing_indexes_on_taggings.spotlight.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# This migration comes from spotlight (originally 20171005231502) | ||
# This migration comes from acts_as_taggable_on_engine (originally 6) | ||
if ActiveRecord.gem_version >= Gem::Version.new('5.0') | ||
class AddMissingIndexesOnTaggings < ActiveRecord::Migration[4.2]; end | ||
else | ||
class AddMissingIndexesOnTaggings < ActiveRecord::Migration; end | ||
end | ||
AddMissingIndexesOnTaggings.class_eval do | ||
def change | ||
add_index :taggings, :tag_id unless index_exists? :taggings, :tag_id | ||
add_index :taggings, :taggable_id unless index_exists? :taggings, :taggable_id | ||
add_index :taggings, :taggable_type unless index_exists? :taggings, :taggable_type | ||
add_index :taggings, :tagger_id unless index_exists? :taggings, :tagger_id | ||
add_index :taggings, :context unless index_exists? :taggings, :context | ||
|
||
unless index_exists? :taggings, [:tagger_id, :tagger_type] | ||
add_index :taggings, [:tagger_id, :tagger_type] | ||
end | ||
|
||
unless index_exists? :taggings, [:taggable_id, :taggable_type, :tagger_id, :context], name: 'taggings_idy' | ||
add_index :taggings, [:taggable_id, :taggable_type, :tagger_id, :context], name: 'taggings_idy' | ||
end | ||
end | ||
end |
6 changes: 6 additions & 0 deletions
6
db/migrate/20180219235717_add_search_box_to_spotlight_searches.spotlight.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# This migration comes from spotlight (originally 20180119193632) | ||
class AddSearchBoxToSpotlightSearches < ActiveRecord::Migration[5.0] | ||
def change | ||
add_column :spotlight_searches, :search_box, :boolean, default: false | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters