enju_question 0.2.0 → 0.3.0.beta.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +4 -4
- data/app/assets/config/enju_question_manifest.js +0 -0
- data/app/controllers/answers_controller.rb +1 -1
- data/app/controllers/questions_controller.rb +1 -1
- data/app/models/answer.rb +0 -1
- data/app/models/question.rb +0 -1
- data/db/migrate/098_create_questions.rb +1 -1
- data/db/migrate/099_create_answers.rb +1 -1
- data/db/migrate/20100217054028_create_answer_has_items.rb +1 -1
- data/db/migrate/20120418124018_add_answer_feed_token_to_user.rb +1 -1
- data/lib/enju_question/version.rb +1 -1
- data/spec/controllers/answers_controller_spec.rb +83 -83
- data/spec/controllers/questions_controller_spec.rb +86 -86
- data/spec/dummy/app/models/user.rb +2 -2
- data/spec/dummy/bin/rails +1 -1
- data/spec/dummy/bin/setup +21 -12
- data/spec/dummy/bin/update +29 -0
- data/spec/dummy/bin/yarn +11 -0
- data/spec/dummy/config/application.rb +8 -17
- data/spec/dummy/config/boot.rb +4 -9
- data/spec/dummy/config/cable.yml +10 -0
- data/spec/dummy/config/database.yml +9 -9
- data/spec/dummy/config/environment.rb +4 -4
- data/spec/dummy/config/environments/development.rb +24 -11
- data/spec/dummy/config/environments/production.rb +28 -16
- data/spec/dummy/config/environments/test.rb +6 -8
- data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
- data/spec/dummy/config/initializers/assets.rb +14 -0
- data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
- data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/spec/dummy/config/initializers/inflections.rb +9 -3
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/config/initializers/wrap_parameters.rb +5 -5
- data/spec/dummy/config/locales/en.yml +30 -2
- data/spec/dummy/config/puma.rb +56 -0
- data/spec/dummy/config/secrets.yml +32 -0
- data/spec/dummy/config/spring.rb +6 -0
- data/spec/dummy/config/sunspot.yml +23 -0
- data/spec/dummy/db/migrate/001_create_agents.rb +8 -8
- data/spec/dummy/db/migrate/002_devise_create_users.rb +6 -7
- data/spec/dummy/db/migrate/005_create_manifestations.rb +14 -14
- data/spec/dummy/db/migrate/006_create_items.rb +6 -6
- data/spec/dummy/db/migrate/012_create_owns.rb +3 -3
- data/spec/dummy/db/migrate/015_create_creates.rb +3 -3
- data/spec/dummy/db/migrate/041_create_roles.rb +3 -3
- data/spec/dummy/db/migrate/047_create_produces.rb +3 -3
- data/spec/dummy/db/migrate/055_create_bookmarks.rb +3 -3
- data/spec/dummy/db/migrate/059_create_libraries.rb +8 -8
- data/spec/dummy/db/migrate/069_create_shelves.rb +4 -4
- data/spec/dummy/db/migrate/073_create_carrier_types.rb +2 -2
- data/spec/dummy/db/migrate/077_create_user_groups.rb +2 -2
- data/spec/dummy/db/migrate/080_create_library_groups.rb +3 -3
- data/spec/dummy/db/migrate/112_create_frequencies.rb +2 -2
- data/spec/dummy/db/migrate/117_create_form_of_works.rb +2 -2
- data/spec/dummy/db/migrate/120_create_baskets.rb +2 -2
- data/spec/dummy/db/migrate/124_create_bookstores.rb +2 -2
- data/spec/dummy/db/migrate/125_create_donates.rb +3 -3
- data/spec/dummy/db/migrate/130_create_request_status_types.rb +2 -2
- data/spec/dummy/db/migrate/131_create_request_types.rb +2 -2
- data/spec/dummy/db/migrate/133_create_agent_merges.rb +2 -2
- data/spec/dummy/db/migrate/134_create_agent_merge_lists.rb +1 -1
- data/spec/dummy/db/migrate/149_create_message_templates.rb +6 -6
- data/spec/dummy/db/migrate/154_create_messages.rb +3 -3
- data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +1 -1
- data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +3 -3
- data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +4 -4
- data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +2 -2
- data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +4 -4
- data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +5 -5
- data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +6 -6
- data/spec/dummy/db/migrate/20081025083323_create_countries.rb +9 -10
- data/spec/dummy/db/migrate/20081025083905_create_languages.rb +6 -7
- data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +2 -2
- data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +1 -1
- data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
- data/spec/dummy/db/migrate/20081212151614_create_bookmark_stats.rb +1 -4
- data/spec/dummy/db/migrate/20081212151820_create_bookmark_stat_has_manifestations.rb +3 -3
- data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +1 -1
- data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20090719201843_create_extents.rb +2 -2
- data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +2 -2
- data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +2 -2
- data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +2 -2
- data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +1 -1
- data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +2 -2
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +6 -6
- data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +1 -1
- data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +1 -1
- data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20100222124420_add_allow_bookmark_external_url_to_library_group.rb +2 -2
- data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +1 -1
- data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
- data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +1 -1
- data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +1 -1
- data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +1 -1
- data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +2 -2
- data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +1 -1
- data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +1 -1
- data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +1 -1
- data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +1 -1
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +2 -2
- data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +1 -1
- data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +2 -2
- data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +1 -1
- data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +1 -1
- data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +3 -3
- data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +1 -1
- data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +1 -1
- data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +1 -1
- data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +1 -1
- data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +1 -1
- data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
- data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +1 -2
- data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -2
- data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +1 -1
- data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -2
- data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +2 -3
- data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +1 -1
- data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +2 -2
- data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +1 -1
- data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +4 -4
- data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
- data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +1 -1
- data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +1 -1
- data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +4 -4
- data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +1 -1
- data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
- data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +1 -1
- data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +2 -2
- data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +2 -2
- data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +2 -2
- data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +2 -2
- data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +2 -2
- data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +2 -2
- data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +2 -2
- data/spec/dummy/db/migrate/20140524135607_create_bookmark_stat_transitions.rb +7 -3
- data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +1 -1
- data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +1 -1
- data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +2 -2
- data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +1 -1
- data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +2 -2
- data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +1 -1
- data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +1 -1
- data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +1 -1
- data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +1 -1
- data/spec/dummy/db/migrate/20140812093836_add_share_bookmarks_to_profile.rb +1 -1
- data/spec/dummy/db/migrate/20140821151023_create_colors.rb +1 -1
- data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +1 -1
- data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +1 -1
- data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +4 -5
- data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +1 -1
- data/spec/dummy/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb +1 -1
- data/spec/dummy/db/migrate/20160815045420_add_most_recent_to_bookmark_stat_transitions.rb +9 -0
- data/spec/dummy/db/migrate/20180107172413_add_constraints_to_most_recent_for_bookmark_stat_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180709023035_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +36 -0
- data/spec/dummy/db/migrate/20180709023036_add_missing_unique_indices.acts_as_taggable_on_engine.rb +26 -0
- data/spec/dummy/db/migrate/20180709023037_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +20 -0
- data/spec/dummy/db/migrate/20180709023038_add_missing_taggable_index.acts_as_taggable_on_engine.rb +15 -0
- data/spec/dummy/db/migrate/20180709023039_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +15 -0
- data/spec/dummy/db/migrate/20180709023040_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb +23 -0
- data/spec/dummy/db/schema.rb +673 -724
- data/spec/factories/answer.rb +3 -3
- data/spec/factories/profile.rb +1 -1
- data/spec/factories/question.rb +2 -2
- data/spec/factories/user.rb +1 -1
- data/spec/rails_helper.rb +4 -16
- data/spec/support/controller_macros.rb +3 -3
- metadata +232 -255
- data/spec/dummy/db/migrate/20100525171356_acts_as_taggable_on_migration.rb +0 -30
- data/spec/dummy/db/migrate/20111231145823_add_share_bookmarks_to_user.rb +0 -5
- data/spec/dummy/db/migrate/20140524142813_add_taggings_count_to_tag.rb +0 -5
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForBookmarkStatTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :bookmark_stat_transitions, %i[bookmark_stat_id most_recent], unique: true, where: "most_recent", name: "index_bookmark_stat_transitions_parent_most_recent" # , algorithm: :concurrently
|
6
|
+
change_column_null :bookmark_stat_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :bookmark_stat_transitions, name: "index_bookmark_stat_transitions_parent_most_recent"
|
11
|
+
change_column_null :bookmark_stat_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
# This migration comes from acts_as_taggable_on_engine (originally 1)
|
2
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
3
|
+
class ActsAsTaggableOnMigration < ActiveRecord::Migration[4.2]; end
|
4
|
+
else
|
5
|
+
class ActsAsTaggableOnMigration < ActiveRecord::Migration; end
|
6
|
+
end
|
7
|
+
ActsAsTaggableOnMigration.class_eval do
|
8
|
+
def self.up
|
9
|
+
create_table :tags do |t|
|
10
|
+
t.string :name
|
11
|
+
end
|
12
|
+
|
13
|
+
create_table :taggings do |t|
|
14
|
+
t.references :tag
|
15
|
+
|
16
|
+
# You should make sure that the column created is
|
17
|
+
# long enough to store the required class names.
|
18
|
+
t.references :taggable, polymorphic: true
|
19
|
+
t.references :tagger, polymorphic: true
|
20
|
+
|
21
|
+
# Limit is created to prevent MySQL error on index
|
22
|
+
# length for MyISAM table type: http://bit.ly/vgW2Ql
|
23
|
+
t.string :context, limit: 128
|
24
|
+
|
25
|
+
t.datetime :created_at
|
26
|
+
end
|
27
|
+
|
28
|
+
add_index :taggings, :tag_id
|
29
|
+
add_index :taggings, %i[taggable_id taggable_type context]
|
30
|
+
end
|
31
|
+
|
32
|
+
def self.down
|
33
|
+
drop_table :taggings
|
34
|
+
drop_table :tags
|
35
|
+
end
|
36
|
+
end
|
data/spec/dummy/db/migrate/20180709023036_add_missing_unique_indices.acts_as_taggable_on_engine.rb
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
# This migration comes from acts_as_taggable_on_engine (originally 2)
|
2
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
3
|
+
class AddMissingUniqueIndices < ActiveRecord::Migration[4.2]; end
|
4
|
+
else
|
5
|
+
class AddMissingUniqueIndices < ActiveRecord::Migration; end
|
6
|
+
end
|
7
|
+
AddMissingUniqueIndices.class_eval do
|
8
|
+
def self.up
|
9
|
+
add_index :tags, :name, unique: true
|
10
|
+
|
11
|
+
remove_index :taggings, :tag_id if index_exists?(:taggings, :tag_id)
|
12
|
+
remove_index :taggings, %i[taggable_id taggable_type context]
|
13
|
+
add_index :taggings,
|
14
|
+
%i[tag_id taggable_id taggable_type context tagger_id tagger_type],
|
15
|
+
unique: true, name: 'taggings_idx'
|
16
|
+
end
|
17
|
+
|
18
|
+
def self.down
|
19
|
+
remove_index :tags, :name
|
20
|
+
|
21
|
+
remove_index :taggings, name: 'taggings_idx'
|
22
|
+
|
23
|
+
add_index :taggings, :tag_id unless index_exists?(:taggings, :tag_id)
|
24
|
+
add_index :taggings, %i[taggable_id taggable_type context]
|
25
|
+
end
|
26
|
+
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# This migration comes from acts_as_taggable_on_engine (originally 3)
|
2
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
3
|
+
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration[4.2]; end
|
4
|
+
else
|
5
|
+
class AddTaggingsCounterCacheToTags < ActiveRecord::Migration; end
|
6
|
+
end
|
7
|
+
AddTaggingsCounterCacheToTags.class_eval do
|
8
|
+
def self.up
|
9
|
+
add_column :tags, :taggings_count, :integer, default: 0
|
10
|
+
|
11
|
+
ActsAsTaggableOn::Tag.reset_column_information
|
12
|
+
ActsAsTaggableOn::Tag.find_each do |tag|
|
13
|
+
ActsAsTaggableOn::Tag.reset_counters(tag.id, :taggings)
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.down
|
18
|
+
remove_column :tags, :taggings_count
|
19
|
+
end
|
20
|
+
end
|
data/spec/dummy/db/migrate/20180709023038_add_missing_taggable_index.acts_as_taggable_on_engine.rb
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# This migration comes from acts_as_taggable_on_engine (originally 4)
|
2
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
3
|
+
class AddMissingTaggableIndex < ActiveRecord::Migration[4.2]; end
|
4
|
+
else
|
5
|
+
class AddMissingTaggableIndex < ActiveRecord::Migration; end
|
6
|
+
end
|
7
|
+
AddMissingTaggableIndex.class_eval do
|
8
|
+
def self.up
|
9
|
+
add_index :taggings, %i[taggable_id taggable_type context]
|
10
|
+
end
|
11
|
+
|
12
|
+
def self.down
|
13
|
+
remove_index :taggings, %i[taggable_id taggable_type context]
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# This migration comes from acts_as_taggable_on_engine (originally 5)
|
2
|
+
# This migration is added to circumvent issue #623 and have special characters
|
3
|
+
# work properly
|
4
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
5
|
+
class ChangeCollationForTagNames < ActiveRecord::Migration[4.2]; end
|
6
|
+
else
|
7
|
+
class ChangeCollationForTagNames < ActiveRecord::Migration; end
|
8
|
+
end
|
9
|
+
ChangeCollationForTagNames.class_eval do
|
10
|
+
def up
|
11
|
+
if ActsAsTaggableOn::Utils.using_mysql?
|
12
|
+
execute("ALTER TABLE tags MODIFY name varchar(255) CHARACTER SET utf8 COLLATE utf8_bin;")
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# This migration comes from acts_as_taggable_on_engine (originally 6)
|
2
|
+
if ActiveRecord.gem_version >= Gem::Version.new('5.0')
|
3
|
+
class AddMissingIndexesOnTaggings < ActiveRecord::Migration[4.2]; end
|
4
|
+
else
|
5
|
+
class AddMissingIndexesOnTaggings < ActiveRecord::Migration; end
|
6
|
+
end
|
7
|
+
AddMissingIndexesOnTaggings.class_eval do
|
8
|
+
def change
|
9
|
+
add_index :taggings, :tag_id unless index_exists? :taggings, :tag_id
|
10
|
+
add_index :taggings, :taggable_id unless index_exists? :taggings, :taggable_id
|
11
|
+
add_index :taggings, :taggable_type unless index_exists? :taggings, :taggable_type
|
12
|
+
add_index :taggings, :tagger_id unless index_exists? :taggings, :tagger_id
|
13
|
+
add_index :taggings, :context unless index_exists? :taggings, :context
|
14
|
+
|
15
|
+
unless index_exists? :taggings, %i[tagger_id tagger_type]
|
16
|
+
add_index :taggings, %i[tagger_id tagger_type]
|
17
|
+
end
|
18
|
+
|
19
|
+
unless index_exists? :taggings, %i[taggable_id taggable_type tagger_id context], name: 'taggings_idy'
|
20
|
+
add_index :taggings, %i[taggable_id taggable_type tagger_id context], name: 'taggings_idy'
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
# encoding: UTF-8
|
2
1
|
# This file is auto-generated from the current state of the database. Instead
|
3
2
|
# of editing this file, please use the migrations feature of Active Record to
|
4
3
|
# incrementally modify your database, and then regenerate this schema definition.
|
@@ -11,862 +10,823 @@
|
|
11
10
|
#
|
12
11
|
# It's strongly recommended that you check this file into your version control system.
|
13
12
|
|
14
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 20180709023040) do
|
15
14
|
|
16
15
|
create_table "accepts", force: :cascade do |t|
|
17
|
-
t.integer
|
18
|
-
t.integer
|
19
|
-
t.integer
|
16
|
+
t.integer "basket_id"
|
17
|
+
t.integer "item_id"
|
18
|
+
t.integer "librarian_id"
|
20
19
|
t.datetime "created_at"
|
21
20
|
t.datetime "updated_at"
|
21
|
+
t.index ["basket_id"], name: "index_accepts_on_basket_id"
|
22
|
+
t.index ["item_id"], name: "index_accepts_on_item_id"
|
22
23
|
end
|
23
24
|
|
24
|
-
add_index "accepts", ["basket_id"], name: "index_accepts_on_basket_id"
|
25
|
-
add_index "accepts", ["item_id"], name: "index_accepts_on_item_id"
|
26
|
-
|
27
25
|
create_table "agent_import_file_transitions", force: :cascade do |t|
|
28
|
-
t.string
|
29
|
-
t.text
|
30
|
-
t.integer
|
31
|
-
t.integer
|
26
|
+
t.string "to_state"
|
27
|
+
t.text "metadata", default: "{}"
|
28
|
+
t.integer "sort_key"
|
29
|
+
t.integer "agent_import_file_id"
|
32
30
|
t.datetime "created_at"
|
33
31
|
t.datetime "updated_at"
|
32
|
+
t.index ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
|
33
|
+
t.index ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
|
34
34
|
end
|
35
35
|
|
36
|
-
add_index "agent_import_file_transitions", ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
|
37
|
-
add_index "agent_import_file_transitions", ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
|
38
|
-
|
39
36
|
create_table "agent_import_files", force: :cascade do |t|
|
40
|
-
t.integer
|
41
|
-
t.string
|
42
|
-
t.integer
|
43
|
-
t.integer
|
44
|
-
t.text
|
37
|
+
t.integer "parent_id"
|
38
|
+
t.string "content_type"
|
39
|
+
t.integer "size"
|
40
|
+
t.integer "user_id"
|
41
|
+
t.text "note"
|
45
42
|
t.datetime "executed_at"
|
46
|
-
t.string
|
47
|
-
t.string
|
48
|
-
t.integer
|
43
|
+
t.string "agent_import_file_name"
|
44
|
+
t.string "agent_import_content_type"
|
45
|
+
t.integer "agent_import_file_size"
|
49
46
|
t.datetime "agent_import_updated_at"
|
50
47
|
t.datetime "created_at"
|
51
48
|
t.datetime "updated_at"
|
52
|
-
t.string
|
53
|
-
t.text
|
54
|
-
t.string
|
55
|
-
t.string
|
49
|
+
t.string "agent_import_fingerprint"
|
50
|
+
t.text "error_message"
|
51
|
+
t.string "edit_mode"
|
52
|
+
t.string "user_encoding"
|
53
|
+
t.index ["parent_id"], name: "index_agent_import_files_on_parent_id"
|
54
|
+
t.index ["user_id"], name: "index_agent_import_files_on_user_id"
|
56
55
|
end
|
57
56
|
|
58
|
-
add_index "agent_import_files", ["parent_id"], name: "index_agent_import_files_on_parent_id"
|
59
|
-
add_index "agent_import_files", ["user_id"], name: "index_agent_import_files_on_user_id"
|
60
|
-
|
61
57
|
create_table "agent_import_results", force: :cascade do |t|
|
62
|
-
t.integer
|
63
|
-
t.integer
|
64
|
-
t.integer
|
65
|
-
t.text
|
58
|
+
t.integer "agent_import_file_id"
|
59
|
+
t.integer "agent_id"
|
60
|
+
t.integer "user_id"
|
61
|
+
t.text "body"
|
66
62
|
t.datetime "created_at"
|
67
63
|
t.datetime "updated_at"
|
68
64
|
end
|
69
65
|
|
70
66
|
create_table "agent_merge_lists", force: :cascade do |t|
|
71
|
-
t.string
|
67
|
+
t.string "title"
|
72
68
|
t.datetime "created_at"
|
73
69
|
t.datetime "updated_at"
|
74
70
|
end
|
75
71
|
|
76
72
|
create_table "agent_merges", force: :cascade do |t|
|
77
|
-
t.integer
|
78
|
-
t.integer
|
73
|
+
t.integer "agent_id", null: false
|
74
|
+
t.integer "agent_merge_list_id", null: false
|
79
75
|
t.datetime "created_at"
|
80
76
|
t.datetime "updated_at"
|
77
|
+
t.index ["agent_id"], name: "index_agent_merges_on_agent_id"
|
78
|
+
t.index ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
|
81
79
|
end
|
82
80
|
|
83
|
-
add_index "agent_merges", ["agent_id"], name: "index_agent_merges_on_agent_id"
|
84
|
-
add_index "agent_merges", ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
|
85
|
-
|
86
81
|
create_table "agent_relationship_types", force: :cascade do |t|
|
87
|
-
t.string
|
88
|
-
t.text
|
89
|
-
t.text
|
90
|
-
t.integer
|
82
|
+
t.string "name", null: false
|
83
|
+
t.text "display_name"
|
84
|
+
t.text "note"
|
85
|
+
t.integer "position"
|
91
86
|
t.datetime "created_at"
|
92
87
|
t.datetime "updated_at"
|
93
88
|
end
|
94
89
|
|
95
90
|
create_table "agent_relationships", force: :cascade do |t|
|
96
|
-
t.integer
|
97
|
-
t.integer
|
98
|
-
t.integer
|
91
|
+
t.integer "parent_id"
|
92
|
+
t.integer "child_id"
|
93
|
+
t.integer "agent_relationship_type_id"
|
99
94
|
t.datetime "created_at"
|
100
95
|
t.datetime "updated_at"
|
101
|
-
t.integer
|
96
|
+
t.integer "position"
|
97
|
+
t.index ["child_id"], name: "index_agent_relationships_on_child_id"
|
98
|
+
t.index ["parent_id"], name: "index_agent_relationships_on_parent_id"
|
102
99
|
end
|
103
100
|
|
104
|
-
add_index "agent_relationships", ["child_id"], name: "index_agent_relationships_on_child_id"
|
105
|
-
add_index "agent_relationships", ["parent_id"], name: "index_agent_relationships_on_parent_id"
|
106
|
-
|
107
101
|
create_table "agent_types", force: :cascade do |t|
|
108
|
-
t.string
|
109
|
-
t.text
|
110
|
-
t.text
|
111
|
-
t.integer
|
102
|
+
t.string "name", null: false
|
103
|
+
t.text "display_name"
|
104
|
+
t.text "note"
|
105
|
+
t.integer "position"
|
112
106
|
t.datetime "created_at"
|
113
107
|
t.datetime "updated_at"
|
114
108
|
end
|
115
109
|
|
116
110
|
create_table "agents", force: :cascade do |t|
|
117
|
-
t.integer
|
118
|
-
t.string
|
119
|
-
t.string
|
120
|
-
t.string
|
121
|
-
t.string
|
122
|
-
t.string
|
123
|
-
t.string
|
124
|
-
t.string
|
125
|
-
t.string
|
126
|
-
t.string
|
127
|
-
t.text
|
128
|
-
t.text
|
111
|
+
t.integer "user_id"
|
112
|
+
t.string "last_name"
|
113
|
+
t.string "middle_name"
|
114
|
+
t.string "first_name"
|
115
|
+
t.string "last_name_transcription"
|
116
|
+
t.string "middle_name_transcription"
|
117
|
+
t.string "first_name_transcription"
|
118
|
+
t.string "corporate_name"
|
119
|
+
t.string "corporate_name_transcription"
|
120
|
+
t.string "full_name"
|
121
|
+
t.text "full_name_transcription"
|
122
|
+
t.text "full_name_alternative"
|
129
123
|
t.datetime "created_at"
|
130
124
|
t.datetime "updated_at"
|
131
125
|
t.datetime "deleted_at"
|
132
|
-
t.string
|
133
|
-
t.string
|
134
|
-
t.text
|
135
|
-
t.text
|
136
|
-
t.text
|
137
|
-
t.text
|
138
|
-
t.string
|
139
|
-
t.string
|
140
|
-
t.string
|
141
|
-
t.string
|
142
|
-
t.text
|
143
|
-
t.text
|
144
|
-
t.string
|
145
|
-
t.text
|
146
|
-
t.text
|
147
|
-
t.text
|
126
|
+
t.string "zip_code_1"
|
127
|
+
t.string "zip_code_2"
|
128
|
+
t.text "address_1"
|
129
|
+
t.text "address_2"
|
130
|
+
t.text "address_1_note"
|
131
|
+
t.text "address_2_note"
|
132
|
+
t.string "telephone_number_1"
|
133
|
+
t.string "telephone_number_2"
|
134
|
+
t.string "fax_number_1"
|
135
|
+
t.string "fax_number_2"
|
136
|
+
t.text "other_designation"
|
137
|
+
t.text "place"
|
138
|
+
t.string "postal_code"
|
139
|
+
t.text "street"
|
140
|
+
t.text "locality"
|
141
|
+
t.text "region"
|
148
142
|
t.datetime "date_of_birth"
|
149
143
|
t.datetime "date_of_death"
|
150
|
-
t.integer
|
151
|
-
t.integer
|
152
|
-
t.integer
|
153
|
-
t.integer
|
154
|
-
t.text
|
155
|
-
t.integer
|
156
|
-
t.integer
|
157
|
-
t.text
|
158
|
-
t.text
|
159
|
-
t.text
|
160
|
-
t.string
|
161
|
-
t.string
|
162
|
-
t.string
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
add_index "agents", ["user_id"], name: "index_agents_on_user_id", unique: true
|
144
|
+
t.integer "language_id", default: 1, null: false
|
145
|
+
t.integer "country_id", default: 1, null: false
|
146
|
+
t.integer "agent_type_id", default: 1, null: false
|
147
|
+
t.integer "lock_version", default: 0, null: false
|
148
|
+
t.text "note"
|
149
|
+
t.integer "required_role_id", default: 1, null: false
|
150
|
+
t.integer "required_score", default: 0, null: false
|
151
|
+
t.text "email"
|
152
|
+
t.text "url"
|
153
|
+
t.text "full_name_alternative_transcription"
|
154
|
+
t.string "birth_date"
|
155
|
+
t.string "death_date"
|
156
|
+
t.string "agent_identifier"
|
157
|
+
t.index ["agent_identifier"], name: "index_agents_on_agent_identifier"
|
158
|
+
t.index ["country_id"], name: "index_agents_on_country_id"
|
159
|
+
t.index ["full_name"], name: "index_agents_on_full_name"
|
160
|
+
t.index ["language_id"], name: "index_agents_on_language_id"
|
161
|
+
t.index ["required_role_id"], name: "index_agents_on_required_role_id"
|
162
|
+
t.index ["user_id"], name: "index_agents_on_user_id", unique: true
|
163
|
+
end
|
171
164
|
|
172
165
|
create_table "answer_has_items", force: :cascade do |t|
|
173
|
-
t.integer
|
174
|
-
t.integer
|
175
|
-
t.integer
|
166
|
+
t.integer "answer_id"
|
167
|
+
t.integer "item_id"
|
168
|
+
t.integer "position"
|
176
169
|
t.datetime "created_at"
|
177
170
|
t.datetime "updated_at"
|
171
|
+
t.index ["answer_id"], name: "index_answer_has_items_on_answer_id"
|
172
|
+
t.index ["item_id"], name: "index_answer_has_items_on_item_id"
|
178
173
|
end
|
179
174
|
|
180
|
-
add_index "answer_has_items", ["answer_id"], name: "index_answer_has_items_on_answer_id"
|
181
|
-
add_index "answer_has_items", ["item_id"], name: "index_answer_has_items_on_item_id"
|
182
|
-
|
183
175
|
create_table "answers", force: :cascade do |t|
|
184
|
-
t.integer
|
185
|
-
t.integer
|
186
|
-
t.text
|
176
|
+
t.integer "user_id", null: false
|
177
|
+
t.integer "question_id", null: false
|
178
|
+
t.text "body"
|
187
179
|
t.datetime "created_at"
|
188
180
|
t.datetime "updated_at"
|
189
181
|
t.datetime "deleted_at"
|
190
|
-
t.boolean
|
191
|
-
t.string
|
192
|
-
t.text
|
193
|
-
t.text
|
182
|
+
t.boolean "shared", default: true, null: false
|
183
|
+
t.string "state"
|
184
|
+
t.text "item_identifier_list"
|
185
|
+
t.text "url_list"
|
186
|
+
t.index ["question_id"], name: "index_answers_on_question_id"
|
187
|
+
t.index ["user_id"], name: "index_answers_on_user_id"
|
194
188
|
end
|
195
189
|
|
196
|
-
add_index "answers", ["question_id"], name: "index_answers_on_question_id"
|
197
|
-
add_index "answers", ["user_id"], name: "index_answers_on_user_id"
|
198
|
-
|
199
190
|
create_table "baskets", force: :cascade do |t|
|
200
|
-
t.integer
|
201
|
-
t.text
|
202
|
-
t.integer
|
191
|
+
t.integer "user_id"
|
192
|
+
t.text "note"
|
193
|
+
t.integer "lock_version", default: 0, null: false
|
203
194
|
t.datetime "created_at"
|
204
195
|
t.datetime "updated_at"
|
196
|
+
t.index ["user_id"], name: "index_baskets_on_user_id"
|
205
197
|
end
|
206
198
|
|
207
|
-
add_index "baskets", ["user_id"], name: "index_baskets_on_user_id"
|
208
|
-
|
209
199
|
create_table "bookmark_stat_has_manifestations", force: :cascade do |t|
|
210
|
-
t.integer
|
211
|
-
t.integer
|
212
|
-
t.integer
|
200
|
+
t.integer "bookmark_stat_id", null: false
|
201
|
+
t.integer "manifestation_id", null: false
|
202
|
+
t.integer "bookmarks_count"
|
213
203
|
t.datetime "created_at"
|
214
204
|
t.datetime "updated_at"
|
205
|
+
t.index ["bookmark_stat_id"], name: "index_bookmark_stat_has_manifestations_on_bookmark_stat_id"
|
206
|
+
t.index ["manifestation_id"], name: "index_bookmark_stat_has_manifestations_on_manifestation_id"
|
215
207
|
end
|
216
208
|
|
217
|
-
add_index "bookmark_stat_has_manifestations", ["bookmark_stat_id"], name: "index_bookmark_stat_has_manifestations_on_bookmark_stat_id"
|
218
|
-
add_index "bookmark_stat_has_manifestations", ["manifestation_id"], name: "index_bookmark_stat_has_manifestations_on_manifestation_id"
|
219
|
-
|
220
209
|
create_table "bookmark_stat_transitions", force: :cascade do |t|
|
221
|
-
t.string
|
222
|
-
t.text
|
223
|
-
t.integer
|
224
|
-
t.integer
|
210
|
+
t.string "to_state"
|
211
|
+
t.text "metadata", default: "{}"
|
212
|
+
t.integer "sort_key"
|
213
|
+
t.integer "bookmark_stat_id"
|
225
214
|
t.datetime "created_at"
|
226
215
|
t.datetime "updated_at"
|
216
|
+
t.boolean "most_recent", null: false
|
217
|
+
t.index ["bookmark_stat_id", "most_recent"], name: "index_bookmark_stat_transitions_parent_most_recent", unique: true, where: "most_recent"
|
218
|
+
t.index ["bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_bookmark_stat_id"
|
219
|
+
t.index ["sort_key", "bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_sort_key_and_stat_id", unique: true
|
227
220
|
end
|
228
221
|
|
229
|
-
add_index "bookmark_stat_transitions", ["bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_bookmark_stat_id"
|
230
|
-
add_index "bookmark_stat_transitions", ["sort_key", "bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_sort_key_and_stat_id", unique: true
|
231
|
-
|
232
222
|
create_table "bookmark_stats", force: :cascade do |t|
|
233
223
|
t.datetime "start_date"
|
234
224
|
t.datetime "end_date"
|
235
225
|
t.datetime "started_at"
|
236
226
|
t.datetime "completed_at"
|
237
|
-
t.text
|
238
|
-
t.string "state"
|
227
|
+
t.text "note"
|
239
228
|
t.datetime "created_at"
|
240
229
|
t.datetime "updated_at"
|
241
230
|
end
|
242
231
|
|
243
|
-
add_index "bookmark_stats", ["state"], name: "index_bookmark_stats_on_state"
|
244
|
-
|
245
232
|
create_table "bookmarks", force: :cascade do |t|
|
246
|
-
t.integer
|
247
|
-
t.integer
|
248
|
-
t.text
|
249
|
-
t.string
|
250
|
-
t.text
|
251
|
-
t.boolean
|
233
|
+
t.integer "user_id", null: false
|
234
|
+
t.integer "manifestation_id"
|
235
|
+
t.text "title"
|
236
|
+
t.string "url"
|
237
|
+
t.text "note"
|
238
|
+
t.boolean "shared"
|
252
239
|
t.datetime "created_at"
|
253
240
|
t.datetime "updated_at"
|
241
|
+
t.index ["manifestation_id"], name: "index_bookmarks_on_manifestation_id"
|
242
|
+
t.index ["url"], name: "index_bookmarks_on_url"
|
243
|
+
t.index ["user_id"], name: "index_bookmarks_on_user_id"
|
254
244
|
end
|
255
245
|
|
256
|
-
add_index "bookmarks", ["manifestation_id"], name: "index_bookmarks_on_manifestation_id"
|
257
|
-
add_index "bookmarks", ["url"], name: "index_bookmarks_on_url"
|
258
|
-
add_index "bookmarks", ["user_id"], name: "index_bookmarks_on_user_id"
|
259
|
-
|
260
246
|
create_table "bookstores", force: :cascade do |t|
|
261
|
-
t.text
|
262
|
-
t.string
|
263
|
-
t.text
|
264
|
-
t.text
|
265
|
-
t.string
|
266
|
-
t.string
|
267
|
-
t.string
|
268
|
-
t.integer
|
247
|
+
t.text "name", null: false
|
248
|
+
t.string "zip_code"
|
249
|
+
t.text "address"
|
250
|
+
t.text "note"
|
251
|
+
t.string "telephone_number"
|
252
|
+
t.string "fax_number"
|
253
|
+
t.string "url"
|
254
|
+
t.integer "position"
|
269
255
|
t.datetime "deleted_at"
|
270
256
|
t.datetime "created_at"
|
271
257
|
t.datetime "updated_at"
|
272
258
|
end
|
273
259
|
|
274
260
|
create_table "budget_types", force: :cascade do |t|
|
275
|
-
t.string
|
276
|
-
t.text
|
277
|
-
t.text
|
278
|
-
t.integer
|
261
|
+
t.string "name"
|
262
|
+
t.text "display_name"
|
263
|
+
t.text "note"
|
264
|
+
t.integer "position"
|
279
265
|
t.datetime "created_at"
|
280
266
|
t.datetime "updated_at"
|
281
267
|
end
|
282
268
|
|
283
269
|
create_table "carrier_types", force: :cascade do |t|
|
284
|
-
t.string
|
285
|
-
t.text
|
286
|
-
t.text
|
287
|
-
t.integer
|
270
|
+
t.string "name", null: false
|
271
|
+
t.text "display_name"
|
272
|
+
t.text "note"
|
273
|
+
t.integer "position"
|
288
274
|
t.datetime "created_at"
|
289
275
|
t.datetime "updated_at"
|
290
276
|
end
|
291
277
|
|
292
278
|
create_table "colors", force: :cascade do |t|
|
293
|
-
t.integer
|
294
|
-
t.string
|
295
|
-
t.string
|
296
|
-
t.integer
|
279
|
+
t.integer "library_group_id"
|
280
|
+
t.string "property"
|
281
|
+
t.string "code"
|
282
|
+
t.integer "position"
|
297
283
|
t.datetime "created_at"
|
298
284
|
t.datetime "updated_at"
|
285
|
+
t.index ["library_group_id"], name: "index_colors_on_library_group_id"
|
299
286
|
end
|
300
287
|
|
301
|
-
add_index "colors", ["library_group_id"], name: "index_colors_on_library_group_id"
|
302
|
-
|
303
288
|
create_table "content_types", force: :cascade do |t|
|
304
|
-
t.string
|
305
|
-
t.text
|
306
|
-
t.text
|
307
|
-
t.integer
|
289
|
+
t.string "name", null: false
|
290
|
+
t.text "display_name"
|
291
|
+
t.text "note"
|
292
|
+
t.integer "position"
|
308
293
|
t.datetime "created_at"
|
309
294
|
t.datetime "updated_at"
|
310
295
|
end
|
311
296
|
|
312
297
|
create_table "countries", force: :cascade do |t|
|
313
|
-
t.string
|
314
|
-
t.text
|
315
|
-
t.string
|
316
|
-
t.string
|
317
|
-
t.string
|
318
|
-
t.text
|
298
|
+
t.string "name", null: false
|
299
|
+
t.text "display_name"
|
300
|
+
t.string "alpha_2"
|
301
|
+
t.string "alpha_3"
|
302
|
+
t.string "numeric_3"
|
303
|
+
t.text "note"
|
319
304
|
t.integer "position"
|
305
|
+
t.index ["alpha_2"], name: "index_countries_on_alpha_2"
|
306
|
+
t.index ["alpha_3"], name: "index_countries_on_alpha_3"
|
307
|
+
t.index ["name"], name: "index_countries_on_name"
|
308
|
+
t.index ["numeric_3"], name: "index_countries_on_numeric_3"
|
320
309
|
end
|
321
310
|
|
322
|
-
add_index "countries", ["alpha_2"], name: "index_countries_on_alpha_2"
|
323
|
-
add_index "countries", ["alpha_3"], name: "index_countries_on_alpha_3"
|
324
|
-
add_index "countries", ["name"], name: "index_countries_on_name"
|
325
|
-
add_index "countries", ["numeric_3"], name: "index_countries_on_numeric_3"
|
326
|
-
|
327
311
|
create_table "create_types", force: :cascade do |t|
|
328
|
-
t.string
|
329
|
-
t.text
|
330
|
-
t.text
|
331
|
-
t.integer
|
312
|
+
t.string "name"
|
313
|
+
t.text "display_name"
|
314
|
+
t.text "note"
|
315
|
+
t.integer "position"
|
332
316
|
t.datetime "created_at"
|
333
317
|
t.datetime "updated_at"
|
334
318
|
end
|
335
319
|
|
336
320
|
create_table "creates", force: :cascade do |t|
|
337
|
-
t.integer
|
338
|
-
t.integer
|
339
|
-
t.integer
|
321
|
+
t.integer "agent_id", null: false
|
322
|
+
t.integer "work_id", null: false
|
323
|
+
t.integer "position"
|
340
324
|
t.datetime "created_at"
|
341
325
|
t.datetime "updated_at"
|
342
|
-
t.integer
|
326
|
+
t.integer "create_type_id"
|
327
|
+
t.index ["agent_id"], name: "index_creates_on_agent_id"
|
328
|
+
t.index ["work_id"], name: "index_creates_on_work_id"
|
343
329
|
end
|
344
330
|
|
345
|
-
add_index "creates", ["agent_id"], name: "index_creates_on_agent_id"
|
346
|
-
add_index "creates", ["work_id"], name: "index_creates_on_work_id"
|
347
|
-
|
348
331
|
create_table "donates", force: :cascade do |t|
|
349
|
-
t.integer
|
350
|
-
t.integer
|
332
|
+
t.integer "agent_id", null: false
|
333
|
+
t.integer "item_id", null: false
|
351
334
|
t.datetime "created_at"
|
352
335
|
t.datetime "updated_at"
|
336
|
+
t.index ["agent_id"], name: "index_donates_on_agent_id"
|
337
|
+
t.index ["item_id"], name: "index_donates_on_item_id"
|
353
338
|
end
|
354
339
|
|
355
|
-
add_index "donates", ["agent_id"], name: "index_donates_on_agent_id"
|
356
|
-
add_index "donates", ["item_id"], name: "index_donates_on_item_id"
|
357
|
-
|
358
340
|
create_table "exemplifies", force: :cascade do |t|
|
359
|
-
t.integer
|
360
|
-
t.integer
|
361
|
-
t.integer
|
341
|
+
t.integer "manifestation_id", null: false
|
342
|
+
t.integer "item_id", null: false
|
343
|
+
t.integer "position"
|
362
344
|
t.datetime "created_at"
|
363
345
|
t.datetime "updated_at"
|
346
|
+
t.index ["item_id"], name: "index_exemplifies_on_item_id", unique: true
|
347
|
+
t.index ["manifestation_id"], name: "index_exemplifies_on_manifestation_id"
|
364
348
|
end
|
365
349
|
|
366
|
-
add_index "exemplifies", ["item_id"], name: "index_exemplifies_on_item_id", unique: true
|
367
|
-
add_index "exemplifies", ["manifestation_id"], name: "index_exemplifies_on_manifestation_id"
|
368
|
-
|
369
350
|
create_table "extents", force: :cascade do |t|
|
370
|
-
t.string
|
371
|
-
t.text
|
372
|
-
t.text
|
373
|
-
t.integer
|
351
|
+
t.string "name", null: false
|
352
|
+
t.text "display_name"
|
353
|
+
t.text "note"
|
354
|
+
t.integer "position"
|
374
355
|
t.datetime "created_at"
|
375
356
|
t.datetime "updated_at"
|
376
357
|
end
|
377
358
|
|
378
359
|
create_table "form_of_works", force: :cascade do |t|
|
379
|
-
t.string
|
380
|
-
t.text
|
381
|
-
t.text
|
382
|
-
t.integer
|
360
|
+
t.string "name", null: false
|
361
|
+
t.text "display_name"
|
362
|
+
t.text "note"
|
363
|
+
t.integer "position"
|
383
364
|
t.datetime "created_at"
|
384
365
|
t.datetime "updated_at"
|
385
366
|
end
|
386
367
|
|
387
368
|
create_table "frequencies", force: :cascade do |t|
|
388
|
-
t.string
|
389
|
-
t.text
|
390
|
-
t.text
|
391
|
-
t.integer
|
369
|
+
t.string "name", null: false
|
370
|
+
t.text "display_name"
|
371
|
+
t.text "note"
|
372
|
+
t.integer "position"
|
392
373
|
t.datetime "created_at"
|
393
374
|
t.datetime "updated_at"
|
394
375
|
end
|
395
376
|
|
396
377
|
create_table "identifier_types", force: :cascade do |t|
|
397
|
-
t.string
|
398
|
-
t.text
|
399
|
-
t.text
|
400
|
-
t.integer
|
378
|
+
t.string "name"
|
379
|
+
t.text "display_name"
|
380
|
+
t.text "note"
|
381
|
+
t.integer "position"
|
401
382
|
t.datetime "created_at"
|
402
383
|
t.datetime "updated_at"
|
403
384
|
end
|
404
385
|
|
405
386
|
create_table "identifiers", force: :cascade do |t|
|
406
|
-
t.string
|
407
|
-
t.integer
|
408
|
-
t.integer
|
409
|
-
t.boolean
|
410
|
-
t.integer
|
387
|
+
t.string "body", null: false
|
388
|
+
t.integer "identifier_type_id", null: false
|
389
|
+
t.integer "manifestation_id"
|
390
|
+
t.boolean "primary"
|
391
|
+
t.integer "position"
|
411
392
|
t.datetime "created_at"
|
412
393
|
t.datetime "updated_at"
|
394
|
+
t.index ["body", "identifier_type_id"], name: "index_identifiers_on_body_and_identifier_type_id"
|
395
|
+
t.index ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
|
413
396
|
end
|
414
397
|
|
415
|
-
add_index "identifiers", ["body", "identifier_type_id"], name: "index_identifiers_on_body_and_identifier_type_id"
|
416
|
-
add_index "identifiers", ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
|
417
|
-
|
418
398
|
create_table "import_request_transitions", force: :cascade do |t|
|
419
|
-
t.string
|
420
|
-
t.text
|
421
|
-
t.integer
|
422
|
-
t.integer
|
399
|
+
t.string "to_state"
|
400
|
+
t.text "metadata", default: "{}"
|
401
|
+
t.integer "sort_key"
|
402
|
+
t.integer "import_request_id"
|
423
403
|
t.datetime "created_at"
|
424
404
|
t.datetime "updated_at"
|
405
|
+
t.index ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
|
406
|
+
t.index ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
|
425
407
|
end
|
426
408
|
|
427
|
-
add_index "import_request_transitions", ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
|
428
|
-
add_index "import_request_transitions", ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
|
429
|
-
|
430
409
|
create_table "import_requests", force: :cascade do |t|
|
431
|
-
t.string
|
432
|
-
t.integer
|
433
|
-
t.integer
|
410
|
+
t.string "isbn"
|
411
|
+
t.integer "manifestation_id"
|
412
|
+
t.integer "user_id"
|
434
413
|
t.datetime "created_at"
|
435
414
|
t.datetime "updated_at"
|
415
|
+
t.index ["isbn"], name: "index_import_requests_on_isbn"
|
416
|
+
t.index ["manifestation_id"], name: "index_import_requests_on_manifestation_id"
|
417
|
+
t.index ["user_id"], name: "index_import_requests_on_user_id"
|
436
418
|
end
|
437
419
|
|
438
|
-
add_index "import_requests", ["isbn"], name: "index_import_requests_on_isbn"
|
439
|
-
add_index "import_requests", ["manifestation_id"], name: "index_import_requests_on_manifestation_id"
|
440
|
-
add_index "import_requests", ["user_id"], name: "index_import_requests_on_user_id"
|
441
|
-
|
442
420
|
create_table "items", force: :cascade do |t|
|
443
|
-
t.string
|
444
|
-
t.string
|
421
|
+
t.string "call_number"
|
422
|
+
t.string "item_identifier"
|
445
423
|
t.datetime "created_at"
|
446
424
|
t.datetime "updated_at"
|
447
425
|
t.datetime "deleted_at"
|
448
|
-
t.integer
|
449
|
-
t.boolean
|
450
|
-
t.text
|
451
|
-
t.string
|
452
|
-
t.integer
|
453
|
-
t.integer
|
454
|
-
t.integer
|
455
|
-
t.integer
|
426
|
+
t.integer "shelf_id", default: 1, null: false
|
427
|
+
t.boolean "include_supplements", default: false, null: false
|
428
|
+
t.text "note"
|
429
|
+
t.string "url"
|
430
|
+
t.integer "price"
|
431
|
+
t.integer "lock_version", default: 0, null: false
|
432
|
+
t.integer "required_role_id", default: 1, null: false
|
433
|
+
t.integer "required_score", default: 0, null: false
|
456
434
|
t.datetime "acquired_at"
|
457
|
-
t.integer
|
458
|
-
t.integer
|
459
|
-
t.string
|
460
|
-
t.string
|
435
|
+
t.integer "bookstore_id"
|
436
|
+
t.integer "budget_type_id"
|
437
|
+
t.string "binding_item_identifier"
|
438
|
+
t.string "binding_call_number"
|
461
439
|
t.datetime "binded_at"
|
462
|
-
t.integer
|
440
|
+
t.integer "manifestation_id"
|
441
|
+
t.index ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
|
442
|
+
t.index ["bookstore_id"], name: "index_items_on_bookstore_id"
|
443
|
+
t.index ["item_identifier"], name: "index_items_on_item_identifier"
|
444
|
+
t.index ["manifestation_id"], name: "index_items_on_manifestation_id"
|
445
|
+
t.index ["required_role_id"], name: "index_items_on_required_role_id"
|
446
|
+
t.index ["shelf_id"], name: "index_items_on_shelf_id"
|
463
447
|
end
|
464
448
|
|
465
|
-
add_index "items", ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
|
466
|
-
add_index "items", ["bookstore_id"], name: "index_items_on_bookstore_id"
|
467
|
-
add_index "items", ["item_identifier"], name: "index_items_on_item_identifier"
|
468
|
-
add_index "items", ["manifestation_id"], name: "index_items_on_manifestation_id"
|
469
|
-
add_index "items", ["required_role_id"], name: "index_items_on_required_role_id"
|
470
|
-
add_index "items", ["shelf_id"], name: "index_items_on_shelf_id"
|
471
|
-
|
472
449
|
create_table "languages", force: :cascade do |t|
|
473
|
-
t.string
|
474
|
-
t.string
|
475
|
-
t.text
|
476
|
-
t.string
|
477
|
-
t.string
|
478
|
-
t.string
|
479
|
-
t.text
|
450
|
+
t.string "name", null: false
|
451
|
+
t.string "native_name"
|
452
|
+
t.text "display_name"
|
453
|
+
t.string "iso_639_1"
|
454
|
+
t.string "iso_639_2"
|
455
|
+
t.string "iso_639_3"
|
456
|
+
t.text "note"
|
480
457
|
t.integer "position"
|
458
|
+
t.index ["iso_639_1"], name: "index_languages_on_iso_639_1"
|
459
|
+
t.index ["iso_639_2"], name: "index_languages_on_iso_639_2"
|
460
|
+
t.index ["iso_639_3"], name: "index_languages_on_iso_639_3"
|
461
|
+
t.index ["name"], name: "index_languages_on_name", unique: true
|
481
462
|
end
|
482
463
|
|
483
|
-
add_index "languages", ["iso_639_1"], name: "index_languages_on_iso_639_1"
|
484
|
-
add_index "languages", ["iso_639_2"], name: "index_languages_on_iso_639_2"
|
485
|
-
add_index "languages", ["iso_639_3"], name: "index_languages_on_iso_639_3"
|
486
|
-
add_index "languages", ["name"], name: "index_languages_on_name", unique: true
|
487
|
-
|
488
464
|
create_table "libraries", force: :cascade do |t|
|
489
|
-
t.string
|
490
|
-
t.text
|
491
|
-
t.string
|
492
|
-
t.string
|
493
|
-
t.text
|
494
|
-
t.text
|
495
|
-
t.text
|
496
|
-
t.string
|
497
|
-
t.string
|
498
|
-
t.string
|
499
|
-
t.text
|
500
|
-
t.integer
|
501
|
-
t.string
|
502
|
-
t.integer
|
503
|
-
t.integer
|
504
|
-
t.integer
|
505
|
-
t.integer
|
465
|
+
t.string "name", null: false
|
466
|
+
t.text "display_name"
|
467
|
+
t.string "short_display_name", null: false
|
468
|
+
t.string "zip_code"
|
469
|
+
t.text "street"
|
470
|
+
t.text "locality"
|
471
|
+
t.text "region"
|
472
|
+
t.string "telephone_number_1"
|
473
|
+
t.string "telephone_number_2"
|
474
|
+
t.string "fax_number"
|
475
|
+
t.text "note"
|
476
|
+
t.integer "call_number_rows", default: 1, null: false
|
477
|
+
t.string "call_number_delimiter", default: "|", null: false
|
478
|
+
t.integer "library_group_id", default: 1, null: false
|
479
|
+
t.integer "users_count", default: 0, null: false
|
480
|
+
t.integer "position"
|
481
|
+
t.integer "country_id"
|
506
482
|
t.datetime "created_at"
|
507
483
|
t.datetime "updated_at"
|
508
484
|
t.datetime "deleted_at"
|
509
|
-
t.text
|
510
|
-
t.string
|
511
|
-
t.float
|
512
|
-
t.float
|
485
|
+
t.text "opening_hour"
|
486
|
+
t.string "isil"
|
487
|
+
t.float "latitude"
|
488
|
+
t.float "longitude"
|
489
|
+
t.index ["library_group_id"], name: "index_libraries_on_library_group_id"
|
490
|
+
t.index ["name"], name: "index_libraries_on_name", unique: true
|
513
491
|
end
|
514
492
|
|
515
|
-
add_index "libraries", ["library_group_id"], name: "index_libraries_on_library_group_id"
|
516
|
-
add_index "libraries", ["name"], name: "index_libraries_on_name", unique: true
|
517
|
-
|
518
493
|
create_table "library_group_translations", force: :cascade do |t|
|
519
|
-
t.integer
|
520
|
-
t.string
|
521
|
-
t.datetime "created_at",
|
522
|
-
t.datetime "updated_at",
|
523
|
-
t.text
|
524
|
-
t.text
|
494
|
+
t.integer "library_group_id", null: false
|
495
|
+
t.string "locale", null: false
|
496
|
+
t.datetime "created_at", null: false
|
497
|
+
t.datetime "updated_at", null: false
|
498
|
+
t.text "login_banner"
|
499
|
+
t.text "footer_banner"
|
500
|
+
t.index ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
|
501
|
+
t.index ["locale"], name: "index_library_group_translations_on_locale"
|
525
502
|
end
|
526
503
|
|
527
|
-
add_index "library_group_translations", ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
|
528
|
-
add_index "library_group_translations", ["locale"], name: "index_library_group_translations_on_locale"
|
529
|
-
|
530
504
|
create_table "library_groups", force: :cascade do |t|
|
531
|
-
t.string
|
532
|
-
t.text
|
533
|
-
t.string
|
534
|
-
t.text
|
535
|
-
t.text
|
536
|
-
t.text
|
537
|
-
t.integer
|
538
|
-
t.integer
|
539
|
-
t.datetime "created_at"
|
540
|
-
t.datetime "updated_at"
|
541
|
-
t.text
|
542
|
-
t.boolean
|
543
|
-
t.string
|
544
|
-
t.text
|
545
|
-
t.text
|
546
|
-
t.integer
|
547
|
-
t.boolean
|
548
|
-
t.integer
|
549
|
-
t.integer
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
add_index "library_groups", ["user_id"], name: "index_library_groups_on_user_id"
|
505
|
+
t.string "name", null: false
|
506
|
+
t.text "display_name"
|
507
|
+
t.string "short_name", null: false
|
508
|
+
t.text "my_networks"
|
509
|
+
t.text "login_banner"
|
510
|
+
t.text "note"
|
511
|
+
t.integer "country_id"
|
512
|
+
t.integer "position"
|
513
|
+
t.datetime "created_at"
|
514
|
+
t.datetime "updated_at"
|
515
|
+
t.text "admin_networks"
|
516
|
+
t.boolean "allow_bookmark_external_url", default: false, null: false
|
517
|
+
t.string "url", default: "http://localhost:3000/"
|
518
|
+
t.text "settings"
|
519
|
+
t.text "html_snippet"
|
520
|
+
t.integer "max_number_of_results", default: 500
|
521
|
+
t.boolean "family_name_first", default: true
|
522
|
+
t.integer "pub_year_facet_range_interval", default: 10
|
523
|
+
t.integer "user_id"
|
524
|
+
t.index ["short_name"], name: "index_library_groups_on_short_name"
|
525
|
+
t.index ["user_id"], name: "index_library_groups_on_user_id"
|
526
|
+
end
|
554
527
|
|
555
528
|
create_table "licenses", force: :cascade do |t|
|
556
|
-
t.string
|
557
|
-
t.string
|
558
|
-
t.text
|
559
|
-
t.integer
|
529
|
+
t.string "name", null: false
|
530
|
+
t.string "display_name"
|
531
|
+
t.text "note"
|
532
|
+
t.integer "position"
|
560
533
|
t.datetime "created_at"
|
561
534
|
t.datetime "updated_at"
|
562
535
|
end
|
563
536
|
|
564
537
|
create_table "manifestation_relationship_types", force: :cascade do |t|
|
565
|
-
t.string
|
566
|
-
t.text
|
567
|
-
t.text
|
568
|
-
t.integer
|
538
|
+
t.string "name", null: false
|
539
|
+
t.text "display_name"
|
540
|
+
t.text "note"
|
541
|
+
t.integer "position"
|
569
542
|
t.datetime "created_at"
|
570
543
|
t.datetime "updated_at"
|
571
544
|
end
|
572
545
|
|
573
546
|
create_table "manifestation_relationships", force: :cascade do |t|
|
574
|
-
t.integer
|
575
|
-
t.integer
|
576
|
-
t.integer
|
547
|
+
t.integer "parent_id"
|
548
|
+
t.integer "child_id"
|
549
|
+
t.integer "manifestation_relationship_type_id"
|
577
550
|
t.datetime "created_at"
|
578
551
|
t.datetime "updated_at"
|
579
|
-
t.integer
|
552
|
+
t.integer "position"
|
553
|
+
t.index ["child_id"], name: "index_manifestation_relationships_on_child_id"
|
554
|
+
t.index ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
|
580
555
|
end
|
581
556
|
|
582
|
-
add_index "manifestation_relationships", ["child_id"], name: "index_manifestation_relationships_on_child_id"
|
583
|
-
add_index "manifestation_relationships", ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
|
584
|
-
|
585
557
|
create_table "manifestations", force: :cascade do |t|
|
586
|
-
t.text
|
587
|
-
t.text
|
588
|
-
t.text
|
589
|
-
t.string
|
590
|
-
t.string
|
558
|
+
t.text "original_title", null: false
|
559
|
+
t.text "title_alternative"
|
560
|
+
t.text "title_transcription"
|
561
|
+
t.string "classification_number"
|
562
|
+
t.string "manifestation_identifier"
|
591
563
|
t.datetime "date_of_publication"
|
592
564
|
t.datetime "date_copyrighted"
|
593
565
|
t.datetime "created_at"
|
594
566
|
t.datetime "updated_at"
|
595
567
|
t.datetime "deleted_at"
|
596
|
-
t.string
|
597
|
-
t.integer
|
598
|
-
t.integer
|
599
|
-
t.integer
|
600
|
-
t.integer
|
601
|
-
t.integer
|
602
|
-
t.integer
|
603
|
-
t.integer
|
604
|
-
t.integer
|
605
|
-
t.integer
|
606
|
-
t.text
|
607
|
-
t.string
|
608
|
-
t.string
|
609
|
-
t.string
|
610
|
-
t.integer
|
611
|
-
t.text
|
612
|
-
t.boolean
|
613
|
-
t.integer
|
614
|
-
t.integer
|
615
|
-
t.integer
|
616
|
-
t.integer
|
617
|
-
t.boolean
|
618
|
-
t.string
|
619
|
-
t.string
|
620
|
-
t.integer
|
568
|
+
t.string "access_address"
|
569
|
+
t.integer "language_id", default: 1, null: false
|
570
|
+
t.integer "carrier_type_id", default: 1, null: false
|
571
|
+
t.integer "extent_id", default: 1, null: false
|
572
|
+
t.integer "start_page"
|
573
|
+
t.integer "end_page"
|
574
|
+
t.integer "height"
|
575
|
+
t.integer "width"
|
576
|
+
t.integer "depth"
|
577
|
+
t.integer "price"
|
578
|
+
t.text "fulltext"
|
579
|
+
t.string "volume_number_string"
|
580
|
+
t.string "issue_number_string"
|
581
|
+
t.string "serial_number_string"
|
582
|
+
t.integer "edition"
|
583
|
+
t.text "note"
|
584
|
+
t.boolean "repository_content", default: false, null: false
|
585
|
+
t.integer "lock_version", default: 0, null: false
|
586
|
+
t.integer "required_role_id", default: 1, null: false
|
587
|
+
t.integer "required_score", default: 0, null: false
|
588
|
+
t.integer "frequency_id", default: 1, null: false
|
589
|
+
t.boolean "subscription_master", default: false, null: false
|
590
|
+
t.string "attachment_file_name"
|
591
|
+
t.string "attachment_content_type"
|
592
|
+
t.integer "attachment_file_size"
|
621
593
|
t.datetime "attachment_updated_at"
|
622
|
-
t.text
|
623
|
-
t.text
|
624
|
-
t.text
|
594
|
+
t.text "title_alternative_transcription"
|
595
|
+
t.text "description"
|
596
|
+
t.text "abstract"
|
625
597
|
t.datetime "available_at"
|
626
598
|
t.datetime "valid_until"
|
627
599
|
t.datetime "date_submitted"
|
628
600
|
t.datetime "date_accepted"
|
629
601
|
t.datetime "date_caputured"
|
630
|
-
t.string
|
631
|
-
t.string
|
632
|
-
t.integer
|
633
|
-
t.integer
|
634
|
-
t.integer
|
635
|
-
t.integer
|
636
|
-
t.integer
|
637
|
-
t.text
|
638
|
-
t.integer
|
639
|
-
t.boolean
|
640
|
-
t.string
|
641
|
-
t.boolean
|
642
|
-
t.text
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
add_index "manifestations", ["updated_at"], name: "index_manifestations_on_updated_at"
|
602
|
+
t.string "pub_date"
|
603
|
+
t.string "edition_string"
|
604
|
+
t.integer "volume_number"
|
605
|
+
t.integer "issue_number"
|
606
|
+
t.integer "serial_number"
|
607
|
+
t.integer "content_type_id", default: 1
|
608
|
+
t.integer "year_of_publication"
|
609
|
+
t.text "attachment_meta"
|
610
|
+
t.integer "month_of_publication"
|
611
|
+
t.boolean "fulltext_content"
|
612
|
+
t.string "doi"
|
613
|
+
t.boolean "periodical"
|
614
|
+
t.text "statement_of_responsibility"
|
615
|
+
t.index ["access_address"], name: "index_manifestations_on_access_address"
|
616
|
+
t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
|
617
|
+
t.index ["doi"], name: "index_manifestations_on_doi"
|
618
|
+
t.index ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier"
|
619
|
+
t.index ["updated_at"], name: "index_manifestations_on_updated_at"
|
620
|
+
end
|
650
621
|
|
651
622
|
create_table "medium_of_performances", force: :cascade do |t|
|
652
|
-
t.string
|
653
|
-
t.text
|
654
|
-
t.text
|
655
|
-
t.integer
|
623
|
+
t.string "name", null: false
|
624
|
+
t.text "display_name"
|
625
|
+
t.text "note"
|
626
|
+
t.integer "position"
|
656
627
|
t.datetime "created_at"
|
657
628
|
t.datetime "updated_at"
|
658
629
|
end
|
659
630
|
|
660
631
|
create_table "message_request_transitions", force: :cascade do |t|
|
661
|
-
t.string
|
662
|
-
t.text
|
663
|
-
t.integer
|
664
|
-
t.integer
|
632
|
+
t.string "to_state"
|
633
|
+
t.text "metadata", default: "{}"
|
634
|
+
t.integer "sort_key"
|
635
|
+
t.integer "message_request_id"
|
665
636
|
t.datetime "created_at"
|
666
637
|
t.datetime "updated_at"
|
667
|
-
t.boolean
|
638
|
+
t.boolean "most_recent"
|
639
|
+
t.index ["message_request_id"], name: "index_message_request_transitions_on_message_request_id"
|
640
|
+
t.index ["sort_key", "message_request_id"], name: "index_message_request_transitions_on_sort_key_and_request_id", unique: true
|
668
641
|
end
|
669
642
|
|
670
|
-
add_index "message_request_transitions", ["message_request_id"], name: "index_message_request_transitions_on_message_request_id"
|
671
|
-
add_index "message_request_transitions", ["sort_key", "message_request_id"], name: "index_message_request_transitions_on_sort_key_and_request_id", unique: true
|
672
|
-
|
673
643
|
create_table "message_requests", force: :cascade do |t|
|
674
|
-
t.integer
|
675
|
-
t.integer
|
676
|
-
t.integer
|
644
|
+
t.integer "sender_id"
|
645
|
+
t.integer "receiver_id"
|
646
|
+
t.integer "message_template_id"
|
677
647
|
t.datetime "sent_at"
|
678
648
|
t.datetime "deleted_at"
|
679
|
-
t.text
|
649
|
+
t.text "body"
|
680
650
|
t.datetime "created_at"
|
681
651
|
t.datetime "updated_at"
|
682
652
|
end
|
683
653
|
|
684
654
|
create_table "message_templates", force: :cascade do |t|
|
685
|
-
t.string
|
686
|
-
t.text
|
687
|
-
t.text
|
688
|
-
t.integer
|
689
|
-
t.string
|
655
|
+
t.string "status", null: false
|
656
|
+
t.text "title", null: false
|
657
|
+
t.text "body", null: false
|
658
|
+
t.integer "position"
|
659
|
+
t.string "locale", default: "en"
|
690
660
|
t.datetime "created_at"
|
691
661
|
t.datetime "updated_at"
|
662
|
+
t.index ["status"], name: "index_message_templates_on_status", unique: true
|
692
663
|
end
|
693
664
|
|
694
|
-
add_index "message_templates", ["status"], name: "index_message_templates_on_status", unique: true
|
695
|
-
|
696
665
|
create_table "message_transitions", force: :cascade do |t|
|
697
|
-
t.string
|
698
|
-
t.text
|
699
|
-
t.integer
|
700
|
-
t.integer
|
666
|
+
t.string "to_state"
|
667
|
+
t.text "metadata", default: "{}"
|
668
|
+
t.integer "sort_key"
|
669
|
+
t.integer "message_id"
|
701
670
|
t.datetime "created_at"
|
702
671
|
t.datetime "updated_at"
|
703
|
-
t.boolean
|
672
|
+
t.boolean "most_recent"
|
673
|
+
t.index ["message_id"], name: "index_message_transitions_on_message_id"
|
674
|
+
t.index ["sort_key", "message_id"], name: "index_message_transitions_on_sort_key_and_message_id", unique: true
|
704
675
|
end
|
705
676
|
|
706
|
-
add_index "message_transitions", ["message_id"], name: "index_message_transitions_on_message_id"
|
707
|
-
add_index "message_transitions", ["sort_key", "message_id"], name: "index_message_transitions_on_sort_key_and_message_id", unique: true
|
708
|
-
|
709
677
|
create_table "messages", force: :cascade do |t|
|
710
678
|
t.datetime "read_at"
|
711
|
-
t.integer
|
712
|
-
t.integer
|
713
|
-
t.string
|
714
|
-
t.text
|
715
|
-
t.integer
|
716
|
-
t.integer
|
679
|
+
t.integer "receiver_id"
|
680
|
+
t.integer "sender_id"
|
681
|
+
t.string "subject", null: false
|
682
|
+
t.text "body"
|
683
|
+
t.integer "message_request_id"
|
684
|
+
t.integer "parent_id"
|
717
685
|
t.datetime "created_at"
|
718
686
|
t.datetime "updated_at"
|
719
|
-
t.integer
|
720
|
-
t.integer
|
721
|
-
t.integer
|
687
|
+
t.integer "lft"
|
688
|
+
t.integer "rgt"
|
689
|
+
t.integer "depth"
|
690
|
+
t.index ["message_request_id"], name: "index_messages_on_message_request_id"
|
691
|
+
t.index ["parent_id"], name: "index_messages_on_parent_id"
|
692
|
+
t.index ["receiver_id"], name: "index_messages_on_receiver_id"
|
693
|
+
t.index ["sender_id"], name: "index_messages_on_sender_id"
|
722
694
|
end
|
723
695
|
|
724
|
-
add_index "messages", ["message_request_id"], name: "index_messages_on_message_request_id"
|
725
|
-
add_index "messages", ["parent_id"], name: "index_messages_on_parent_id"
|
726
|
-
add_index "messages", ["receiver_id"], name: "index_messages_on_receiver_id"
|
727
|
-
add_index "messages", ["sender_id"], name: "index_messages_on_sender_id"
|
728
|
-
|
729
696
|
create_table "owns", force: :cascade do |t|
|
730
|
-
t.integer
|
731
|
-
t.integer
|
732
|
-
t.integer
|
697
|
+
t.integer "agent_id", null: false
|
698
|
+
t.integer "item_id", null: false
|
699
|
+
t.integer "position"
|
733
700
|
t.datetime "created_at"
|
734
701
|
t.datetime "updated_at"
|
702
|
+
t.index ["agent_id"], name: "index_owns_on_agent_id"
|
703
|
+
t.index ["item_id"], name: "index_owns_on_item_id"
|
735
704
|
end
|
736
705
|
|
737
|
-
add_index "owns", ["agent_id"], name: "index_owns_on_agent_id"
|
738
|
-
add_index "owns", ["item_id"], name: "index_owns_on_item_id"
|
739
|
-
|
740
706
|
create_table "picture_files", force: :cascade do |t|
|
741
|
-
t.integer
|
742
|
-
t.string
|
743
|
-
t.string
|
744
|
-
t.text
|
745
|
-
t.string
|
746
|
-
t.integer
|
707
|
+
t.integer "picture_attachable_id"
|
708
|
+
t.string "picture_attachable_type"
|
709
|
+
t.string "content_type"
|
710
|
+
t.text "title"
|
711
|
+
t.string "thumbnail"
|
712
|
+
t.integer "position"
|
747
713
|
t.datetime "created_at"
|
748
714
|
t.datetime "updated_at"
|
749
|
-
t.string
|
750
|
-
t.string
|
751
|
-
t.integer
|
715
|
+
t.string "picture_file_name"
|
716
|
+
t.string "picture_content_type"
|
717
|
+
t.integer "picture_file_size"
|
752
718
|
t.datetime "picture_updated_at"
|
753
|
-
t.text
|
754
|
-
t.string
|
719
|
+
t.text "picture_meta"
|
720
|
+
t.string "picture_fingerprint"
|
721
|
+
t.index ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
|
755
722
|
end
|
756
723
|
|
757
|
-
add_index "picture_files", ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
|
758
|
-
|
759
724
|
create_table "produce_types", force: :cascade do |t|
|
760
|
-
t.string
|
761
|
-
t.text
|
762
|
-
t.text
|
763
|
-
t.integer
|
725
|
+
t.string "name"
|
726
|
+
t.text "display_name"
|
727
|
+
t.text "note"
|
728
|
+
t.integer "position"
|
764
729
|
t.datetime "created_at"
|
765
730
|
t.datetime "updated_at"
|
766
731
|
end
|
767
732
|
|
768
733
|
create_table "produces", force: :cascade do |t|
|
769
|
-
t.integer
|
770
|
-
t.integer
|
771
|
-
t.integer
|
734
|
+
t.integer "agent_id", null: false
|
735
|
+
t.integer "manifestation_id", null: false
|
736
|
+
t.integer "position"
|
772
737
|
t.datetime "created_at"
|
773
738
|
t.datetime "updated_at"
|
774
|
-
t.integer
|
739
|
+
t.integer "produce_type_id"
|
740
|
+
t.index ["agent_id"], name: "index_produces_on_agent_id"
|
741
|
+
t.index ["manifestation_id"], name: "index_produces_on_manifestation_id"
|
775
742
|
end
|
776
743
|
|
777
|
-
add_index "produces", ["agent_id"], name: "index_produces_on_agent_id"
|
778
|
-
add_index "produces", ["manifestation_id"], name: "index_produces_on_manifestation_id"
|
779
|
-
|
780
744
|
create_table "profiles", force: :cascade do |t|
|
781
|
-
t.integer
|
782
|
-
t.integer
|
783
|
-
t.integer
|
784
|
-
t.string
|
785
|
-
t.string
|
786
|
-
t.text
|
787
|
-
t.text
|
788
|
-
t.text
|
789
|
-
t.integer
|
745
|
+
t.integer "user_id"
|
746
|
+
t.integer "user_group_id"
|
747
|
+
t.integer "library_id"
|
748
|
+
t.string "locale"
|
749
|
+
t.string "user_number"
|
750
|
+
t.text "full_name"
|
751
|
+
t.text "note"
|
752
|
+
t.text "keyword_list"
|
753
|
+
t.integer "required_role_id"
|
790
754
|
t.datetime "created_at"
|
791
755
|
t.datetime "updated_at"
|
792
756
|
t.datetime "expired_at"
|
793
|
-
t.boolean
|
757
|
+
t.boolean "share_bookmarks"
|
758
|
+
t.index ["user_id"], name: "index_profiles_on_user_id"
|
759
|
+
t.index ["user_number"], name: "index_profiles_on_user_number", unique: true
|
794
760
|
end
|
795
761
|
|
796
|
-
add_index "profiles", ["user_id"], name: "index_profiles_on_user_id"
|
797
|
-
add_index "profiles", ["user_number"], name: "index_profiles_on_user_number", unique: true
|
798
|
-
|
799
762
|
create_table "questions", force: :cascade do |t|
|
800
|
-
t.integer
|
801
|
-
t.text
|
802
|
-
t.boolean
|
803
|
-
t.integer
|
763
|
+
t.integer "user_id", null: false
|
764
|
+
t.text "body"
|
765
|
+
t.boolean "shared", default: true, null: false
|
766
|
+
t.integer "answers_count", default: 0, null: false
|
804
767
|
t.datetime "deleted_at"
|
805
|
-
t.string
|
806
|
-
t.boolean
|
807
|
-
t.text
|
768
|
+
t.string "state"
|
769
|
+
t.boolean "solved", default: false, null: false
|
770
|
+
t.text "note"
|
808
771
|
t.datetime "created_at"
|
809
772
|
t.datetime "updated_at"
|
773
|
+
t.index ["user_id"], name: "index_questions_on_user_id"
|
810
774
|
end
|
811
775
|
|
812
|
-
add_index "questions", ["user_id"], name: "index_questions_on_user_id"
|
813
|
-
|
814
776
|
create_table "realize_types", force: :cascade do |t|
|
815
|
-
t.string
|
816
|
-
t.text
|
817
|
-
t.text
|
818
|
-
t.integer
|
777
|
+
t.string "name"
|
778
|
+
t.text "display_name"
|
779
|
+
t.text "note"
|
780
|
+
t.integer "position"
|
819
781
|
t.datetime "created_at"
|
820
782
|
t.datetime "updated_at"
|
821
783
|
end
|
822
784
|
|
823
785
|
create_table "realizes", force: :cascade do |t|
|
824
|
-
t.integer
|
825
|
-
t.integer
|
826
|
-
t.integer
|
786
|
+
t.integer "agent_id", null: false
|
787
|
+
t.integer "expression_id", null: false
|
788
|
+
t.integer "position"
|
827
789
|
t.datetime "created_at"
|
828
790
|
t.datetime "updated_at"
|
829
|
-
t.integer
|
791
|
+
t.integer "realize_type_id"
|
792
|
+
t.index ["agent_id"], name: "index_realizes_on_agent_id"
|
793
|
+
t.index ["expression_id"], name: "index_realizes_on_expression_id"
|
830
794
|
end
|
831
795
|
|
832
|
-
add_index "realizes", ["agent_id"], name: "index_realizes_on_agent_id"
|
833
|
-
add_index "realizes", ["expression_id"], name: "index_realizes_on_expression_id"
|
834
|
-
|
835
796
|
create_table "request_status_types", force: :cascade do |t|
|
836
|
-
t.string
|
837
|
-
t.text
|
838
|
-
t.text
|
839
|
-
t.integer
|
797
|
+
t.string "name", null: false
|
798
|
+
t.text "display_name"
|
799
|
+
t.text "note"
|
800
|
+
t.integer "position"
|
840
801
|
t.datetime "created_at"
|
841
802
|
t.datetime "updated_at"
|
842
803
|
end
|
843
804
|
|
844
805
|
create_table "request_types", force: :cascade do |t|
|
845
|
-
t.string
|
846
|
-
t.text
|
847
|
-
t.text
|
848
|
-
t.integer
|
806
|
+
t.string "name", null: false
|
807
|
+
t.text "display_name"
|
808
|
+
t.text "note"
|
809
|
+
t.integer "position"
|
849
810
|
t.datetime "created_at"
|
850
811
|
t.datetime "updated_at"
|
851
812
|
end
|
852
813
|
|
853
814
|
create_table "resource_export_file_transitions", force: :cascade do |t|
|
854
|
-
t.string
|
855
|
-
t.text
|
856
|
-
t.integer
|
857
|
-
t.integer
|
815
|
+
t.string "to_state"
|
816
|
+
t.text "metadata", default: "{}"
|
817
|
+
t.integer "sort_key"
|
818
|
+
t.integer "resource_export_file_id"
|
858
819
|
t.datetime "created_at"
|
859
820
|
t.datetime "updated_at"
|
821
|
+
t.index ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
|
822
|
+
t.index ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
|
860
823
|
end
|
861
824
|
|
862
|
-
add_index "resource_export_file_transitions", ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
|
863
|
-
add_index "resource_export_file_transitions", ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
|
864
|
-
|
865
825
|
create_table "resource_export_files", force: :cascade do |t|
|
866
|
-
t.integer
|
867
|
-
t.string
|
868
|
-
t.string
|
869
|
-
t.integer
|
826
|
+
t.integer "user_id"
|
827
|
+
t.string "resource_export_file_name"
|
828
|
+
t.string "resource_export_content_type"
|
829
|
+
t.integer "resource_export_file_size"
|
870
830
|
t.datetime "resource_export_updated_at"
|
871
831
|
t.datetime "executed_at"
|
872
832
|
t.datetime "created_at"
|
@@ -874,198 +834,193 @@ ActiveRecord::Schema.define(version: 20160814165332) do
|
|
874
834
|
end
|
875
835
|
|
876
836
|
create_table "resource_import_file_transitions", force: :cascade do |t|
|
877
|
-
t.string
|
878
|
-
t.text
|
879
|
-
t.integer
|
880
|
-
t.integer
|
837
|
+
t.string "to_state"
|
838
|
+
t.text "metadata", default: "{}"
|
839
|
+
t.integer "sort_key"
|
840
|
+
t.integer "resource_import_file_id"
|
881
841
|
t.datetime "created_at"
|
882
842
|
t.datetime "updated_at"
|
843
|
+
t.index ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
|
844
|
+
t.index ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
|
883
845
|
end
|
884
846
|
|
885
|
-
add_index "resource_import_file_transitions", ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
|
886
|
-
add_index "resource_import_file_transitions", ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
|
887
|
-
|
888
847
|
create_table "resource_import_files", force: :cascade do |t|
|
889
|
-
t.integer
|
890
|
-
t.string
|
891
|
-
t.integer
|
892
|
-
t.integer
|
893
|
-
t.text
|
848
|
+
t.integer "parent_id"
|
849
|
+
t.string "content_type"
|
850
|
+
t.integer "size"
|
851
|
+
t.integer "user_id"
|
852
|
+
t.text "note"
|
894
853
|
t.datetime "executed_at"
|
895
|
-
t.string
|
896
|
-
t.string
|
897
|
-
t.integer
|
854
|
+
t.string "resource_import_file_name"
|
855
|
+
t.string "resource_import_content_type"
|
856
|
+
t.integer "resource_import_file_size"
|
898
857
|
t.datetime "resource_import_updated_at"
|
899
858
|
t.datetime "created_at"
|
900
859
|
t.datetime "updated_at"
|
901
|
-
t.string
|
902
|
-
t.string
|
903
|
-
t.text
|
904
|
-
t.string
|
905
|
-
t.integer
|
860
|
+
t.string "edit_mode"
|
861
|
+
t.string "resource_import_fingerprint"
|
862
|
+
t.text "error_message"
|
863
|
+
t.string "user_encoding"
|
864
|
+
t.integer "default_shelf_id"
|
865
|
+
t.index ["parent_id"], name: "index_resource_import_files_on_parent_id"
|
866
|
+
t.index ["user_id"], name: "index_resource_import_files_on_user_id"
|
906
867
|
end
|
907
868
|
|
908
|
-
add_index "resource_import_files", ["parent_id"], name: "index_resource_import_files_on_parent_id"
|
909
|
-
add_index "resource_import_files", ["user_id"], name: "index_resource_import_files_on_user_id"
|
910
|
-
|
911
869
|
create_table "resource_import_results", force: :cascade do |t|
|
912
|
-
t.integer
|
913
|
-
t.integer
|
914
|
-
t.integer
|
915
|
-
t.text
|
870
|
+
t.integer "resource_import_file_id"
|
871
|
+
t.integer "manifestation_id"
|
872
|
+
t.integer "item_id"
|
873
|
+
t.text "body"
|
916
874
|
t.datetime "created_at"
|
917
875
|
t.datetime "updated_at"
|
876
|
+
t.index ["item_id"], name: "index_resource_import_results_on_item_id"
|
877
|
+
t.index ["manifestation_id"], name: "index_resource_import_results_on_manifestation_id"
|
878
|
+
t.index ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
|
918
879
|
end
|
919
880
|
|
920
|
-
add_index "resource_import_results", ["item_id"], name: "index_resource_import_results_on_item_id"
|
921
|
-
add_index "resource_import_results", ["manifestation_id"], name: "index_resource_import_results_on_manifestation_id"
|
922
|
-
add_index "resource_import_results", ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
|
923
|
-
|
924
881
|
create_table "roles", force: :cascade do |t|
|
925
|
-
t.string
|
926
|
-
t.string
|
927
|
-
t.text
|
882
|
+
t.string "name", null: false
|
883
|
+
t.string "display_name"
|
884
|
+
t.text "note"
|
928
885
|
t.datetime "created_at"
|
929
886
|
t.datetime "updated_at"
|
930
|
-
t.integer
|
931
|
-
t.integer
|
887
|
+
t.integer "score", default: 0, null: false
|
888
|
+
t.integer "position"
|
932
889
|
end
|
933
890
|
|
934
891
|
create_table "search_engines", force: :cascade do |t|
|
935
|
-
t.string
|
936
|
-
t.text
|
937
|
-
t.string
|
938
|
-
t.text
|
939
|
-
t.text
|
940
|
-
t.text
|
941
|
-
t.text
|
942
|
-
t.text
|
943
|
-
t.integer
|
892
|
+
t.string "name", null: false
|
893
|
+
t.text "display_name"
|
894
|
+
t.string "url", null: false
|
895
|
+
t.text "base_url", null: false
|
896
|
+
t.text "http_method", null: false
|
897
|
+
t.text "query_param", null: false
|
898
|
+
t.text "additional_param"
|
899
|
+
t.text "note"
|
900
|
+
t.integer "position"
|
944
901
|
t.datetime "created_at"
|
945
902
|
t.datetime "updated_at"
|
946
903
|
end
|
947
904
|
|
948
905
|
create_table "series_statement_merge_lists", force: :cascade do |t|
|
949
|
-
t.string
|
906
|
+
t.string "title"
|
950
907
|
t.datetime "created_at"
|
951
908
|
t.datetime "updated_at"
|
952
909
|
end
|
953
910
|
|
954
911
|
create_table "series_statement_merges", force: :cascade do |t|
|
955
|
-
t.integer
|
956
|
-
t.integer
|
912
|
+
t.integer "series_statement_id", null: false
|
913
|
+
t.integer "series_statement_merge_list_id", null: false
|
957
914
|
t.datetime "created_at"
|
958
915
|
t.datetime "updated_at"
|
916
|
+
t.index ["series_statement_id"], name: "index_series_statement_merges_on_series_statement_id"
|
917
|
+
t.index ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
|
959
918
|
end
|
960
919
|
|
961
|
-
add_index "series_statement_merges", ["series_statement_id"], name: "index_series_statement_merges_on_series_statement_id"
|
962
|
-
add_index "series_statement_merges", ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
|
963
|
-
|
964
920
|
create_table "series_statements", force: :cascade do |t|
|
965
|
-
t.text
|
966
|
-
t.text
|
967
|
-
t.text
|
968
|
-
t.text
|
969
|
-
t.integer
|
970
|
-
t.datetime "created_at"
|
971
|
-
t.datetime "updated_at"
|
972
|
-
t.text
|
973
|
-
t.text
|
974
|
-
t.string
|
975
|
-
t.integer
|
976
|
-
t.text
|
977
|
-
t.text
|
978
|
-
t.text
|
979
|
-
t.text
|
980
|
-
t.text
|
981
|
-
t.boolean
|
982
|
-
t.integer
|
983
|
-
|
984
|
-
|
985
|
-
|
986
|
-
|
987
|
-
add_index "series_statements", ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
|
921
|
+
t.text "original_title"
|
922
|
+
t.text "numbering"
|
923
|
+
t.text "title_subseries"
|
924
|
+
t.text "numbering_subseries"
|
925
|
+
t.integer "position"
|
926
|
+
t.datetime "created_at"
|
927
|
+
t.datetime "updated_at"
|
928
|
+
t.text "title_transcription"
|
929
|
+
t.text "title_alternative"
|
930
|
+
t.string "series_statement_identifier"
|
931
|
+
t.integer "manifestation_id"
|
932
|
+
t.text "note"
|
933
|
+
t.text "title_subseries_transcription"
|
934
|
+
t.text "creator_string"
|
935
|
+
t.text "volume_number_string"
|
936
|
+
t.text "volume_number_transcription_string"
|
937
|
+
t.boolean "series_master"
|
938
|
+
t.integer "root_manifestation_id"
|
939
|
+
t.index ["manifestation_id"], name: "index_series_statements_on_manifestation_id"
|
940
|
+
t.index ["root_manifestation_id"], name: "index_series_statements_on_root_manifestation_id"
|
941
|
+
t.index ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
|
942
|
+
end
|
988
943
|
|
989
944
|
create_table "shelves", force: :cascade do |t|
|
990
|
-
t.string
|
991
|
-
t.text
|
992
|
-
t.text
|
993
|
-
t.integer
|
994
|
-
t.integer
|
995
|
-
t.integer
|
945
|
+
t.string "name", null: false
|
946
|
+
t.text "display_name"
|
947
|
+
t.text "note"
|
948
|
+
t.integer "library_id", default: 1, null: false
|
949
|
+
t.integer "items_count", default: 0, null: false
|
950
|
+
t.integer "position"
|
996
951
|
t.datetime "created_at"
|
997
952
|
t.datetime "updated_at"
|
998
953
|
t.datetime "deleted_at"
|
999
|
-
t.boolean
|
954
|
+
t.boolean "closed", default: false, null: false
|
955
|
+
t.index ["library_id"], name: "index_shelves_on_library_id"
|
1000
956
|
end
|
1001
957
|
|
1002
|
-
add_index "shelves", ["library_id"], name: "index_shelves_on_library_id"
|
1003
|
-
|
1004
958
|
create_table "subscribes", force: :cascade do |t|
|
1005
|
-
t.integer
|
1006
|
-
t.integer
|
1007
|
-
t.datetime "start_at",
|
1008
|
-
t.datetime "end_at",
|
959
|
+
t.integer "subscription_id", null: false
|
960
|
+
t.integer "work_id", null: false
|
961
|
+
t.datetime "start_at", null: false
|
962
|
+
t.datetime "end_at", null: false
|
1009
963
|
t.datetime "created_at"
|
1010
964
|
t.datetime "updated_at"
|
965
|
+
t.index ["subscription_id"], name: "index_subscribes_on_subscription_id"
|
966
|
+
t.index ["work_id"], name: "index_subscribes_on_work_id"
|
1011
967
|
end
|
1012
968
|
|
1013
|
-
add_index "subscribes", ["subscription_id"], name: "index_subscribes_on_subscription_id"
|
1014
|
-
add_index "subscribes", ["work_id"], name: "index_subscribes_on_work_id"
|
1015
|
-
|
1016
969
|
create_table "subscriptions", force: :cascade do |t|
|
1017
|
-
t.text
|
1018
|
-
t.text
|
1019
|
-
t.integer
|
1020
|
-
t.integer
|
970
|
+
t.text "title", null: false
|
971
|
+
t.text "note"
|
972
|
+
t.integer "user_id"
|
973
|
+
t.integer "order_list_id"
|
1021
974
|
t.datetime "deleted_at"
|
1022
|
-
t.integer
|
975
|
+
t.integer "subscribes_count", default: 0, null: false
|
1023
976
|
t.datetime "created_at"
|
1024
977
|
t.datetime "updated_at"
|
978
|
+
t.index ["order_list_id"], name: "index_subscriptions_on_order_list_id"
|
979
|
+
t.index ["user_id"], name: "index_subscriptions_on_user_id"
|
1025
980
|
end
|
1026
981
|
|
1027
|
-
add_index "subscriptions", ["order_list_id"], name: "index_subscriptions_on_order_list_id"
|
1028
|
-
add_index "subscriptions", ["user_id"], name: "index_subscriptions_on_user_id"
|
1029
|
-
|
1030
982
|
create_table "taggings", force: :cascade do |t|
|
1031
|
-
t.integer
|
1032
|
-
t.
|
1033
|
-
t.
|
1034
|
-
t.
|
1035
|
-
t.
|
1036
|
-
t.string
|
1037
|
-
t.datetime "created_at"
|
983
|
+
t.integer "tag_id"
|
984
|
+
t.string "taggable_type"
|
985
|
+
t.integer "taggable_id"
|
986
|
+
t.string "tagger_type"
|
987
|
+
t.integer "tagger_id"
|
988
|
+
t.string "context", limit: 128
|
989
|
+
t.datetime "created_at"
|
990
|
+
t.index ["context"], name: "index_taggings_on_context"
|
991
|
+
t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true
|
992
|
+
t.index ["tag_id"], name: "index_taggings_on_tag_id"
|
993
|
+
t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
|
994
|
+
t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy"
|
995
|
+
t.index ["taggable_id"], name: "index_taggings_on_taggable_id"
|
996
|
+
t.index ["taggable_type"], name: "index_taggings_on_taggable_type"
|
997
|
+
t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type"
|
998
|
+
t.index ["tagger_id"], name: "index_taggings_on_tagger_id"
|
1038
999
|
end
|
1039
1000
|
|
1040
|
-
add_index "taggings", ["tag_id"], name: "index_taggings_on_tag_id"
|
1041
|
-
add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
|
1042
|
-
|
1043
1001
|
create_table "tags", force: :cascade do |t|
|
1044
|
-
t.string
|
1045
|
-
t.
|
1046
|
-
t.
|
1047
|
-
t.datetime "updated_at"
|
1048
|
-
t.integer "taggings_count", default: 0
|
1002
|
+
t.string "name"
|
1003
|
+
t.integer "taggings_count", default: 0
|
1004
|
+
t.index ["name"], name: "index_tags_on_name", unique: true
|
1049
1005
|
end
|
1050
1006
|
|
1051
1007
|
create_table "user_export_file_transitions", force: :cascade do |t|
|
1052
|
-
t.string
|
1053
|
-
t.text
|
1054
|
-
t.integer
|
1055
|
-
t.integer
|
1008
|
+
t.string "to_state"
|
1009
|
+
t.text "metadata", default: "{}"
|
1010
|
+
t.integer "sort_key"
|
1011
|
+
t.integer "user_export_file_id"
|
1056
1012
|
t.datetime "created_at"
|
1057
1013
|
t.datetime "updated_at"
|
1058
|
-
t.boolean
|
1014
|
+
t.boolean "most_recent"
|
1015
|
+
t.index ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
|
1016
|
+
t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_file_id"
|
1059
1017
|
end
|
1060
1018
|
|
1061
|
-
add_index "user_export_file_transitions", ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
|
1062
|
-
add_index "user_export_file_transitions", ["user_export_file_id"], name: "index_user_export_file_transitions_on_file_id"
|
1063
|
-
|
1064
1019
|
create_table "user_export_files", force: :cascade do |t|
|
1065
|
-
t.integer
|
1066
|
-
t.string
|
1067
|
-
t.string
|
1068
|
-
t.integer
|
1020
|
+
t.integer "user_id"
|
1021
|
+
t.string "user_export_file_name"
|
1022
|
+
t.string "user_export_content_type"
|
1023
|
+
t.integer "user_export_file_size"
|
1069
1024
|
t.datetime "user_export_updated_at"
|
1070
1025
|
t.datetime "executed_at"
|
1071
1026
|
t.datetime "created_at"
|
@@ -1073,117 +1028,111 @@ ActiveRecord::Schema.define(version: 20160814165332) do
|
|
1073
1028
|
end
|
1074
1029
|
|
1075
1030
|
create_table "user_groups", force: :cascade do |t|
|
1076
|
-
t.string
|
1077
|
-
t.text
|
1078
|
-
t.text
|
1079
|
-
t.integer
|
1031
|
+
t.string "name"
|
1032
|
+
t.text "display_name"
|
1033
|
+
t.text "note"
|
1034
|
+
t.integer "position"
|
1080
1035
|
t.datetime "created_at"
|
1081
1036
|
t.datetime "updated_at"
|
1082
1037
|
t.datetime "deleted_at"
|
1083
|
-
t.integer
|
1038
|
+
t.integer "valid_period_for_new_user", default: 0, null: false
|
1084
1039
|
t.datetime "expired_at"
|
1085
1040
|
end
|
1086
1041
|
|
1087
1042
|
create_table "user_has_roles", force: :cascade do |t|
|
1088
|
-
t.integer
|
1089
|
-
t.integer
|
1043
|
+
t.integer "user_id"
|
1044
|
+
t.integer "role_id"
|
1090
1045
|
t.datetime "created_at"
|
1091
1046
|
t.datetime "updated_at"
|
1047
|
+
t.index ["role_id"], name: "index_user_has_roles_on_role_id"
|
1048
|
+
t.index ["user_id"], name: "index_user_has_roles_on_user_id"
|
1092
1049
|
end
|
1093
1050
|
|
1094
|
-
add_index "user_has_roles", ["role_id"], name: "index_user_has_roles_on_role_id"
|
1095
|
-
add_index "user_has_roles", ["user_id"], name: "index_user_has_roles_on_user_id"
|
1096
|
-
|
1097
1051
|
create_table "user_import_file_transitions", force: :cascade do |t|
|
1098
|
-
t.string
|
1099
|
-
t.text
|
1100
|
-
t.integer
|
1101
|
-
t.integer
|
1052
|
+
t.string "to_state"
|
1053
|
+
t.text "metadata", default: "{}"
|
1054
|
+
t.integer "sort_key"
|
1055
|
+
t.integer "user_import_file_id"
|
1102
1056
|
t.datetime "created_at"
|
1103
1057
|
t.datetime "updated_at"
|
1104
|
-
t.boolean
|
1058
|
+
t.boolean "most_recent"
|
1059
|
+
t.index ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
|
1060
|
+
t.index ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
|
1105
1061
|
end
|
1106
1062
|
|
1107
|
-
add_index "user_import_file_transitions", ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
|
1108
|
-
add_index "user_import_file_transitions", ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
|
1109
|
-
|
1110
1063
|
create_table "user_import_files", force: :cascade do |t|
|
1111
|
-
t.integer
|
1112
|
-
t.text
|
1064
|
+
t.integer "user_id"
|
1065
|
+
t.text "note"
|
1113
1066
|
t.datetime "executed_at"
|
1114
|
-
t.string
|
1115
|
-
t.string
|
1116
|
-
t.integer
|
1067
|
+
t.string "user_import_file_name"
|
1068
|
+
t.string "user_import_content_type"
|
1069
|
+
t.integer "user_import_file_size"
|
1117
1070
|
t.datetime "user_import_updated_at"
|
1118
|
-
t.string
|
1119
|
-
t.string
|
1120
|
-
t.text
|
1071
|
+
t.string "user_import_fingerprint"
|
1072
|
+
t.string "edit_mode"
|
1073
|
+
t.text "error_message"
|
1121
1074
|
t.datetime "created_at"
|
1122
1075
|
t.datetime "updated_at"
|
1123
|
-
t.string
|
1124
|
-
t.integer
|
1125
|
-
t.integer
|
1076
|
+
t.string "user_encoding"
|
1077
|
+
t.integer "default_library_id"
|
1078
|
+
t.integer "default_user_group_id"
|
1126
1079
|
end
|
1127
1080
|
|
1128
1081
|
create_table "user_import_results", force: :cascade do |t|
|
1129
|
-
t.integer
|
1130
|
-
t.integer
|
1131
|
-
t.text
|
1082
|
+
t.integer "user_import_file_id"
|
1083
|
+
t.integer "user_id"
|
1084
|
+
t.text "body"
|
1132
1085
|
t.datetime "created_at"
|
1133
1086
|
t.datetime "updated_at"
|
1134
|
-
t.text
|
1087
|
+
t.text "error_message"
|
1135
1088
|
end
|
1136
1089
|
|
1137
1090
|
create_table "users", force: :cascade do |t|
|
1138
|
-
t.string
|
1139
|
-
t.string
|
1140
|
-
t.string
|
1091
|
+
t.string "email", default: "", null: false
|
1092
|
+
t.string "encrypted_password", default: "", null: false
|
1093
|
+
t.string "reset_password_token"
|
1141
1094
|
t.datetime "reset_password_sent_at"
|
1142
1095
|
t.datetime "remember_created_at"
|
1143
|
-
t.integer
|
1096
|
+
t.integer "sign_in_count", default: 0
|
1144
1097
|
t.datetime "current_sign_in_at"
|
1145
1098
|
t.datetime "last_sign_in_at"
|
1146
|
-
t.string
|
1147
|
-
t.string
|
1099
|
+
t.string "current_sign_in_ip"
|
1100
|
+
t.string "last_sign_in_ip"
|
1148
1101
|
t.datetime "created_at"
|
1149
1102
|
t.datetime "updated_at"
|
1150
|
-
t.
|
1151
|
-
t.string
|
1152
|
-
t.string "username"
|
1103
|
+
t.string "answer_feed_token"
|
1104
|
+
t.string "username"
|
1153
1105
|
t.datetime "deleted_at"
|
1154
1106
|
t.datetime "expired_at"
|
1155
|
-
t.integer
|
1156
|
-
t.string
|
1107
|
+
t.integer "failed_attempts", default: 0
|
1108
|
+
t.string "unlock_token"
|
1157
1109
|
t.datetime "locked_at"
|
1158
1110
|
t.datetime "confirmed_at"
|
1111
|
+
t.index ["answer_feed_token"], name: "index_users_on_answer_feed_token", unique: true
|
1112
|
+
t.index ["email"], name: "index_users_on_email"
|
1113
|
+
t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
1114
|
+
t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
|
1115
|
+
t.index ["username"], name: "index_users_on_username", unique: true
|
1159
1116
|
end
|
1160
1117
|
|
1161
|
-
add_index "users", ["answer_feed_token"], name: "index_users_on_answer_feed_token", unique: true
|
1162
|
-
add_index "users", ["email"], name: "index_users_on_email"
|
1163
|
-
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
1164
|
-
add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", unique: true
|
1165
|
-
add_index "users", ["username"], name: "index_users_on_username", unique: true
|
1166
|
-
|
1167
1118
|
create_table "versions", force: :cascade do |t|
|
1168
|
-
t.string
|
1169
|
-
t.integer
|
1170
|
-
t.string
|
1171
|
-
t.string
|
1172
|
-
t.text
|
1119
|
+
t.string "item_type", null: false
|
1120
|
+
t.integer "item_id", null: false
|
1121
|
+
t.string "event", null: false
|
1122
|
+
t.string "whodunnit"
|
1123
|
+
t.text "object"
|
1173
1124
|
t.datetime "created_at"
|
1125
|
+
t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
|
1174
1126
|
end
|
1175
1127
|
|
1176
|
-
add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
|
1177
|
-
|
1178
1128
|
create_table "withdraws", force: :cascade do |t|
|
1179
|
-
t.integer
|
1180
|
-
t.integer
|
1181
|
-
t.integer
|
1182
|
-
t.datetime "created_at",
|
1183
|
-
t.datetime "updated_at",
|
1129
|
+
t.integer "basket_id"
|
1130
|
+
t.integer "item_id"
|
1131
|
+
t.integer "librarian_id"
|
1132
|
+
t.datetime "created_at", null: false
|
1133
|
+
t.datetime "updated_at", null: false
|
1134
|
+
t.index ["basket_id"], name: "index_withdraws_on_basket_id"
|
1135
|
+
t.index ["item_id"], name: "index_withdraws_on_item_id"
|
1184
1136
|
end
|
1185
1137
|
|
1186
|
-
add_index "withdraws", ["basket_id"], name: "index_withdraws_on_basket_id"
|
1187
|
-
add_index "withdraws", ["item_id"], name: "index_withdraws_on_item_id"
|
1188
|
-
|
1189
1138
|
end
|