enju_oai 0.2.0.beta.2 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (297) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +11 -0
  3. data/Rakefile +1 -1
  4. data/app/assets/config/enju_oai_manifest.js +0 -0
  5. data/app/controllers/oai_controller.rb +2 -0
  6. data/app/views/oai/_record_dcndl.xml.builder +164 -54
  7. data/app/views/oai/get_record.xml.builder +2 -2
  8. data/app/views/oai/identify.xml.builder +2 -2
  9. data/app/views/oai/list_identifiers.xml.builder +10 -12
  10. data/app/views/oai/list_metadata_formats.xml.builder +2 -2
  11. data/app/views/oai/list_records.xml.builder +17 -19
  12. data/app/views/oai/list_sets.xml.builder +2 -2
  13. data/app/views/oai/provider.xml.builder +2 -2
  14. data/lib/enju_oai/oai_controller.rb +3 -2
  15. data/lib/enju_oai/version.rb +1 -1
  16. data/spec/cassette_library/oai/list_records_xml_builder/when_metadataPrefix_is_dcndl/renders_well-formed_XML.yml +62 -0
  17. data/spec/controllers/oai_controller_spec.rb +42 -10
  18. data/spec/dummy/app/models/application_record.rb +3 -0
  19. data/spec/dummy/app/models/user.rb +5 -1
  20. data/spec/dummy/bin/rails +1 -1
  21. data/spec/dummy/bin/setup +21 -12
  22. data/spec/dummy/bin/update +29 -0
  23. data/spec/dummy/bin/yarn +11 -0
  24. data/spec/dummy/config/application.rb +7 -17
  25. data/spec/dummy/config/database.yml +17 -22
  26. data/spec/dummy/config/environment.rb +4 -4
  27. data/spec/dummy/config/environments/development.rb +24 -11
  28. data/spec/dummy/config/environments/production.rb +28 -16
  29. data/spec/dummy/config/environments/test.rb +6 -8
  30. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  31. data/spec/dummy/config/initializers/assets.rb +14 -0
  32. data/spec/dummy/config/initializers/cookies_serializer.rb +5 -0
  33. data/spec/dummy/config/initializers/filter_parameter_logging.rb +4 -0
  34. data/spec/dummy/config/initializers/inflections.rb +6 -5
  35. data/spec/dummy/config/initializers/mime_types.rb +0 -1
  36. data/spec/dummy/config/initializers/session_store.rb +1 -1
  37. data/spec/dummy/config/initializers/wrap_parameters.rb +6 -6
  38. data/spec/dummy/config/sunspot.yml +23 -0
  39. data/spec/dummy/db/migrate/001_create_agents.rb +7 -7
  40. data/spec/dummy/db/migrate/002_devise_create_users.rb +6 -6
  41. data/spec/dummy/db/migrate/005_create_manifestations.rb +10 -10
  42. data/spec/dummy/db/migrate/006_create_items.rb +6 -6
  43. data/spec/dummy/db/migrate/012_create_owns.rb +3 -3
  44. data/spec/dummy/db/migrate/015_create_creates.rb +3 -3
  45. data/spec/dummy/db/migrate/029_create_subjects.rb +4 -4
  46. data/spec/dummy/db/migrate/032_create_checkins.rb +2 -2
  47. data/spec/dummy/db/migrate/033_create_checkouts.rb +5 -5
  48. data/spec/dummy/db/migrate/035_create_reserves.rb +6 -6
  49. data/spec/dummy/db/migrate/041_create_roles.rb +3 -3
  50. data/spec/dummy/db/migrate/047_create_produces.rb +3 -3
  51. data/spec/dummy/db/migrate/059_create_libraries.rb +8 -10
  52. data/spec/dummy/db/migrate/069_create_shelves.rb +4 -5
  53. data/spec/dummy/db/migrate/073_create_carrier_types.rb +2 -2
  54. data/spec/dummy/db/migrate/077_create_user_groups.rb +2 -2
  55. data/spec/dummy/db/migrate/080_create_library_groups.rb +3 -4
  56. data/spec/dummy/db/migrate/112_create_frequencies.rb +2 -2
  57. data/spec/dummy/db/migrate/113_create_events.rb +4 -4
  58. data/spec/dummy/db/migrate/114_create_event_categories.rb +2 -2
  59. data/spec/dummy/db/migrate/117_create_form_of_works.rb +2 -2
  60. data/spec/dummy/db/migrate/120_create_baskets.rb +3 -4
  61. data/spec/dummy/db/migrate/121_create_checked_items.rb +4 -4
  62. data/spec/dummy/db/migrate/124_create_bookstores.rb +2 -2
  63. data/spec/dummy/db/migrate/125_create_donates.rb +3 -3
  64. data/spec/dummy/db/migrate/127_create_use_restrictions.rb +2 -2
  65. data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +3 -3
  66. data/spec/dummy/db/migrate/130_create_request_status_types.rb +2 -2
  67. data/spec/dummy/db/migrate/131_create_request_types.rb +2 -2
  68. data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +2 -2
  69. data/spec/dummy/db/migrate/133_create_agent_merges.rb +2 -2
  70. data/spec/dummy/db/migrate/134_create_agent_merge_lists.rb +1 -1
  71. data/spec/dummy/db/migrate/142_create_classifications.rb +3 -3
  72. data/spec/dummy/db/migrate/144_create_classification_types.rb +2 -2
  73. data/spec/dummy/db/migrate/145_create_subject_heading_types.rb +2 -2
  74. data/spec/dummy/db/migrate/146_create_subject_types.rb +2 -2
  75. data/spec/dummy/db/migrate/149_create_message_templates.rb +18 -0
  76. data/spec/dummy/db/migrate/154_create_messages.rb +23 -0
  77. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +18 -0
  78. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +3 -3
  79. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +4 -4
  80. data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +2 -2
  81. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +5 -8
  82. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +5 -6
  83. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +6 -6
  84. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +5 -5
  85. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +6 -6
  86. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +2 -4
  87. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +1 -1
  88. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
  89. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +1 -1
  90. data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +2 -2
  91. data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +9 -9
  92. data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +4 -4
  93. data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +5 -5
  94. data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +1 -1
  95. data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +1 -1
  96. data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +4 -4
  97. data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +4 -4
  98. data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +1 -1
  99. data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +1 -1
  100. data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +3 -3
  101. data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +1 -1
  102. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +3 -3
  103. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +1 -1
  104. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +1 -1
  105. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +2 -2
  106. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +2 -2
  107. data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +2 -2
  108. data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +7 -7
  109. data/spec/dummy/db/migrate/20090913173236_create_nii_types.rb +3 -3
  110. data/spec/dummy/db/migrate/20090913185239_add_nii_type_id_to_manifestation.rb +1 -1
  111. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +3 -3
  112. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +2 -2
  113. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +4 -4
  114. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +1 -1
  115. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +1 -1
  116. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +1 -1
  117. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +1 -1
  118. data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
  119. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +1 -1
  120. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +1 -1
  121. data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +3 -5
  122. data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +1 -1
  123. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +2 -2
  124. data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +1 -1
  125. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +1 -1
  126. data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +1 -1
  127. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +1 -1
  128. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +1 -1
  129. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +2 -2
  130. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +1 -1
  131. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +1 -1
  132. data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +1 -1
  133. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +2 -2
  134. data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +1 -1
  135. data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +1 -1
  136. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +1 -1
  137. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +1 -1
  138. data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +1 -1
  139. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +1 -1
  140. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +3 -3
  141. data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +4 -4
  142. data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +11 -0
  143. data/spec/dummy/db/migrate/20110913120629_add_lft_and_rgt_to_classification.rb +1 -1
  144. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +1 -1
  145. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +1 -1
  146. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +1 -1
  147. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +1 -1
  148. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +1 -1
  149. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +1 -1
  150. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +1 -1
  151. data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +2 -2
  152. data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +2 -2
  153. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
  154. data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +6 -0
  155. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -1
  156. data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +1 -1
  157. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -1
  158. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +2 -2
  159. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +4 -7
  160. data/spec/dummy/db/migrate/20120406020752_add_url_to_subject.rb +1 -1
  161. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +1 -1
  162. data/spec/dummy/db/migrate/20120413051535_add_event_import_fingerprint_to_event_import_file.rb +1 -1
  163. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +1 -1
  164. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +1 -1
  165. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +1 -1
  166. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +1 -1
  167. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +1 -1
  168. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +1 -1
  169. data/spec/dummy/db/migrate/20120413170734_add_error_message_to_event_import_file.rb +1 -1
  170. data/spec/dummy/db/migrate/20120415060342_rename_event_import_file_imported_at_to_executed_at.rb +1 -1
  171. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +1 -1
  172. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +1 -1
  173. data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +1 -1
  174. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +2 -2
  175. data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +1 -1
  176. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +1 -1
  177. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +1 -1
  178. data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +4 -4
  179. data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +1 -1
  180. data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +1 -1
  181. data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
  182. data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +3 -3
  183. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +1 -1
  184. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +1 -1
  185. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +1 -1
  186. data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +1 -1
  187. data/spec/dummy/db/migrate/20130504133816_add_manifestation_id_to_subject.rb +1 -1
  188. data/spec/dummy/db/migrate/20130504143515_add_manifestation_id_to_classification.rb +1 -1
  189. data/spec/dummy/db/migrate/20130504195916_add_subject_heading_type_id_to_subject.rb +1 -1
  190. data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +1 -1
  191. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +3 -3
  192. data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +1 -1
  193. data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +2 -2
  194. data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +2 -2
  195. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +2 -2
  196. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +3 -3
  197. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +6 -7
  198. data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +1 -1
  199. data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +18 -0
  200. data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +18 -0
  201. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +1 -1
  202. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +1 -1
  203. data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +1 -1
  204. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +1 -1
  205. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +2 -3
  206. data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +1 -1
  207. data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +1 -1
  208. data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +1 -1
  209. data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +1 -1
  210. data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +1 -1
  211. data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +1 -1
  212. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +1 -1
  213. data/spec/dummy/db/migrate/20140628071719_add_user_encoding_to_event_import_file.rb +1 -1
  214. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
  215. data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +1 -1
  216. data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +1 -1
  217. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +2 -2
  218. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +2 -2
  219. data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +1 -1
  220. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +2 -2
  221. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +2 -2
  222. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
  223. data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +1 -1
  224. data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +1 -1
  225. data/spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb +1 -1
  226. data/spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb +2 -2
  227. data/spec/dummy/db/migrate/20140810091417_add_save_checkout_history_to_profile.rb +2 -2
  228. data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +1 -1
  229. data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
  230. data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +1 -1
  231. data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +1 -1
  232. data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
  233. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +2 -4
  234. data/spec/dummy/db/migrate/20140822114527_add_error_message_to_resource_import_result.rb +1 -1
  235. data/spec/dummy/db/migrate/20140823083524_add_extent_to_manifestation.rb +1 -1
  236. data/spec/dummy/db/migrate/20140823094847_add_dimensions_to_manifestation.rb +1 -1
  237. data/spec/dummy/db/migrate/20140823095740_rename_manifestation_periodical_to_serial.rb +1 -1
  238. data/spec/dummy/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb +1 -1
  239. data/spec/dummy/db/migrate/20141003182825_add_date_of_birth_to_profile.rb +1 -1
  240. data/spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb +1 -1
  241. data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  242. data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +1 -1
  243. data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +1 -1
  244. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +4 -6
  245. data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +6 -0
  246. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +12 -7
  247. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +16 -3
  248. data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
  249. data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
  250. data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
  251. data/spec/dummy/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +9 -0
  252. data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +9 -0
  253. data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +9 -0
  254. data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +9 -0
  255. data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +9 -0
  256. data/spec/dummy/db/migrate/20160811102604_add_picture_width_to_picture_file.rb +6 -0
  257. data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +5 -0
  258. data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +5 -0
  259. data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +5 -0
  260. data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +5 -0
  261. data/spec/dummy/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb +9 -0
  262. data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +11 -0
  263. data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +5 -0
  264. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
  265. data/spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +5 -0
  266. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
  267. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
  268. data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +5 -0
  269. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +13 -0
  270. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +13 -0
  271. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +13 -0
  272. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +13 -0
  273. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +13 -0
  274. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +13 -0
  275. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +5 -0
  276. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +5 -0
  277. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +12 -0
  278. data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +12 -0
  279. data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +12 -0
  280. data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +12 -0
  281. data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +12 -0
  282. data/spec/dummy/db/schema.rb +967 -887
  283. data/spec/factories/manifestation.rb +1 -1
  284. data/spec/factories/user.rb +11 -20
  285. data/spec/fixtures/library_groups.yml +1 -6
  286. data/spec/rails_helper.rb +53 -0
  287. data/spec/spec_helper.rb +82 -47
  288. data/spec/support/controller_macros.rb +3 -3
  289. data/spec/views/oai/get_record.xml.builder +3 -3
  290. data/spec/views/oai/identify.xml.builder_spec.rb +1 -1
  291. data/spec/views/oai/list_identifiers.xml.builder_spec.rb +13 -6
  292. data/spec/views/oai/list_metadata_formats.xml.builder_spec.rb +1 -1
  293. data/spec/views/oai/list_records.xml.builder_spec.rb +57 -17
  294. metadata +421 -297
  295. data/README.rdoc +0 -10
  296. data/spec/dummy/config/initializers/enju_leaf.rb +0 -2
  297. data/spec/dummy/db/migrate/20160813130535_add_email_to_library_group.rb +0 -5
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToResourceExportFileTransitions < ActiveRecord::Migration[4.2]
2
+ def up
3
+ add_column :resource_export_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :resource_export_file_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToAgentImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ def up
3
+ add_column :agent_import_file_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :agent_import_file_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,6 @@
1
+ class AddPictureWidthToPictureFile < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :picture_files, :picture_width, :integer
4
+ add_column :picture_files, :picture_height, :integer
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddMaxNumberOfResultsToLibraryGroup < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :library_groups, :max_number_of_results, :integer, default: 500
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddFamilyNameFirstToLibraryGroup < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :library_groups, :family_name_first, :boolean, default: true
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddPubYearFacetRangeIntervalToLibraryGroup < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :library_groups, :pub_year_facet_range_interval, :integer, default: 10
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddUserIdToLibraryGroup < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_reference :library_groups, :user, index: true, foreign_key: true
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class AddMostRecentToMessageRequestTransitions < ActiveRecord::Migration[4.2]
2
+ def up
3
+ add_column :message_request_transitions, :most_recent, :boolean, null: true
4
+ end
5
+
6
+ def down
7
+ remove_column :message_request_transitions, :most_recent
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class AddAttachmentAttachmentToCarrierTypes < ActiveRecord::Migration[4.2]
2
+ def self.up
3
+ change_table :carrier_types do |t|
4
+ t.attachment :attachment
5
+ end
6
+ end
7
+
8
+ def self.down
9
+ remove_attachment :carrier_types, :attachment
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddCsvCharsetConversionToLibraryGroup < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :library_groups, :csv_charset_conversion, :boolean, null: false, default: false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddHeaderLogoToLibraryGroup < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_attachment :library_groups, :header_logo
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class SetNotNullToManifestationIdOnItems < ActiveRecord::Migration[4.2]
2
+ def change
3
+ change_column_null :items, :manifestation_id, false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class RenameLoginBannerToOldLoginBanner < ActiveRecord::Migration[4.2]
2
+ def change
3
+ rename_column :library_groups, :login_banner, :old_login_banner
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddForeignKeyToLibraryGroupIdOnLibrary < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_foreign_key :libraries, :library_groups, null: false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddHeaderLogoMetaToLibraryGroup < ActiveRecord::Migration[4.2]
2
+ def change
3
+ add_column :library_groups, :header_logo_meta, :text
4
+ end
5
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :user_import_file_transitions, [:user_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_user_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :user_import_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :user_import_file_transitions, name: "index_user_import_file_transitions_parent_most_recent"
11
+ change_column_null :user_import_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :user_export_file_transitions, [:user_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_user_export_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :user_export_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :user_export_file_transitions, name: "index_user_export_file_transitions_parent_most_recent"
11
+ change_column_null :user_export_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForAgentImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :agent_import_file_transitions, [:agent_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_agent_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :agent_import_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :agent_import_file_transitions, name: "index_agent_import_file_transitions_parent_most_recent"
11
+ change_column_null :agent_import_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForResourceImportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :resource_import_file_transitions, [:resource_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_resource_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :resource_import_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :resource_import_file_transitions, name: "index_resource_import_file_transitions_parent_most_recent"
11
+ change_column_null :resource_import_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForResourceExportFileTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :resource_export_file_transitions, [:resource_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_resource_export_file_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :resource_export_file_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :resource_export_file_transitions, name: "index_resource_export_file_transitions_parent_most_recent"
11
+ change_column_null :resource_export_file_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForImportRequestTransitions < ActiveRecord::Migration[4.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :import_request_transitions, [:import_request_id, :most_recent], unique: true, where: "most_recent", name: "index_import_request_transitions_parent_most_recent" #, algorithm: :concurrently
6
+ change_column_null :import_request_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :import_request_transitions, name: "index_import_request_transitions_parent_most_recent"
11
+ change_column_null :import_request_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,5 @@
1
+ class AddMemoToManifestation < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :manifestations, :memo, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddMemoToItem < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :items, :memo, :text
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ class CreateCustomProperties < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :custom_properties do |t|
4
+ t.integer :resource_id, null: false
5
+ t.string :resource_type, null: false
6
+ t.text :label, null: false
7
+ t.text :value
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateManifestationCustomProperties < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :manifestation_custom_properties do |t|
4
+ t.string :name, null: false, comment: 'ラベル名', index: {unique: true}
5
+ t.text :display_name, null: false, comment: '表示名'
6
+ t.text :note, comment: '備考'
7
+ t.integer :position, default: 1, null: false
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateItemCustomProperties < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :item_custom_properties do |t|
4
+ t.string :name, null: false, comment: 'ラベル名', index: {unique: true}
5
+ t.text :display_name, null: false, comment: '表示名'
6
+ t.text :note, comment: '備考'
7
+ t.integer :position, default: 1, null: false
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateManifestationCustomValues < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :manifestation_custom_values do |t|
4
+ t.references :manifestation_custom_property, null: false, foreign_key: true, index: {name: 'index_manifestation_custom_values_on_custom_property_id'}
5
+ t.references :manifestation, null: false, foreign_key: true
6
+ t.text :value
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :manifestation_custom_values, [:manifestation_custom_property_id, :manifestation_id], unique: true, name: 'index_manifestation_custom_values_on_property_manifestation'
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateItemCustomValues < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :item_custom_values do |t|
4
+ t.references :item_custom_property, null: false, foreign_key: true, index: {name: 'index_item_custom_values_on_custom_property_id'}
5
+ t.references :item, null: false, foreign_key: true
6
+ t.text :value
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :item_custom_values, [:item_custom_property_id, :item_id], unique: true, name: 'index_item_custom_values_on_custom_item_property_and_item_id'
11
+ end
12
+ end
@@ -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,422 +10,420 @@
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: 20160813130535) do
13
+ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
15
14
 
16
15
  create_table "accepts", force: :cascade do |t|
17
- t.integer "basket_id"
18
- t.integer "item_id"
19
- t.integer "librarian_id"
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"
23
+ t.index ["librarian_id"], name: "index_accepts_on_librarian_id"
22
24
  end
23
25
 
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
26
  create_table "agent_import_file_transitions", force: :cascade do |t|
28
- t.string "to_state"
29
- t.text "metadata", default: "{}"
30
- t.integer "sort_key"
31
- t.integer "agent_import_file_id"
27
+ t.string "to_state"
28
+ t.text "metadata", default: "{}"
29
+ t.integer "sort_key"
30
+ t.integer "agent_import_file_id"
32
31
  t.datetime "created_at"
33
32
  t.datetime "updated_at"
33
+ t.boolean "most_recent", null: false
34
+ t.index ["agent_import_file_id", "most_recent"], name: "index_agent_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
35
+ t.index ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
36
+ t.index ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
34
37
  end
35
38
 
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
39
  create_table "agent_import_files", force: :cascade do |t|
40
- t.integer "parent_id"
41
- t.string "content_type"
42
- t.integer "size"
43
- t.integer "user_id"
44
- t.text "note"
40
+ t.integer "parent_id"
41
+ t.string "content_type"
42
+ t.integer "size"
43
+ t.integer "user_id"
44
+ t.text "note"
45
45
  t.datetime "executed_at"
46
- t.string "agent_import_file_name"
47
- t.string "agent_import_content_type"
48
- t.integer "agent_import_file_size"
46
+ t.string "agent_import_file_name"
47
+ t.string "agent_import_content_type"
48
+ t.integer "agent_import_file_size"
49
49
  t.datetime "agent_import_updated_at"
50
50
  t.datetime "created_at"
51
51
  t.datetime "updated_at"
52
- t.string "agent_import_fingerprint"
53
- t.text "error_message"
54
- t.string "edit_mode"
55
- t.string "user_encoding"
52
+ t.string "agent_import_fingerprint"
53
+ t.text "error_message"
54
+ t.string "edit_mode"
55
+ t.string "user_encoding"
56
+ t.index ["parent_id"], name: "index_agent_import_files_on_parent_id"
57
+ t.index ["user_id"], name: "index_agent_import_files_on_user_id"
56
58
  end
57
59
 
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
60
  create_table "agent_import_results", force: :cascade do |t|
62
- t.integer "agent_import_file_id"
63
- t.integer "agent_id"
64
- t.text "body"
61
+ t.integer "agent_import_file_id"
62
+ t.integer "agent_id"
63
+ t.text "body"
65
64
  t.datetime "created_at"
66
65
  t.datetime "updated_at"
67
66
  end
68
67
 
69
68
  create_table "agent_merge_lists", force: :cascade do |t|
70
- t.string "title"
69
+ t.string "title"
71
70
  t.datetime "created_at"
72
71
  t.datetime "updated_at"
73
72
  end
74
73
 
75
74
  create_table "agent_merges", force: :cascade do |t|
76
- t.integer "agent_id", null: false
77
- t.integer "agent_merge_list_id", null: false
75
+ t.integer "agent_id", null: false
76
+ t.integer "agent_merge_list_id", null: false
78
77
  t.datetime "created_at"
79
78
  t.datetime "updated_at"
79
+ t.index ["agent_id"], name: "index_agent_merges_on_agent_id"
80
+ t.index ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
80
81
  end
81
82
 
82
- add_index "agent_merges", ["agent_id"], name: "index_agent_merges_on_agent_id"
83
- add_index "agent_merges", ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
84
-
85
83
  create_table "agent_relationship_types", force: :cascade do |t|
86
- t.string "name", null: false
87
- t.text "display_name"
88
- t.text "note"
89
- t.integer "position"
84
+ t.string "name", null: false
85
+ t.text "display_name"
86
+ t.text "note"
87
+ t.integer "position"
90
88
  t.datetime "created_at"
91
89
  t.datetime "updated_at"
92
90
  end
93
91
 
94
92
  create_table "agent_relationships", force: :cascade do |t|
95
- t.integer "parent_id"
96
- t.integer "child_id"
97
- t.integer "agent_relationship_type_id"
93
+ t.integer "parent_id"
94
+ t.integer "child_id"
95
+ t.integer "agent_relationship_type_id"
98
96
  t.datetime "created_at"
99
97
  t.datetime "updated_at"
100
- t.integer "position"
98
+ t.integer "position"
99
+ t.index ["child_id"], name: "index_agent_relationships_on_child_id"
100
+ t.index ["parent_id"], name: "index_agent_relationships_on_parent_id"
101
101
  end
102
102
 
103
- add_index "agent_relationships", ["child_id"], name: "index_agent_relationships_on_child_id"
104
- add_index "agent_relationships", ["parent_id"], name: "index_agent_relationships_on_parent_id"
105
-
106
103
  create_table "agent_types", force: :cascade do |t|
107
- t.string "name", null: false
108
- t.text "display_name"
109
- t.text "note"
110
- t.integer "position"
104
+ t.string "name", null: false
105
+ t.text "display_name"
106
+ t.text "note"
107
+ t.integer "position"
111
108
  t.datetime "created_at"
112
109
  t.datetime "updated_at"
113
110
  end
114
111
 
115
112
  create_table "agents", force: :cascade do |t|
116
- t.string "last_name"
117
- t.string "middle_name"
118
- t.string "first_name"
119
- t.string "last_name_transcription"
120
- t.string "middle_name_transcription"
121
- t.string "first_name_transcription"
122
- t.string "corporate_name"
123
- t.string "corporate_name_transcription"
124
- t.string "full_name"
125
- t.text "full_name_transcription"
126
- t.text "full_name_alternative"
113
+ t.string "last_name"
114
+ t.string "middle_name"
115
+ t.string "first_name"
116
+ t.string "last_name_transcription"
117
+ t.string "middle_name_transcription"
118
+ t.string "first_name_transcription"
119
+ t.string "corporate_name"
120
+ t.string "corporate_name_transcription"
121
+ t.string "full_name"
122
+ t.text "full_name_transcription"
123
+ t.text "full_name_alternative"
127
124
  t.datetime "created_at"
128
125
  t.datetime "updated_at"
129
126
  t.datetime "deleted_at"
130
- t.string "zip_code_1"
131
- t.string "zip_code_2"
132
- t.text "address_1"
133
- t.text "address_2"
134
- t.text "address_1_note"
135
- t.text "address_2_note"
136
- t.string "telephone_number_1"
137
- t.string "telephone_number_2"
138
- t.string "fax_number_1"
139
- t.string "fax_number_2"
140
- t.text "other_designation"
141
- t.text "place"
142
- t.string "postal_code"
143
- t.text "street"
144
- t.text "locality"
145
- t.text "region"
127
+ t.string "zip_code_1"
128
+ t.string "zip_code_2"
129
+ t.text "address_1"
130
+ t.text "address_2"
131
+ t.text "address_1_note"
132
+ t.text "address_2_note"
133
+ t.string "telephone_number_1"
134
+ t.string "telephone_number_2"
135
+ t.string "fax_number_1"
136
+ t.string "fax_number_2"
137
+ t.text "other_designation"
138
+ t.text "place"
139
+ t.string "postal_code"
140
+ t.text "street"
141
+ t.text "locality"
142
+ t.text "region"
146
143
  t.datetime "date_of_birth"
147
144
  t.datetime "date_of_death"
148
- t.integer "language_id", default: 1, null: false
149
- t.integer "country_id", default: 1, null: false
150
- t.integer "agent_type_id", default: 1, null: false
151
- t.integer "lock_version", default: 0, null: false
152
- t.text "note"
153
- t.integer "required_role_id", default: 1, null: false
154
- t.integer "required_score", default: 0, null: false
155
- t.text "email"
156
- t.text "url"
157
- t.text "full_name_alternative_transcription"
158
- t.string "birth_date"
159
- t.string "death_date"
160
- t.string "agent_identifier"
161
- end
162
-
163
- add_index "agents", ["agent_identifier"], name: "index_agents_on_agent_identifier"
164
- add_index "agents", ["country_id"], name: "index_agents_on_country_id"
165
- add_index "agents", ["full_name"], name: "index_agents_on_full_name"
166
- add_index "agents", ["language_id"], name: "index_agents_on_language_id"
167
- add_index "agents", ["required_role_id"], name: "index_agents_on_required_role_id"
145
+ t.integer "language_id", default: 1, null: false
146
+ t.integer "country_id", default: 1, null: false
147
+ t.integer "agent_type_id", default: 1, null: false
148
+ t.integer "lock_version", default: 0, null: false
149
+ t.text "note"
150
+ t.integer "required_role_id", default: 1, null: false
151
+ t.integer "required_score", default: 0, null: false
152
+ t.text "email"
153
+ t.text "url"
154
+ t.text "full_name_alternative_transcription"
155
+ t.string "birth_date"
156
+ t.string "death_date"
157
+ t.string "agent_identifier"
158
+ t.integer "profile_id"
159
+ t.index ["agent_identifier"], name: "index_agents_on_agent_identifier"
160
+ t.index ["country_id"], name: "index_agents_on_country_id"
161
+ t.index ["full_name"], name: "index_agents_on_full_name"
162
+ t.index ["language_id"], name: "index_agents_on_language_id"
163
+ t.index ["profile_id"], name: "index_agents_on_profile_id"
164
+ t.index ["required_role_id"], name: "index_agents_on_required_role_id"
165
+ end
168
166
 
169
167
  create_table "baskets", force: :cascade do |t|
170
- t.integer "user_id"
171
- t.text "note"
172
- t.integer "lock_version", default: 0, null: false
168
+ t.integer "user_id"
169
+ t.text "note"
170
+ t.integer "lock_version", default: 0, null: false
173
171
  t.datetime "created_at"
174
172
  t.datetime "updated_at"
173
+ t.index ["user_id"], name: "index_baskets_on_user_id"
175
174
  end
176
175
 
177
- add_index "baskets", ["user_id"], name: "index_baskets_on_user_id"
178
-
179
176
  create_table "bookstores", force: :cascade do |t|
180
- t.text "name", null: false
181
- t.string "zip_code"
182
- t.text "address"
183
- t.text "note"
184
- t.string "telephone_number"
185
- t.string "fax_number"
186
- t.string "url"
187
- t.integer "position"
177
+ t.text "name", null: false
178
+ t.string "zip_code"
179
+ t.text "address"
180
+ t.text "note"
181
+ t.string "telephone_number"
182
+ t.string "fax_number"
183
+ t.string "url"
184
+ t.integer "position"
188
185
  t.datetime "deleted_at"
189
186
  t.datetime "created_at"
190
187
  t.datetime "updated_at"
191
188
  end
192
189
 
193
190
  create_table "budget_types", force: :cascade do |t|
194
- t.string "name"
195
- t.text "display_name"
196
- t.text "note"
197
- t.integer "position"
191
+ t.string "name"
192
+ t.text "display_name"
193
+ t.text "note"
194
+ t.integer "position"
198
195
  t.datetime "created_at"
199
196
  t.datetime "updated_at"
200
197
  end
201
198
 
202
199
  create_table "carrier_type_has_checkout_types", force: :cascade do |t|
203
- t.integer "carrier_type_id", null: false
204
- t.integer "checkout_type_id", null: false
205
- t.text "note"
206
- t.integer "position"
200
+ t.integer "carrier_type_id", null: false
201
+ t.integer "checkout_type_id", null: false
202
+ t.text "note"
203
+ t.integer "position"
207
204
  t.datetime "created_at"
208
205
  t.datetime "updated_at"
206
+ t.index ["carrier_type_id"], name: "index_carrier_type_has_checkout_types_on_m_form_id"
207
+ t.index ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
209
208
  end
210
209
 
211
- add_index "carrier_type_has_checkout_types", ["carrier_type_id"], name: "index_carrier_type_has_checkout_types_on_m_form_id"
212
- add_index "carrier_type_has_checkout_types", ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
213
-
214
210
  create_table "carrier_types", force: :cascade do |t|
215
- t.string "name", null: false
216
- t.text "display_name"
217
- t.text "note"
218
- t.integer "position"
211
+ t.string "name", null: false
212
+ t.text "display_name"
213
+ t.text "note"
214
+ t.integer "position"
219
215
  t.datetime "created_at"
220
216
  t.datetime "updated_at"
217
+ t.string "attachment_file_name"
218
+ t.string "attachment_content_type"
219
+ t.integer "attachment_file_size"
220
+ t.datetime "attachment_updated_at"
221
221
  end
222
222
 
223
223
  create_table "checked_items", force: :cascade do |t|
224
- t.integer "item_id", null: false
225
- t.integer "basket_id", null: false
226
- t.datetime "due_date", null: false
224
+ t.integer "item_id", null: false
225
+ t.integer "basket_id", null: false
226
+ t.datetime "due_date", null: false
227
227
  t.datetime "created_at"
228
228
  t.datetime "updated_at"
229
- t.integer "librarian_id"
229
+ t.integer "librarian_id"
230
+ t.index ["basket_id"], name: "index_checked_items_on_basket_id"
231
+ t.index ["item_id"], name: "index_checked_items_on_item_id"
230
232
  end
231
233
 
232
- add_index "checked_items", ["basket_id"], name: "index_checked_items_on_basket_id"
233
- add_index "checked_items", ["item_id"], name: "index_checked_items_on_item_id"
234
-
235
234
  create_table "checkins", force: :cascade do |t|
236
- t.integer "item_id", null: false
237
- t.integer "librarian_id"
238
- t.integer "basket_id"
235
+ t.integer "item_id", null: false
236
+ t.integer "librarian_id"
237
+ t.integer "basket_id"
239
238
  t.datetime "created_at"
240
239
  t.datetime "updated_at"
241
- t.integer "lock_version", default: 0, null: false
240
+ t.integer "lock_version", default: 0, null: false
241
+ t.index ["basket_id"], name: "index_checkins_on_basket_id"
242
+ t.index ["item_id"], name: "index_checkins_on_item_id"
243
+ t.index ["librarian_id"], name: "index_checkins_on_librarian_id"
242
244
  end
243
245
 
244
- add_index "checkins", ["basket_id"], name: "index_checkins_on_basket_id"
245
- add_index "checkins", ["item_id"], name: "index_checkins_on_item_id"
246
- add_index "checkins", ["librarian_id"], name: "index_checkins_on_librarian_id"
247
-
248
246
  create_table "checkout_stat_has_manifestations", force: :cascade do |t|
249
- t.integer "manifestation_checkout_stat_id", null: false
250
- t.integer "manifestation_id", null: false
251
- t.integer "checkouts_count"
247
+ t.integer "manifestation_checkout_stat_id", null: false
248
+ t.integer "manifestation_id", null: false
249
+ t.integer "checkouts_count"
252
250
  t.datetime "created_at"
253
251
  t.datetime "updated_at"
252
+ t.index ["manifestation_checkout_stat_id"], name: "index_checkout_stat_has_manifestations_on_checkout_stat_id"
253
+ t.index ["manifestation_id"], name: "index_checkout_stat_has_manifestations_on_manifestation_id"
254
254
  end
255
255
 
256
- add_index "checkout_stat_has_manifestations", ["manifestation_checkout_stat_id"], name: "index_checkout_stat_has_manifestations_on_checkout_stat_id"
257
- add_index "checkout_stat_has_manifestations", ["manifestation_id"], name: "index_checkout_stat_has_manifestations_on_manifestation_id"
258
-
259
256
  create_table "checkout_stat_has_users", force: :cascade do |t|
260
- t.integer "user_checkout_stat_id", null: false
261
- t.integer "user_id", null: false
262
- t.integer "checkouts_count", default: 0, null: false
257
+ t.integer "user_checkout_stat_id", null: false
258
+ t.integer "user_id", null: false
259
+ t.integer "checkouts_count", default: 0, null: false
263
260
  t.datetime "created_at"
264
261
  t.datetime "updated_at"
262
+ t.index ["user_checkout_stat_id"], name: "index_checkout_stat_has_users_on_user_checkout_stat_id"
263
+ t.index ["user_id"], name: "index_checkout_stat_has_users_on_user_id"
265
264
  end
266
265
 
267
- add_index "checkout_stat_has_users", ["user_checkout_stat_id"], name: "index_checkout_stat_has_users_on_user_checkout_stat_id"
268
- add_index "checkout_stat_has_users", ["user_id"], name: "index_checkout_stat_has_users_on_user_id"
269
-
270
266
  create_table "checkout_types", force: :cascade do |t|
271
- t.string "name", null: false
272
- t.text "display_name"
273
- t.text "note"
274
- t.integer "position"
267
+ t.string "name", null: false
268
+ t.text "display_name"
269
+ t.text "note"
270
+ t.integer "position"
275
271
  t.datetime "created_at"
276
272
  t.datetime "updated_at"
273
+ t.index ["name"], name: "index_checkout_types_on_name"
277
274
  end
278
275
 
279
- add_index "checkout_types", ["name"], name: "index_checkout_types_on_name"
280
-
281
276
  create_table "checkouts", force: :cascade do |t|
282
- t.integer "user_id"
283
- t.integer "item_id", null: false
284
- t.integer "checkin_id"
285
- t.integer "librarian_id"
286
- t.integer "basket_id"
277
+ t.integer "user_id"
278
+ t.integer "item_id", null: false
279
+ t.integer "checkin_id"
280
+ t.integer "librarian_id"
281
+ t.integer "basket_id"
287
282
  t.datetime "due_date"
288
- t.integer "checkout_renewal_count", default: 0, null: false
289
- t.integer "lock_version", default: 0, null: false
283
+ t.integer "checkout_renewal_count", default: 0, null: false
284
+ t.integer "lock_version", default: 0, null: false
290
285
  t.datetime "created_at"
291
286
  t.datetime "updated_at"
292
- t.integer "shelf_id"
287
+ t.integer "shelf_id"
288
+ t.index ["basket_id"], name: "index_checkouts_on_basket_id"
289
+ t.index ["checkin_id"], name: "index_checkouts_on_checkin_id"
290
+ t.index ["item_id", "basket_id"], name: "index_checkouts_on_item_id_and_basket_id", unique: true
291
+ t.index ["item_id"], name: "index_checkouts_on_item_id"
292
+ t.index ["librarian_id"], name: "index_checkouts_on_librarian_id"
293
+ t.index ["shelf_id"], name: "index_checkouts_on_shelf_id"
294
+ t.index ["user_id"], name: "index_checkouts_on_user_id"
293
295
  end
294
296
 
295
- add_index "checkouts", ["basket_id"], name: "index_checkouts_on_basket_id"
296
- add_index "checkouts", ["checkin_id"], name: "index_checkouts_on_checkin_id"
297
- add_index "checkouts", ["item_id", "basket_id"], name: "index_checkouts_on_item_id_and_basket_id", unique: true
298
- add_index "checkouts", ["item_id"], name: "index_checkouts_on_item_id"
299
- add_index "checkouts", ["librarian_id"], name: "index_checkouts_on_librarian_id"
300
- add_index "checkouts", ["shelf_id"], name: "index_checkouts_on_shelf_id"
301
- add_index "checkouts", ["user_id"], name: "index_checkouts_on_user_id"
302
-
303
297
  create_table "circulation_statuses", force: :cascade do |t|
304
- t.string "name", null: false
305
- t.text "display_name"
306
- t.text "note"
307
- t.integer "position"
298
+ t.string "name", null: false
299
+ t.text "display_name"
300
+ t.text "note"
301
+ t.integer "position"
308
302
  t.datetime "created_at"
309
303
  t.datetime "updated_at"
310
304
  end
311
305
 
312
306
  create_table "classification_types", force: :cascade do |t|
313
- t.string "name", null: false
314
- t.text "display_name"
315
- t.text "note"
316
- t.integer "position"
307
+ t.string "name", null: false
308
+ t.text "display_name"
309
+ t.text "note"
310
+ t.integer "position"
317
311
  t.datetime "created_at"
318
312
  t.datetime "updated_at"
319
313
  end
320
314
 
321
315
  create_table "classifications", force: :cascade do |t|
322
- t.integer "parent_id"
323
- t.string "category", null: false
324
- t.text "note"
325
- t.integer "classification_type_id", null: false
316
+ t.integer "parent_id"
317
+ t.string "category", null: false
318
+ t.text "note"
319
+ t.integer "classification_type_id", null: false
326
320
  t.datetime "created_at"
327
321
  t.datetime "updated_at"
328
- t.integer "lft"
329
- t.integer "rgt"
330
- t.integer "manifestation_id"
322
+ t.integer "lft"
323
+ t.integer "rgt"
324
+ t.integer "manifestation_id"
325
+ t.index ["category"], name: "index_classifications_on_category"
326
+ t.index ["classification_type_id"], name: "index_classifications_on_classification_type_id"
327
+ t.index ["manifestation_id"], name: "index_classifications_on_manifestation_id"
328
+ t.index ["parent_id"], name: "index_classifications_on_parent_id"
331
329
  end
332
330
 
333
- add_index "classifications", ["category"], name: "index_classifications_on_category"
334
- add_index "classifications", ["classification_type_id"], name: "index_classifications_on_classification_type_id"
335
- add_index "classifications", ["manifestation_id"], name: "index_classifications_on_manifestation_id"
336
- add_index "classifications", ["parent_id"], name: "index_classifications_on_parent_id"
337
-
338
331
  create_table "colors", force: :cascade do |t|
339
- t.integer "library_group_id"
340
- t.string "property"
341
- t.string "code"
342
- t.integer "position"
332
+ t.integer "library_group_id"
333
+ t.string "property"
334
+ t.string "code"
335
+ t.integer "position"
343
336
  t.datetime "created_at"
344
337
  t.datetime "updated_at"
338
+ t.index ["library_group_id"], name: "index_colors_on_library_group_id"
345
339
  end
346
340
 
347
- add_index "colors", ["library_group_id"], name: "index_colors_on_library_group_id"
348
-
349
341
  create_table "content_types", force: :cascade do |t|
350
- t.string "name", null: false
351
- t.text "display_name"
352
- t.text "note"
353
- t.integer "position"
342
+ t.string "name", null: false
343
+ t.text "display_name"
344
+ t.text "note"
345
+ t.integer "position"
354
346
  t.datetime "created_at"
355
347
  t.datetime "updated_at"
356
348
  end
357
349
 
358
350
  create_table "countries", force: :cascade do |t|
359
- t.string "name", null: false
360
- t.text "display_name"
361
- t.string "alpha_2"
362
- t.string "alpha_3"
363
- t.string "numeric_3"
364
- t.text "note"
351
+ t.string "name", null: false
352
+ t.text "display_name"
353
+ t.string "alpha_2"
354
+ t.string "alpha_3"
355
+ t.string "numeric_3"
356
+ t.text "note"
365
357
  t.integer "position"
358
+ t.index ["alpha_2"], name: "index_countries_on_alpha_2"
359
+ t.index ["alpha_3"], name: "index_countries_on_alpha_3"
360
+ t.index ["name"], name: "index_countries_on_name"
361
+ t.index ["numeric_3"], name: "index_countries_on_numeric_3"
366
362
  end
367
363
 
368
- add_index "countries", ["alpha_2"], name: "index_countries_on_alpha_2"
369
- add_index "countries", ["alpha_3"], name: "index_countries_on_alpha_3"
370
- add_index "countries", ["name"], name: "index_countries_on_name"
371
- add_index "countries", ["numeric_3"], name: "index_countries_on_numeric_3"
372
-
373
364
  create_table "create_types", force: :cascade do |t|
374
- t.string "name"
375
- t.text "display_name"
376
- t.text "note"
377
- t.integer "position"
365
+ t.string "name"
366
+ t.text "display_name"
367
+ t.text "note"
368
+ t.integer "position"
378
369
  t.datetime "created_at"
379
370
  t.datetime "updated_at"
380
371
  end
381
372
 
382
373
  create_table "creates", force: :cascade do |t|
383
- t.integer "agent_id", null: false
384
- t.integer "work_id", null: false
385
- t.integer "position"
374
+ t.integer "agent_id", null: false
375
+ t.integer "work_id", null: false
376
+ t.integer "position"
386
377
  t.datetime "created_at"
387
378
  t.datetime "updated_at"
388
- t.integer "create_type_id"
379
+ t.integer "create_type_id"
380
+ t.index ["agent_id"], name: "index_creates_on_agent_id"
381
+ t.index ["work_id"], name: "index_creates_on_work_id"
389
382
  end
390
383
 
391
- add_index "creates", ["agent_id"], name: "index_creates_on_agent_id"
392
- add_index "creates", ["work_id"], name: "index_creates_on_work_id"
384
+ create_table "custom_properties", force: :cascade do |t|
385
+ t.integer "resource_id", null: false
386
+ t.string "resource_type", null: false
387
+ t.text "label", null: false
388
+ t.text "value"
389
+ t.datetime "created_at", null: false
390
+ t.datetime "updated_at", null: false
391
+ end
393
392
 
394
393
  create_table "donates", force: :cascade do |t|
395
- t.integer "agent_id", null: false
396
- t.integer "item_id", null: false
394
+ t.integer "agent_id", null: false
395
+ t.integer "item_id", null: false
397
396
  t.datetime "created_at"
398
397
  t.datetime "updated_at"
398
+ t.index ["agent_id"], name: "index_donates_on_agent_id"
399
+ t.index ["item_id"], name: "index_donates_on_item_id"
399
400
  end
400
401
 
401
- add_index "donates", ["agent_id"], name: "index_donates_on_agent_id"
402
- add_index "donates", ["item_id"], name: "index_donates_on_item_id"
403
-
404
402
  create_table "event_categories", force: :cascade do |t|
405
- t.string "name", null: false
406
- t.text "display_name"
407
- t.text "note"
408
- t.integer "position"
403
+ t.string "name", null: false
404
+ t.text "display_name"
405
+ t.text "note"
406
+ t.integer "position"
409
407
  t.datetime "created_at"
410
408
  t.datetime "updated_at"
411
409
  end
412
410
 
413
411
  create_table "event_export_file_transitions", force: :cascade do |t|
414
- t.string "to_state"
415
- t.text "metadata", default: "{}"
416
- t.integer "sort_key"
417
- t.integer "event_export_file_id"
412
+ t.string "to_state"
413
+ t.text "metadata", default: "{}"
414
+ t.integer "sort_key"
415
+ t.integer "event_export_file_id"
418
416
  t.datetime "created_at"
419
417
  t.datetime "updated_at"
418
+ t.index ["event_export_file_id"], name: "index_event_export_file_transitions_on_file_id"
419
+ t.index ["sort_key", "event_export_file_id"], name: "index_event_export_file_transitions_on_sort_key_and_file_id", unique: true
420
420
  end
421
421
 
422
- add_index "event_export_file_transitions", ["event_export_file_id"], name: "index_event_export_file_transitions_on_file_id"
423
- add_index "event_export_file_transitions", ["sort_key", "event_export_file_id"], name: "index_event_export_file_transitions_on_sort_key_and_file_id", unique: true
424
-
425
422
  create_table "event_export_files", force: :cascade do |t|
426
- t.integer "user_id"
427
- t.string "event_export_file_name"
428
- t.string "event_export_content_type"
429
- t.integer "event_export_file_size"
423
+ t.integer "user_id"
424
+ t.string "event_export_file_name"
425
+ t.string "event_export_content_type"
426
+ t.integer "event_export_file_size"
430
427
  t.datetime "event_export_updated_at"
431
428
  t.datetime "executed_at"
432
429
  t.datetime "created_at"
@@ -434,644 +431,737 @@ ActiveRecord::Schema.define(version: 20160813130535) do
434
431
  end
435
432
 
436
433
  create_table "event_import_file_transitions", force: :cascade do |t|
437
- t.string "to_state"
438
- t.text "metadata", default: "{}"
439
- t.integer "sort_key"
440
- t.integer "event_import_file_id"
434
+ t.string "to_state"
435
+ t.text "metadata", default: "{}"
436
+ t.integer "sort_key"
437
+ t.integer "event_import_file_id"
441
438
  t.datetime "created_at"
442
439
  t.datetime "updated_at"
440
+ t.index ["event_import_file_id"], name: "index_event_import_file_transitions_on_event_import_file_id"
441
+ t.index ["sort_key", "event_import_file_id"], name: "index_event_import_file_transitions_on_sort_key_and_file_id", unique: true
443
442
  end
444
443
 
445
- add_index "event_import_file_transitions", ["event_import_file_id"], name: "index_event_import_file_transitions_on_event_import_file_id"
446
- add_index "event_import_file_transitions", ["sort_key", "event_import_file_id"], name: "index_event_import_file_transitions_on_sort_key_and_file_id", unique: true
447
-
448
444
  create_table "event_import_files", force: :cascade do |t|
449
- t.integer "parent_id"
450
- t.string "content_type"
451
- t.integer "size"
452
- t.integer "user_id"
453
- t.text "note"
445
+ t.integer "parent_id"
446
+ t.string "content_type"
447
+ t.integer "size"
448
+ t.integer "user_id"
449
+ t.text "note"
454
450
  t.datetime "executed_at"
455
- t.string "event_import_file_name"
456
- t.string "event_import_content_type"
457
- t.integer "event_import_file_size"
451
+ t.string "event_import_file_name"
452
+ t.string "event_import_content_type"
453
+ t.integer "event_import_file_size"
458
454
  t.datetime "event_import_updated_at"
459
- t.string "edit_mode"
455
+ t.string "edit_mode"
460
456
  t.datetime "created_at"
461
457
  t.datetime "updated_at"
462
- t.string "event_import_fingerprint"
463
- t.text "error_message"
464
- t.string "user_encoding"
465
- t.integer "default_library_id"
466
- t.integer "default_event_category_id"
458
+ t.string "event_import_fingerprint"
459
+ t.text "error_message"
460
+ t.string "user_encoding"
461
+ t.integer "default_library_id"
462
+ t.integer "default_event_category_id"
463
+ t.index ["parent_id"], name: "index_event_import_files_on_parent_id"
464
+ t.index ["user_id"], name: "index_event_import_files_on_user_id"
467
465
  end
468
466
 
469
- add_index "event_import_files", ["parent_id"], name: "index_event_import_files_on_parent_id"
470
- add_index "event_import_files", ["user_id"], name: "index_event_import_files_on_user_id"
471
-
472
467
  create_table "event_import_results", force: :cascade do |t|
473
- t.integer "event_import_file_id"
474
- t.integer "event_id"
475
- t.text "body"
468
+ t.integer "event_import_file_id"
469
+ t.integer "event_id"
470
+ t.text "body"
476
471
  t.datetime "created_at"
477
472
  t.datetime "updated_at"
478
473
  end
479
474
 
480
475
  create_table "events", force: :cascade do |t|
481
- t.integer "library_id", null: false
482
- t.integer "event_category_id", null: false
483
- t.string "name"
484
- t.text "note"
476
+ t.integer "library_id", null: false
477
+ t.integer "event_category_id", null: false
478
+ t.string "name"
479
+ t.text "note"
485
480
  t.datetime "start_at"
486
481
  t.datetime "end_at"
487
- t.boolean "all_day", default: false, null: false
482
+ t.boolean "all_day", default: false, null: false
488
483
  t.datetime "deleted_at"
489
- t.text "display_name"
484
+ t.text "display_name"
490
485
  t.datetime "created_at"
491
486
  t.datetime "updated_at"
487
+ t.index ["event_category_id"], name: "index_events_on_event_category_id"
488
+ t.index ["library_id"], name: "index_events_on_library_id"
492
489
  end
493
490
 
494
- add_index "events", ["event_category_id"], name: "index_events_on_event_category_id"
495
- add_index "events", ["library_id"], name: "index_events_on_library_id"
496
-
497
491
  create_table "exemplifies", force: :cascade do |t|
498
- t.integer "manifestation_id", null: false
499
- t.integer "item_id", null: false
500
- t.integer "position"
492
+ t.integer "manifestation_id", null: false
493
+ t.integer "item_id", null: false
494
+ t.integer "position"
501
495
  t.datetime "created_at"
502
496
  t.datetime "updated_at"
497
+ t.index ["item_id"], name: "index_exemplifies_on_item_id", unique: true
498
+ t.index ["manifestation_id"], name: "index_exemplifies_on_manifestation_id"
503
499
  end
504
500
 
505
- add_index "exemplifies", ["item_id"], name: "index_exemplifies_on_item_id", unique: true
506
- add_index "exemplifies", ["manifestation_id"], name: "index_exemplifies_on_manifestation_id"
507
-
508
501
  create_table "form_of_works", force: :cascade do |t|
509
- t.string "name", null: false
510
- t.text "display_name"
511
- t.text "note"
512
- t.integer "position"
502
+ t.string "name", null: false
503
+ t.text "display_name"
504
+ t.text "note"
505
+ t.integer "position"
513
506
  t.datetime "created_at"
514
507
  t.datetime "updated_at"
515
508
  end
516
509
 
517
510
  create_table "frequencies", force: :cascade do |t|
518
- t.string "name", null: false
519
- t.text "display_name"
520
- t.text "note"
521
- t.integer "position"
511
+ t.string "name", null: false
512
+ t.text "display_name"
513
+ t.text "note"
514
+ t.integer "position"
522
515
  t.datetime "created_at"
523
516
  t.datetime "updated_at"
524
517
  end
525
518
 
526
519
  create_table "identifier_types", force: :cascade do |t|
527
- t.string "name"
528
- t.text "display_name"
529
- t.text "note"
530
- t.integer "position"
520
+ t.string "name"
521
+ t.text "display_name"
522
+ t.text "note"
523
+ t.integer "position"
531
524
  t.datetime "created_at"
532
525
  t.datetime "updated_at"
533
526
  end
534
527
 
535
528
  create_table "identifiers", force: :cascade do |t|
536
- t.string "body", null: false
537
- t.integer "identifier_type_id", null: false
538
- t.integer "manifestation_id"
539
- t.boolean "primary"
540
- t.integer "position"
529
+ t.string "body", null: false
530
+ t.integer "identifier_type_id", null: false
531
+ t.integer "manifestation_id"
532
+ t.boolean "primary"
533
+ t.integer "position"
541
534
  t.datetime "created_at"
542
535
  t.datetime "updated_at"
536
+ t.index ["body", "identifier_type_id"], name: "index_identifiers_on_body_and_identifier_type_id"
537
+ t.index ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
543
538
  end
544
539
 
545
- add_index "identifiers", ["body", "identifier_type_id"], name: "index_identifiers_on_body_and_identifier_type_id"
546
- add_index "identifiers", ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
547
-
548
540
  create_table "import_request_transitions", force: :cascade do |t|
549
- t.string "to_state"
550
- t.text "metadata", default: "{}"
551
- t.integer "sort_key"
552
- t.integer "import_request_id"
541
+ t.string "to_state"
542
+ t.text "metadata", default: "{}"
543
+ t.integer "sort_key"
544
+ t.integer "import_request_id"
553
545
  t.datetime "created_at"
554
546
  t.datetime "updated_at"
547
+ t.boolean "most_recent", null: false
548
+ t.index ["import_request_id", "most_recent"], name: "index_import_request_transitions_parent_most_recent", unique: true, where: "most_recent"
549
+ t.index ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
550
+ t.index ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
555
551
  end
556
552
 
557
- add_index "import_request_transitions", ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
558
- add_index "import_request_transitions", ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
559
-
560
553
  create_table "import_requests", force: :cascade do |t|
561
- t.string "isbn"
562
- t.integer "manifestation_id"
563
- t.integer "user_id"
554
+ t.string "isbn"
555
+ t.integer "manifestation_id"
556
+ t.integer "user_id"
564
557
  t.datetime "created_at"
565
558
  t.datetime "updated_at"
559
+ t.index ["isbn"], name: "index_import_requests_on_isbn"
560
+ t.index ["manifestation_id"], name: "index_import_requests_on_manifestation_id"
561
+ t.index ["user_id"], name: "index_import_requests_on_user_id"
566
562
  end
567
563
 
568
- add_index "import_requests", ["isbn"], name: "index_import_requests_on_isbn"
569
- add_index "import_requests", ["manifestation_id"], name: "index_import_requests_on_manifestation_id"
570
- add_index "import_requests", ["user_id"], name: "index_import_requests_on_user_id"
564
+ create_table "item_custom_properties", force: :cascade do |t|
565
+ t.string "name", null: false
566
+ t.text "display_name", null: false
567
+ t.text "note"
568
+ t.integer "position", default: 1, null: false
569
+ t.datetime "created_at", null: false
570
+ t.datetime "updated_at", null: false
571
+ t.index ["name"], name: "index_item_custom_properties_on_name", unique: true
572
+ end
573
+
574
+ create_table "item_custom_values", force: :cascade do |t|
575
+ t.integer "item_custom_property_id", null: false
576
+ t.integer "item_id", null: false
577
+ t.text "value"
578
+ t.datetime "created_at", null: false
579
+ t.datetime "updated_at", null: false
580
+ t.index ["item_custom_property_id", "item_id"], name: "index_item_custom_values_on_custom_item_property_and_item_id", unique: true
581
+ t.index ["item_custom_property_id"], name: "index_item_custom_values_on_custom_property_id"
582
+ t.index ["item_id"], name: "index_item_custom_values_on_item_id"
583
+ end
571
584
 
572
585
  create_table "item_has_use_restrictions", force: :cascade do |t|
573
- t.integer "item_id", null: false
574
- t.integer "use_restriction_id", null: false
586
+ t.integer "item_id", null: false
587
+ t.integer "use_restriction_id", null: false
575
588
  t.datetime "created_at"
576
589
  t.datetime "updated_at"
590
+ t.index ["item_id"], name: "index_item_has_use_restrictions_on_item_id"
591
+ t.index ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
577
592
  end
578
593
 
579
- add_index "item_has_use_restrictions", ["item_id"], name: "index_item_has_use_restrictions_on_item_id"
580
- add_index "item_has_use_restrictions", ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
581
-
582
594
  create_table "items", force: :cascade do |t|
583
- t.string "call_number"
584
- t.string "item_identifier"
595
+ t.string "call_number"
596
+ t.string "item_identifier"
585
597
  t.datetime "created_at"
586
598
  t.datetime "updated_at"
587
599
  t.datetime "deleted_at"
588
- t.integer "shelf_id", default: 1, null: false
589
- t.boolean "include_supplements", default: false, null: false
590
- t.text "note"
591
- t.string "url"
592
- t.integer "price"
593
- t.integer "lock_version", default: 0, null: false
594
- t.integer "required_role_id", default: 1, null: false
595
- t.integer "required_score", default: 0, null: false
600
+ t.integer "shelf_id", default: 1, null: false
601
+ t.boolean "include_supplements", default: false, null: false
602
+ t.text "note"
603
+ t.string "url"
604
+ t.integer "price"
605
+ t.integer "lock_version", default: 0, null: false
606
+ t.integer "required_role_id", default: 1, null: false
607
+ t.integer "required_score", default: 0, null: false
596
608
  t.datetime "acquired_at"
597
- t.integer "bookstore_id"
598
- t.integer "budget_type_id"
599
- t.integer "circulation_status_id", default: 5, null: false
600
- t.integer "checkout_type_id", default: 1, null: false
601
- t.string "binding_item_identifier"
602
- t.string "binding_call_number"
609
+ t.integer "bookstore_id"
610
+ t.integer "budget_type_id"
611
+ t.integer "circulation_status_id", default: 5, null: false
612
+ t.integer "checkout_type_id", default: 1, null: false
613
+ t.string "binding_item_identifier"
614
+ t.string "binding_call_number"
603
615
  t.datetime "binded_at"
604
- t.integer "manifestation_id"
616
+ t.integer "manifestation_id", null: false
617
+ t.text "memo"
618
+ t.index ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
619
+ t.index ["bookstore_id"], name: "index_items_on_bookstore_id"
620
+ t.index ["checkout_type_id"], name: "index_items_on_checkout_type_id"
621
+ t.index ["circulation_status_id"], name: "index_items_on_circulation_status_id"
622
+ t.index ["item_identifier"], name: "index_items_on_item_identifier"
623
+ t.index ["manifestation_id"], name: "index_items_on_manifestation_id"
624
+ t.index ["required_role_id"], name: "index_items_on_required_role_id"
625
+ t.index ["shelf_id"], name: "index_items_on_shelf_id"
605
626
  end
606
627
 
607
- add_index "items", ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
608
- add_index "items", ["bookstore_id"], name: "index_items_on_bookstore_id"
609
- add_index "items", ["checkout_type_id"], name: "index_items_on_checkout_type_id"
610
- add_index "items", ["circulation_status_id"], name: "index_items_on_circulation_status_id"
611
- add_index "items", ["item_identifier"], name: "index_items_on_item_identifier"
612
- add_index "items", ["manifestation_id"], name: "index_items_on_manifestation_id"
613
- add_index "items", ["required_role_id"], name: "index_items_on_required_role_id"
614
- add_index "items", ["shelf_id"], name: "index_items_on_shelf_id"
615
-
616
628
  create_table "languages", force: :cascade do |t|
617
- t.string "name", null: false
618
- t.string "native_name"
619
- t.text "display_name"
620
- t.string "iso_639_1"
621
- t.string "iso_639_2"
622
- t.string "iso_639_3"
623
- t.text "note"
629
+ t.string "name", null: false
630
+ t.string "native_name"
631
+ t.text "display_name"
632
+ t.string "iso_639_1"
633
+ t.string "iso_639_2"
634
+ t.string "iso_639_3"
635
+ t.text "note"
624
636
  t.integer "position"
637
+ t.index ["iso_639_1"], name: "index_languages_on_iso_639_1"
638
+ t.index ["iso_639_2"], name: "index_languages_on_iso_639_2"
639
+ t.index ["iso_639_3"], name: "index_languages_on_iso_639_3"
640
+ t.index ["name"], name: "index_languages_on_name", unique: true
625
641
  end
626
642
 
627
- add_index "languages", ["iso_639_1"], name: "index_languages_on_iso_639_1"
628
- add_index "languages", ["iso_639_2"], name: "index_languages_on_iso_639_2"
629
- add_index "languages", ["iso_639_3"], name: "index_languages_on_iso_639_3"
630
- add_index "languages", ["name"], name: "index_languages_on_name", unique: true
631
-
632
643
  create_table "lending_policies", force: :cascade do |t|
633
- t.integer "item_id", null: false
634
- t.integer "user_group_id", null: false
635
- t.integer "loan_period", default: 0, null: false
644
+ t.integer "item_id", null: false
645
+ t.integer "user_group_id", null: false
646
+ t.integer "loan_period", default: 0, null: false
636
647
  t.datetime "fixed_due_date"
637
- t.integer "renewal", default: 0, null: false
638
- t.integer "fine", default: 0, null: false
639
- t.text "note"
640
- t.integer "position"
648
+ t.integer "renewal", default: 0, null: false
649
+ t.integer "fine", default: 0, null: false
650
+ t.text "note"
651
+ t.integer "position"
641
652
  t.datetime "created_at"
642
653
  t.datetime "updated_at"
654
+ t.index ["item_id", "user_group_id"], name: "index_lending_policies_on_item_id_and_user_group_id", unique: true
643
655
  end
644
656
 
645
- add_index "lending_policies", ["item_id", "user_group_id"], name: "index_lending_policies_on_item_id_and_user_group_id", unique: true
646
-
647
657
  create_table "libraries", force: :cascade do |t|
648
- t.string "name", null: false
649
- t.text "display_name"
650
- t.string "short_display_name", null: false
651
- t.string "zip_code"
652
- t.text "street"
653
- t.text "locality"
654
- t.text "region"
655
- t.string "telephone_number_1"
656
- t.string "telephone_number_2"
657
- t.string "fax_number"
658
- t.text "note"
659
- t.integer "call_number_rows", default: 1, null: false
660
- t.string "call_number_delimiter", default: "|", null: false
661
- t.integer "library_group_id", default: 1, null: false
662
- t.integer "users_count", default: 0, null: false
663
- t.integer "position"
664
- t.integer "country_id"
658
+ t.string "name", null: false
659
+ t.text "display_name"
660
+ t.string "short_display_name", null: false
661
+ t.string "zip_code"
662
+ t.text "street"
663
+ t.text "locality"
664
+ t.text "region"
665
+ t.string "telephone_number_1"
666
+ t.string "telephone_number_2"
667
+ t.string "fax_number"
668
+ t.text "note"
669
+ t.integer "call_number_rows", default: 1, null: false
670
+ t.string "call_number_delimiter", default: "|", null: false
671
+ t.integer "library_group_id", null: false
672
+ t.integer "users_count", default: 0, null: false
673
+ t.integer "position"
674
+ t.integer "country_id"
665
675
  t.datetime "created_at"
666
676
  t.datetime "updated_at"
667
677
  t.datetime "deleted_at"
668
- t.text "opening_hour"
669
- t.string "isil"
670
- t.float "latitude"
671
- t.float "longitude"
678
+ t.text "opening_hour"
679
+ t.string "isil"
680
+ t.float "latitude"
681
+ t.float "longitude"
682
+ t.index ["library_group_id"], name: "index_libraries_on_library_group_id"
683
+ t.index ["name"], name: "index_libraries_on_name"
672
684
  end
673
685
 
674
- add_index "libraries", ["library_group_id"], name: "index_libraries_on_library_group_id"
675
- add_index "libraries", ["name"], name: "index_libraries_on_name", unique: true
676
-
677
686
  create_table "library_group_translations", force: :cascade do |t|
678
- t.integer "library_group_id", null: false
679
- t.string "locale", null: false
680
- t.datetime "created_at", null: false
681
- t.datetime "updated_at", null: false
682
- t.text "login_banner"
683
- t.text "footer_banner"
687
+ t.integer "library_group_id", null: false
688
+ t.string "locale", null: false
689
+ t.datetime "created_at", null: false
690
+ t.datetime "updated_at", null: false
691
+ t.text "login_banner"
692
+ t.text "footer_banner"
693
+ t.index ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
694
+ t.index ["locale"], name: "index_library_group_translations_on_locale"
684
695
  end
685
696
 
686
- add_index "library_group_translations", ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
687
- add_index "library_group_translations", ["locale"], name: "index_library_group_translations_on_locale"
688
-
689
697
  create_table "library_groups", force: :cascade do |t|
690
- t.string "name", null: false
691
- t.text "display_name"
692
- t.string "short_name", null: false
693
- t.text "my_networks"
694
- t.text "login_banner"
695
- t.text "note"
696
- t.integer "country_id"
697
- t.integer "position"
698
+ t.string "name", null: false
699
+ t.text "display_name"
700
+ t.string "short_name", null: false
701
+ t.text "my_networks"
702
+ t.text "old_login_banner"
703
+ t.text "note"
704
+ t.integer "country_id"
705
+ t.integer "position"
698
706
  t.datetime "created_at"
699
707
  t.datetime "updated_at"
700
- t.text "admin_networks"
701
- t.string "url", default: "http://localhost:3000/"
702
- t.text "settings"
703
- t.text "html_snippet"
704
- t.string "email"
708
+ t.text "admin_networks"
709
+ t.string "url", default: "http://localhost:3000/"
710
+ t.text "settings"
711
+ t.text "html_snippet"
712
+ t.integer "max_number_of_results", default: 500
713
+ t.boolean "family_name_first", default: true
714
+ t.integer "pub_year_facet_range_interval", default: 10
715
+ t.integer "user_id"
716
+ t.boolean "csv_charset_conversion", default: false, null: false
717
+ t.string "header_logo_file_name"
718
+ t.string "header_logo_content_type"
719
+ t.integer "header_logo_file_size"
720
+ t.datetime "header_logo_updated_at"
721
+ t.text "header_logo_meta"
722
+ t.index ["short_name"], name: "index_library_groups_on_short_name"
723
+ t.index ["user_id"], name: "index_library_groups_on_user_id"
705
724
  end
706
725
 
707
- add_index "library_groups", ["short_name"], name: "index_library_groups_on_short_name"
708
-
709
726
  create_table "licenses", force: :cascade do |t|
710
- t.string "name", null: false
711
- t.string "display_name"
712
- t.text "note"
713
- t.integer "position"
727
+ t.string "name", null: false
728
+ t.string "display_name"
729
+ t.text "note"
730
+ t.integer "position"
714
731
  t.datetime "created_at"
715
732
  t.datetime "updated_at"
716
733
  end
717
734
 
718
735
  create_table "manifestation_checkout_stat_transitions", force: :cascade do |t|
719
- t.string "to_state"
720
- t.text "metadata", default: "{}"
721
- t.integer "sort_key"
722
- t.integer "manifestation_checkout_stat_id"
736
+ t.string "to_state"
737
+ t.text "metadata", default: "{}"
738
+ t.integer "sort_key"
739
+ t.integer "manifestation_checkout_stat_id"
723
740
  t.datetime "created_at"
724
741
  t.datetime "updated_at"
742
+ t.index ["manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_stat_id"
743
+ t.index ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
725
744
  end
726
745
 
727
- add_index "manifestation_checkout_stat_transitions", ["manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_stat_id"
728
- add_index "manifestation_checkout_stat_transitions", ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
729
-
730
746
  create_table "manifestation_checkout_stats", force: :cascade do |t|
731
747
  t.datetime "start_date"
732
748
  t.datetime "end_date"
733
- t.text "note"
749
+ t.text "note"
734
750
  t.datetime "created_at"
735
751
  t.datetime "updated_at"
736
752
  t.datetime "started_at"
737
753
  t.datetime "completed_at"
738
- t.integer "user_id"
754
+ t.integer "user_id"
755
+ t.index ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
756
+ end
757
+
758
+ create_table "manifestation_custom_properties", force: :cascade do |t|
759
+ t.string "name", null: false
760
+ t.text "display_name", null: false
761
+ t.text "note"
762
+ t.integer "position", default: 1, null: false
763
+ t.datetime "created_at", null: false
764
+ t.datetime "updated_at", null: false
765
+ t.index ["name"], name: "index_manifestation_custom_properties_on_name", unique: true
739
766
  end
740
767
 
741
- add_index "manifestation_checkout_stats", ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
768
+ create_table "manifestation_custom_values", force: :cascade do |t|
769
+ t.integer "manifestation_custom_property_id", null: false
770
+ t.integer "manifestation_id", null: false
771
+ t.text "value"
772
+ t.datetime "created_at", null: false
773
+ t.datetime "updated_at", null: false
774
+ t.index ["manifestation_custom_property_id", "manifestation_id"], name: "index_manifestation_custom_values_on_property_manifestation", unique: true
775
+ t.index ["manifestation_custom_property_id"], name: "index_manifestation_custom_values_on_custom_property_id"
776
+ t.index ["manifestation_id"], name: "index_manifestation_custom_values_on_manifestation_id"
777
+ end
742
778
 
743
779
  create_table "manifestation_relationship_types", force: :cascade do |t|
744
- t.string "name", null: false
745
- t.text "display_name"
746
- t.text "note"
747
- t.integer "position"
780
+ t.string "name", null: false
781
+ t.text "display_name"
782
+ t.text "note"
783
+ t.integer "position"
748
784
  t.datetime "created_at"
749
785
  t.datetime "updated_at"
750
786
  end
751
787
 
752
788
  create_table "manifestation_relationships", force: :cascade do |t|
753
- t.integer "parent_id"
754
- t.integer "child_id"
755
- t.integer "manifestation_relationship_type_id"
789
+ t.integer "parent_id"
790
+ t.integer "child_id"
791
+ t.integer "manifestation_relationship_type_id"
756
792
  t.datetime "created_at"
757
793
  t.datetime "updated_at"
758
- t.integer "position"
794
+ t.integer "position"
795
+ t.index ["child_id"], name: "index_manifestation_relationships_on_child_id"
796
+ t.index ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
759
797
  end
760
798
 
761
- add_index "manifestation_relationships", ["child_id"], name: "index_manifestation_relationships_on_child_id"
762
- add_index "manifestation_relationships", ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
763
-
764
799
  create_table "manifestation_reserve_stat_transitions", force: :cascade do |t|
765
- t.string "to_state"
766
- t.text "metadata", default: "{}"
767
- t.integer "sort_key"
768
- t.integer "manifestation_reserve_stat_id"
800
+ t.string "to_state"
801
+ t.text "metadata", default: "{}"
802
+ t.integer "sort_key"
803
+ t.integer "manifestation_reserve_stat_id"
769
804
  t.datetime "created_at"
770
805
  t.datetime "updated_at"
806
+ t.index ["manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_stat_id"
807
+ t.index ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
771
808
  end
772
809
 
773
- add_index "manifestation_reserve_stat_transitions", ["manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_stat_id"
774
- add_index "manifestation_reserve_stat_transitions", ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
775
-
776
810
  create_table "manifestation_reserve_stats", force: :cascade do |t|
777
811
  t.datetime "start_date"
778
812
  t.datetime "end_date"
779
- t.text "note"
813
+ t.text "note"
780
814
  t.datetime "created_at"
781
815
  t.datetime "updated_at"
782
816
  t.datetime "started_at"
783
817
  t.datetime "completed_at"
784
- t.integer "user_id"
818
+ t.integer "user_id"
819
+ t.index ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
785
820
  end
786
821
 
787
- add_index "manifestation_reserve_stats", ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
788
-
789
822
  create_table "manifestations", force: :cascade do |t|
790
- t.text "original_title", null: false
791
- t.text "title_alternative"
792
- t.text "title_transcription"
793
- t.string "classification_number"
794
- t.string "manifestation_identifier"
823
+ t.text "original_title", null: false
824
+ t.text "title_alternative"
825
+ t.text "title_transcription"
826
+ t.string "classification_number"
827
+ t.string "manifestation_identifier"
795
828
  t.datetime "date_of_publication"
796
829
  t.datetime "date_copyrighted"
797
830
  t.datetime "created_at"
798
831
  t.datetime "updated_at"
799
832
  t.datetime "deleted_at"
800
- t.string "access_address"
801
- t.integer "language_id", default: 1, null: false
802
- t.integer "carrier_type_id", default: 1, null: false
803
- t.integer "start_page"
804
- t.integer "end_page"
805
- t.integer "height"
806
- t.integer "width"
807
- t.integer "depth"
808
- t.integer "price"
809
- t.text "fulltext"
810
- t.string "volume_number_string"
811
- t.string "issue_number_string"
812
- t.string "serial_number_string"
813
- t.integer "edition"
814
- t.text "note"
815
- t.boolean "repository_content", default: false, null: false
816
- t.integer "lock_version", default: 0, null: false
817
- t.integer "required_role_id", default: 1, null: false
818
- t.integer "required_score", default: 0, null: false
819
- t.integer "frequency_id", default: 1, null: false
820
- t.boolean "subscription_master", default: false, null: false
821
- t.string "attachment_file_name"
822
- t.string "attachment_content_type"
823
- t.integer "attachment_file_size"
833
+ t.string "access_address"
834
+ t.integer "language_id", default: 1, null: false
835
+ t.integer "carrier_type_id", default: 1, null: false
836
+ t.integer "start_page"
837
+ t.integer "end_page"
838
+ t.integer "height"
839
+ t.integer "width"
840
+ t.integer "depth"
841
+ t.integer "price"
842
+ t.text "fulltext"
843
+ t.string "volume_number_string"
844
+ t.string "issue_number_string"
845
+ t.string "serial_number_string"
846
+ t.integer "edition"
847
+ t.text "note"
848
+ t.boolean "repository_content", default: false, null: false
849
+ t.integer "lock_version", default: 0, null: false
850
+ t.integer "required_role_id", default: 1, null: false
851
+ t.integer "required_score", default: 0, null: false
852
+ t.integer "frequency_id", default: 1, null: false
853
+ t.boolean "subscription_master", default: false, null: false
854
+ t.string "attachment_file_name"
855
+ t.string "attachment_content_type"
856
+ t.integer "attachment_file_size"
824
857
  t.datetime "attachment_updated_at"
825
- t.integer "nii_type_id"
826
- t.text "title_alternative_transcription"
827
- t.text "description"
828
- t.text "abstract"
858
+ t.integer "nii_type_id"
859
+ t.text "title_alternative_transcription"
860
+ t.text "description"
861
+ t.text "abstract"
829
862
  t.datetime "available_at"
830
863
  t.datetime "valid_until"
831
864
  t.datetime "date_submitted"
832
865
  t.datetime "date_accepted"
833
- t.datetime "date_caputured"
834
- t.string "pub_date"
835
- t.string "edition_string"
836
- t.integer "volume_number"
837
- t.integer "issue_number"
838
- t.integer "serial_number"
839
- t.integer "content_type_id", default: 1
840
- t.integer "year_of_publication"
841
- t.text "attachment_meta"
842
- t.integer "month_of_publication"
843
- t.boolean "fulltext_content"
844
- t.boolean "serial"
845
- t.text "statement_of_responsibility"
846
- t.text "publication_place"
847
- t.text "extent"
848
- t.text "dimensions"
849
- end
850
-
851
- add_index "manifestations", ["access_address"], name: "index_manifestations_on_access_address"
852
- add_index "manifestations", ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
853
- add_index "manifestations", ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier"
854
- add_index "manifestations", ["nii_type_id"], name: "index_manifestations_on_nii_type_id"
855
- add_index "manifestations", ["updated_at"], name: "index_manifestations_on_updated_at"
866
+ t.datetime "date_captured"
867
+ t.string "pub_date"
868
+ t.string "edition_string"
869
+ t.integer "volume_number"
870
+ t.integer "issue_number"
871
+ t.integer "serial_number"
872
+ t.integer "content_type_id", default: 1
873
+ t.integer "year_of_publication"
874
+ t.text "attachment_meta"
875
+ t.integer "month_of_publication"
876
+ t.boolean "fulltext_content"
877
+ t.boolean "serial"
878
+ t.text "statement_of_responsibility"
879
+ t.text "publication_place"
880
+ t.text "extent"
881
+ t.text "dimensions"
882
+ t.text "memo"
883
+ t.index ["access_address"], name: "index_manifestations_on_access_address"
884
+ t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
885
+ t.index ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier"
886
+ t.index ["nii_type_id"], name: "index_manifestations_on_nii_type_id"
887
+ t.index ["updated_at"], name: "index_manifestations_on_updated_at"
888
+ end
856
889
 
857
890
  create_table "medium_of_performances", force: :cascade do |t|
858
- t.string "name", null: false
859
- t.text "display_name"
860
- t.text "note"
861
- t.integer "position"
891
+ t.string "name", null: false
892
+ t.text "display_name"
893
+ t.text "note"
894
+ t.integer "position"
862
895
  t.datetime "created_at"
863
896
  t.datetime "updated_at"
864
897
  end
865
898
 
866
- create_table "nii_types", force: :cascade do |t|
867
- t.string "name", null: false
868
- t.text "display_name"
869
- t.text "note"
870
- t.integer "position"
899
+ create_table "message_request_transitions", force: :cascade do |t|
900
+ t.string "to_state"
901
+ t.text "metadata", default: "{}"
902
+ t.integer "sort_key"
903
+ t.integer "message_request_id"
871
904
  t.datetime "created_at"
872
905
  t.datetime "updated_at"
906
+ t.boolean "most_recent"
907
+ t.index ["message_request_id"], name: "index_message_request_transitions_on_message_request_id"
908
+ t.index ["sort_key", "message_request_id"], name: "index_message_request_transitions_on_sort_key_and_request_id", unique: true
873
909
  end
874
910
 
875
- add_index "nii_types", ["name"], name: "index_nii_types_on_name", unique: true
911
+ create_table "message_requests", force: :cascade do |t|
912
+ t.integer "sender_id"
913
+ t.integer "receiver_id"
914
+ t.integer "message_template_id"
915
+ t.datetime "sent_at"
916
+ t.datetime "deleted_at"
917
+ t.text "body"
918
+ t.datetime "created_at"
919
+ t.datetime "updated_at"
920
+ end
876
921
 
877
- create_table "owns", force: :cascade do |t|
878
- t.integer "agent_id", null: false
879
- t.integer "item_id", null: false
880
- t.integer "position"
922
+ create_table "message_templates", force: :cascade do |t|
923
+ t.string "status", null: false
924
+ t.text "title", null: false
925
+ t.text "body", null: false
926
+ t.integer "position"
927
+ t.string "locale", default: "en"
881
928
  t.datetime "created_at"
882
929
  t.datetime "updated_at"
930
+ t.index ["status"], name: "index_message_templates_on_status", unique: true
883
931
  end
884
932
 
885
- add_index "owns", ["agent_id"], name: "index_owns_on_agent_id"
886
- add_index "owns", ["item_id"], name: "index_owns_on_item_id"
933
+ create_table "message_transitions", force: :cascade do |t|
934
+ t.string "to_state"
935
+ t.text "metadata", default: "{}"
936
+ t.integer "sort_key"
937
+ t.integer "message_id"
938
+ t.datetime "created_at"
939
+ t.datetime "updated_at"
940
+ t.boolean "most_recent"
941
+ t.index ["message_id"], name: "index_message_transitions_on_message_id"
942
+ t.index ["sort_key", "message_id"], name: "index_message_transitions_on_sort_key_and_message_id", unique: true
943
+ end
887
944
 
888
- create_table "participates", force: :cascade do |t|
889
- t.integer "agent_id", null: false
890
- t.integer "event_id", null: false
891
- t.integer "position"
945
+ create_table "messages", force: :cascade do |t|
946
+ t.datetime "read_at"
947
+ t.integer "receiver_id"
948
+ t.integer "sender_id"
949
+ t.string "subject", null: false
950
+ t.text "body"
951
+ t.integer "message_request_id"
952
+ t.integer "parent_id"
892
953
  t.datetime "created_at"
893
954
  t.datetime "updated_at"
955
+ t.integer "lft"
956
+ t.integer "rgt"
957
+ t.integer "depth"
958
+ t.index ["message_request_id"], name: "index_messages_on_message_request_id"
959
+ t.index ["parent_id"], name: "index_messages_on_parent_id"
960
+ t.index ["receiver_id"], name: "index_messages_on_receiver_id"
961
+ t.index ["sender_id"], name: "index_messages_on_sender_id"
894
962
  end
895
963
 
896
- add_index "participates", ["agent_id"], name: "index_participates_on_agent_id"
897
- add_index "participates", ["event_id"], name: "index_participates_on_event_id"
964
+ create_table "nii_types", force: :cascade do |t|
965
+ t.string "name", null: false
966
+ t.text "display_name"
967
+ t.text "note"
968
+ t.integer "position"
969
+ t.datetime "created_at"
970
+ t.datetime "updated_at"
971
+ t.index ["name"], name: "index_nii_types_on_name", unique: true
972
+ end
973
+
974
+ create_table "owns", force: :cascade do |t|
975
+ t.integer "agent_id", null: false
976
+ t.integer "item_id", null: false
977
+ t.integer "position"
978
+ t.datetime "created_at"
979
+ t.datetime "updated_at"
980
+ t.index ["agent_id"], name: "index_owns_on_agent_id"
981
+ t.index ["item_id"], name: "index_owns_on_item_id"
982
+ end
983
+
984
+ create_table "participates", force: :cascade do |t|
985
+ t.integer "agent_id", null: false
986
+ t.integer "event_id", null: false
987
+ t.integer "position"
988
+ t.datetime "created_at"
989
+ t.datetime "updated_at"
990
+ t.index ["agent_id"], name: "index_participates_on_agent_id"
991
+ t.index ["event_id"], name: "index_participates_on_event_id"
992
+ end
898
993
 
899
994
  create_table "picture_files", force: :cascade do |t|
900
- t.integer "picture_attachable_id"
901
- t.string "picture_attachable_type"
902
- t.string "content_type"
903
- t.text "title"
904
- t.string "thumbnail"
905
- t.integer "position"
995
+ t.integer "picture_attachable_id"
996
+ t.string "picture_attachable_type"
997
+ t.text "title"
998
+ t.integer "position"
906
999
  t.datetime "created_at"
907
1000
  t.datetime "updated_at"
908
- t.string "picture_file_name"
909
- t.string "picture_content_type"
910
- t.integer "picture_file_size"
1001
+ t.string "picture_file_name"
1002
+ t.string "picture_content_type"
1003
+ t.integer "picture_file_size"
911
1004
  t.datetime "picture_updated_at"
912
- t.text "picture_meta"
913
- t.string "picture_fingerprint"
1005
+ t.text "picture_meta"
1006
+ t.string "picture_fingerprint"
1007
+ t.integer "picture_width"
1008
+ t.integer "picture_height"
1009
+ t.index ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
914
1010
  end
915
1011
 
916
- add_index "picture_files", ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
917
-
918
1012
  create_table "produce_types", force: :cascade do |t|
919
- t.string "name"
920
- t.text "display_name"
921
- t.text "note"
922
- t.integer "position"
1013
+ t.string "name"
1014
+ t.text "display_name"
1015
+ t.text "note"
1016
+ t.integer "position"
923
1017
  t.datetime "created_at"
924
1018
  t.datetime "updated_at"
925
1019
  end
926
1020
 
927
1021
  create_table "produces", force: :cascade do |t|
928
- t.integer "agent_id", null: false
929
- t.integer "manifestation_id", null: false
930
- t.integer "position"
1022
+ t.integer "agent_id", null: false
1023
+ t.integer "manifestation_id", null: false
1024
+ t.integer "position"
931
1025
  t.datetime "created_at"
932
1026
  t.datetime "updated_at"
933
- t.integer "produce_type_id"
1027
+ t.integer "produce_type_id"
1028
+ t.index ["agent_id"], name: "index_produces_on_agent_id"
1029
+ t.index ["manifestation_id"], name: "index_produces_on_manifestation_id"
934
1030
  end
935
1031
 
936
- add_index "produces", ["agent_id"], name: "index_produces_on_agent_id"
937
- add_index "produces", ["manifestation_id"], name: "index_produces_on_manifestation_id"
938
-
939
1032
  create_table "profiles", force: :cascade do |t|
940
- t.integer "user_id"
941
- t.integer "user_group_id"
942
- t.integer "library_id"
943
- t.string "locale"
944
- t.string "user_number"
945
- t.text "full_name"
946
- t.text "note"
947
- t.text "keyword_list"
948
- t.integer "required_role_id"
949
- t.datetime "created_at"
950
- t.datetime "updated_at"
951
- t.string "checkout_icalendar_token"
952
- t.boolean "save_checkout_history", default: false, null: false
1033
+ t.integer "user_id"
1034
+ t.integer "user_group_id"
1035
+ t.integer "library_id"
1036
+ t.string "locale"
1037
+ t.string "user_number"
1038
+ t.text "full_name"
1039
+ t.text "note"
1040
+ t.text "keyword_list"
1041
+ t.integer "required_role_id"
1042
+ t.datetime "created_at"
1043
+ t.datetime "updated_at"
1044
+ t.string "checkout_icalendar_token"
1045
+ t.boolean "save_checkout_history", default: false, null: false
953
1046
  t.datetime "expired_at"
954
- t.text "full_name_transcription"
1047
+ t.text "full_name_transcription"
955
1048
  t.datetime "date_of_birth"
1049
+ t.index ["checkout_icalendar_token"], name: "index_profiles_on_checkout_icalendar_token", unique: true
1050
+ t.index ["library_id"], name: "index_profiles_on_library_id"
1051
+ t.index ["user_group_id"], name: "index_profiles_on_user_group_id"
1052
+ t.index ["user_id"], name: "index_profiles_on_user_id"
1053
+ t.index ["user_number"], name: "index_profiles_on_user_number", unique: true
956
1054
  end
957
1055
 
958
- add_index "profiles", ["checkout_icalendar_token"], name: "index_profiles_on_checkout_icalendar_token", unique: true
959
- add_index "profiles", ["user_id"], name: "index_profiles_on_user_id"
960
- add_index "profiles", ["user_number"], name: "index_profiles_on_user_number", unique: true
961
-
962
1056
  create_table "realize_types", force: :cascade do |t|
963
- t.string "name"
964
- t.text "display_name"
965
- t.text "note"
966
- t.integer "position"
1057
+ t.string "name"
1058
+ t.text "display_name"
1059
+ t.text "note"
1060
+ t.integer "position"
967
1061
  t.datetime "created_at"
968
1062
  t.datetime "updated_at"
969
1063
  end
970
1064
 
971
1065
  create_table "realizes", force: :cascade do |t|
972
- t.integer "agent_id", null: false
973
- t.integer "expression_id", null: false
974
- t.integer "position"
1066
+ t.integer "agent_id", null: false
1067
+ t.integer "expression_id", null: false
1068
+ t.integer "position"
975
1069
  t.datetime "created_at"
976
1070
  t.datetime "updated_at"
977
- t.integer "realize_type_id"
1071
+ t.integer "realize_type_id"
1072
+ t.index ["agent_id"], name: "index_realizes_on_agent_id"
1073
+ t.index ["expression_id"], name: "index_realizes_on_expression_id"
978
1074
  end
979
1075
 
980
- add_index "realizes", ["agent_id"], name: "index_realizes_on_agent_id"
981
- add_index "realizes", ["expression_id"], name: "index_realizes_on_expression_id"
982
-
983
1076
  create_table "request_status_types", force: :cascade do |t|
984
- t.string "name", null: false
985
- t.text "display_name"
986
- t.text "note"
987
- t.integer "position"
1077
+ t.string "name", null: false
1078
+ t.text "display_name"
1079
+ t.text "note"
1080
+ t.integer "position"
988
1081
  t.datetime "created_at"
989
1082
  t.datetime "updated_at"
990
1083
  end
991
1084
 
992
1085
  create_table "request_types", force: :cascade do |t|
993
- t.string "name", null: false
994
- t.text "display_name"
995
- t.text "note"
996
- t.integer "position"
1086
+ t.string "name", null: false
1087
+ t.text "display_name"
1088
+ t.text "note"
1089
+ t.integer "position"
997
1090
  t.datetime "created_at"
998
1091
  t.datetime "updated_at"
999
1092
  end
1000
1093
 
1001
1094
  create_table "reserve_stat_has_manifestations", force: :cascade do |t|
1002
- t.integer "manifestation_reserve_stat_id", null: false
1003
- t.integer "manifestation_id", null: false
1004
- t.integer "reserves_count"
1095
+ t.integer "manifestation_reserve_stat_id", null: false
1096
+ t.integer "manifestation_id", null: false
1097
+ t.integer "reserves_count"
1005
1098
  t.datetime "created_at"
1006
1099
  t.datetime "updated_at"
1100
+ t.index ["manifestation_id"], name: "index_reserve_stat_has_manifestations_on_manifestation_id"
1101
+ t.index ["manifestation_reserve_stat_id"], name: "index_reserve_stat_has_manifestations_on_m_reserve_stat_id"
1007
1102
  end
1008
1103
 
1009
- add_index "reserve_stat_has_manifestations", ["manifestation_id"], name: "index_reserve_stat_has_manifestations_on_manifestation_id"
1010
- add_index "reserve_stat_has_manifestations", ["manifestation_reserve_stat_id"], name: "index_reserve_stat_has_manifestations_on_m_reserve_stat_id"
1011
-
1012
1104
  create_table "reserve_stat_has_users", force: :cascade do |t|
1013
- t.integer "user_reserve_stat_id", null: false
1014
- t.integer "user_id", null: false
1015
- t.integer "reserves_count"
1105
+ t.integer "user_reserve_stat_id", null: false
1106
+ t.integer "user_id", null: false
1107
+ t.integer "reserves_count"
1016
1108
  t.datetime "created_at"
1017
1109
  t.datetime "updated_at"
1110
+ t.index ["user_id"], name: "index_reserve_stat_has_users_on_user_id"
1111
+ t.index ["user_reserve_stat_id"], name: "index_reserve_stat_has_users_on_user_reserve_stat_id"
1018
1112
  end
1019
1113
 
1020
- add_index "reserve_stat_has_users", ["user_id"], name: "index_reserve_stat_has_users_on_user_id"
1021
- add_index "reserve_stat_has_users", ["user_reserve_stat_id"], name: "index_reserve_stat_has_users_on_user_reserve_stat_id"
1022
-
1023
1114
  create_table "reserve_transitions", force: :cascade do |t|
1024
- t.string "to_state"
1025
- t.text "metadata", default: "{}"
1026
- t.integer "sort_key"
1027
- t.integer "reserve_id"
1115
+ t.string "to_state"
1116
+ t.text "metadata", default: "{}"
1117
+ t.integer "sort_key"
1118
+ t.integer "reserve_id"
1028
1119
  t.datetime "created_at"
1029
1120
  t.datetime "updated_at"
1121
+ t.index ["reserve_id"], name: "index_reserve_transitions_on_reserve_id"
1122
+ t.index ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
1030
1123
  end
1031
1124
 
1032
- add_index "reserve_transitions", ["reserve_id"], name: "index_reserve_transitions_on_reserve_id"
1033
- add_index "reserve_transitions", ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
1034
-
1035
1125
  create_table "reserves", force: :cascade do |t|
1036
- t.integer "user_id", null: false
1037
- t.integer "manifestation_id", null: false
1038
- t.integer "item_id"
1039
- t.integer "request_status_type_id", null: false
1126
+ t.integer "user_id", null: false
1127
+ t.integer "manifestation_id", null: false
1128
+ t.integer "item_id"
1129
+ t.integer "request_status_type_id", null: false
1040
1130
  t.datetime "checked_out_at"
1041
1131
  t.datetime "created_at"
1042
1132
  t.datetime "updated_at"
1043
1133
  t.datetime "canceled_at"
1044
1134
  t.datetime "expired_at"
1045
1135
  t.datetime "deleted_at"
1046
- t.boolean "expiration_notice_to_patron", default: false
1047
- t.boolean "expiration_notice_to_library", default: false
1136
+ t.boolean "expiration_notice_to_patron", default: false
1137
+ t.boolean "expiration_notice_to_library", default: false
1048
1138
  t.datetime "retained_at"
1049
1139
  t.datetime "postponed_at"
1050
- t.integer "lock_version", default: 0, null: false
1140
+ t.integer "lock_version", default: 0, null: false
1141
+ t.index ["item_id"], name: "index_reserves_on_item_id"
1142
+ t.index ["manifestation_id"], name: "index_reserves_on_manifestation_id"
1143
+ t.index ["request_status_type_id"], name: "index_reserves_on_request_status_type_id"
1144
+ t.index ["user_id"], name: "index_reserves_on_user_id"
1051
1145
  end
1052
1146
 
1053
- add_index "reserves", ["item_id"], name: "index_reserves_on_item_id"
1054
- add_index "reserves", ["manifestation_id"], name: "index_reserves_on_manifestation_id"
1055
- add_index "reserves", ["request_status_type_id"], name: "index_reserves_on_request_status_type_id"
1056
- add_index "reserves", ["user_id"], name: "index_reserves_on_user_id"
1057
-
1058
1147
  create_table "resource_export_file_transitions", force: :cascade do |t|
1059
- t.string "to_state"
1060
- t.text "metadata", default: "{}"
1061
- t.integer "sort_key"
1062
- t.integer "resource_export_file_id"
1148
+ t.string "to_state"
1149
+ t.text "metadata", default: "{}"
1150
+ t.integer "sort_key"
1151
+ t.integer "resource_export_file_id"
1063
1152
  t.datetime "created_at"
1064
1153
  t.datetime "updated_at"
1154
+ t.boolean "most_recent", null: false
1155
+ t.index ["resource_export_file_id", "most_recent"], name: "index_resource_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1156
+ t.index ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
1157
+ t.index ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
1065
1158
  end
1066
1159
 
1067
- add_index "resource_export_file_transitions", ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
1068
- 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
1069
-
1070
1160
  create_table "resource_export_files", force: :cascade do |t|
1071
- t.integer "user_id"
1072
- t.string "resource_export_file_name"
1073
- t.string "resource_export_content_type"
1074
- t.integer "resource_export_file_size"
1161
+ t.integer "user_id"
1162
+ t.string "resource_export_file_name"
1163
+ t.string "resource_export_content_type"
1164
+ t.integer "resource_export_file_size"
1075
1165
  t.datetime "resource_export_updated_at"
1076
1166
  t.datetime "executed_at"
1077
1167
  t.datetime "created_at"
@@ -1079,421 +1169,411 @@ ActiveRecord::Schema.define(version: 20160813130535) do
1079
1169
  end
1080
1170
 
1081
1171
  create_table "resource_import_file_transitions", force: :cascade do |t|
1082
- t.string "to_state"
1083
- t.text "metadata", default: "{}"
1084
- t.integer "sort_key"
1085
- t.integer "resource_import_file_id"
1172
+ t.string "to_state"
1173
+ t.text "metadata", default: "{}"
1174
+ t.integer "sort_key"
1175
+ t.integer "resource_import_file_id"
1086
1176
  t.datetime "created_at"
1087
1177
  t.datetime "updated_at"
1178
+ t.boolean "most_recent", null: false
1179
+ t.index ["resource_import_file_id", "most_recent"], name: "index_resource_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1180
+ t.index ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
1181
+ t.index ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
1088
1182
  end
1089
1183
 
1090
- add_index "resource_import_file_transitions", ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
1091
- 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
1092
-
1093
1184
  create_table "resource_import_files", force: :cascade do |t|
1094
- t.integer "parent_id"
1095
- t.string "content_type"
1096
- t.integer "size"
1097
- t.integer "user_id"
1098
- t.text "note"
1185
+ t.integer "parent_id"
1186
+ t.string "content_type"
1187
+ t.integer "size"
1188
+ t.integer "user_id"
1189
+ t.text "note"
1099
1190
  t.datetime "executed_at"
1100
- t.string "resource_import_file_name"
1101
- t.string "resource_import_content_type"
1102
- t.integer "resource_import_file_size"
1191
+ t.string "resource_import_file_name"
1192
+ t.string "resource_import_content_type"
1193
+ t.integer "resource_import_file_size"
1103
1194
  t.datetime "resource_import_updated_at"
1104
1195
  t.datetime "created_at"
1105
1196
  t.datetime "updated_at"
1106
- t.string "edit_mode"
1107
- t.string "resource_import_fingerprint"
1108
- t.text "error_message"
1109
- t.string "user_encoding"
1110
- t.integer "default_shelf_id"
1197
+ t.string "edit_mode"
1198
+ t.string "resource_import_fingerprint"
1199
+ t.text "error_message"
1200
+ t.string "user_encoding"
1201
+ t.integer "default_shelf_id"
1202
+ t.index ["parent_id"], name: "index_resource_import_files_on_parent_id"
1203
+ t.index ["user_id"], name: "index_resource_import_files_on_user_id"
1111
1204
  end
1112
1205
 
1113
- add_index "resource_import_files", ["parent_id"], name: "index_resource_import_files_on_parent_id"
1114
- add_index "resource_import_files", ["user_id"], name: "index_resource_import_files_on_user_id"
1115
-
1116
1206
  create_table "resource_import_results", force: :cascade do |t|
1117
- t.integer "resource_import_file_id"
1118
- t.integer "manifestation_id"
1119
- t.integer "item_id"
1120
- t.text "body"
1207
+ t.integer "resource_import_file_id"
1208
+ t.integer "manifestation_id"
1209
+ t.integer "item_id"
1210
+ t.text "body"
1121
1211
  t.datetime "created_at"
1122
1212
  t.datetime "updated_at"
1123
- t.text "error_message"
1213
+ t.text "error_message"
1214
+ t.index ["item_id"], name: "index_resource_import_results_on_item_id"
1215
+ t.index ["manifestation_id"], name: "index_resource_import_results_on_manifestation_id"
1216
+ t.index ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
1124
1217
  end
1125
1218
 
1126
- add_index "resource_import_results", ["item_id"], name: "index_resource_import_results_on_item_id"
1127
- add_index "resource_import_results", ["manifestation_id"], name: "index_resource_import_results_on_manifestation_id"
1128
- add_index "resource_import_results", ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
1129
-
1130
1219
  create_table "roles", force: :cascade do |t|
1131
- t.string "name", null: false
1132
- t.string "display_name"
1133
- t.text "note"
1220
+ t.string "name", null: false
1221
+ t.string "display_name"
1222
+ t.text "note"
1134
1223
  t.datetime "created_at"
1135
1224
  t.datetime "updated_at"
1136
- t.integer "score", default: 0, null: false
1137
- t.integer "position"
1225
+ t.integer "score", default: 0, null: false
1226
+ t.integer "position"
1138
1227
  end
1139
1228
 
1140
1229
  create_table "search_engines", force: :cascade do |t|
1141
- t.string "name", null: false
1142
- t.text "display_name"
1143
- t.string "url", null: false
1144
- t.text "base_url", null: false
1145
- t.text "http_method", null: false
1146
- t.text "query_param", null: false
1147
- t.text "additional_param"
1148
- t.text "note"
1149
- t.integer "position"
1230
+ t.string "name", null: false
1231
+ t.text "display_name"
1232
+ t.string "url", null: false
1233
+ t.text "base_url", null: false
1234
+ t.text "http_method", null: false
1235
+ t.text "query_param", null: false
1236
+ t.text "additional_param"
1237
+ t.text "note"
1238
+ t.integer "position"
1150
1239
  t.datetime "created_at"
1151
1240
  t.datetime "updated_at"
1152
1241
  end
1153
1242
 
1154
1243
  create_table "series_statement_merge_lists", force: :cascade do |t|
1155
- t.string "title"
1244
+ t.string "title"
1156
1245
  t.datetime "created_at"
1157
1246
  t.datetime "updated_at"
1158
1247
  end
1159
1248
 
1160
1249
  create_table "series_statement_merges", force: :cascade do |t|
1161
- t.integer "series_statement_id", null: false
1162
- t.integer "series_statement_merge_list_id", null: false
1250
+ t.integer "series_statement_id", null: false
1251
+ t.integer "series_statement_merge_list_id", null: false
1163
1252
  t.datetime "created_at"
1164
1253
  t.datetime "updated_at"
1254
+ t.index ["series_statement_id"], name: "index_series_statement_merges_on_series_statement_id"
1255
+ t.index ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
1165
1256
  end
1166
1257
 
1167
- add_index "series_statement_merges", ["series_statement_id"], name: "index_series_statement_merges_on_series_statement_id"
1168
- add_index "series_statement_merges", ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
1169
-
1170
1258
  create_table "series_statements", force: :cascade do |t|
1171
- t.text "original_title"
1172
- t.text "numbering"
1173
- t.text "title_subseries"
1174
- t.text "numbering_subseries"
1175
- t.integer "position"
1176
- t.datetime "created_at"
1177
- t.datetime "updated_at"
1178
- t.text "title_transcription"
1179
- t.text "title_alternative"
1180
- t.string "series_statement_identifier"
1181
- t.integer "manifestation_id"
1182
- t.text "note"
1183
- t.text "title_subseries_transcription"
1184
- t.text "creator_string"
1185
- t.text "volume_number_string"
1186
- t.text "volume_number_transcription_string"
1187
- t.boolean "series_master"
1188
- t.integer "root_manifestation_id"
1189
- end
1190
-
1191
- add_index "series_statements", ["manifestation_id"], name: "index_series_statements_on_manifestation_id"
1192
- add_index "series_statements", ["root_manifestation_id"], name: "index_series_statements_on_root_manifestation_id"
1193
- add_index "series_statements", ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
1259
+ t.text "original_title"
1260
+ t.text "numbering"
1261
+ t.text "title_subseries"
1262
+ t.text "numbering_subseries"
1263
+ t.integer "position"
1264
+ t.datetime "created_at"
1265
+ t.datetime "updated_at"
1266
+ t.text "title_transcription"
1267
+ t.text "title_alternative"
1268
+ t.string "series_statement_identifier"
1269
+ t.integer "manifestation_id"
1270
+ t.text "note"
1271
+ t.text "title_subseries_transcription"
1272
+ t.text "creator_string"
1273
+ t.text "volume_number_string"
1274
+ t.text "volume_number_transcription_string"
1275
+ t.boolean "series_master"
1276
+ t.integer "root_manifestation_id"
1277
+ t.index ["manifestation_id"], name: "index_series_statements_on_manifestation_id"
1278
+ t.index ["root_manifestation_id"], name: "index_series_statements_on_root_manifestation_id"
1279
+ t.index ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
1280
+ end
1194
1281
 
1195
1282
  create_table "shelves", force: :cascade do |t|
1196
- t.string "name", null: false
1197
- t.text "display_name"
1198
- t.text "note"
1199
- t.integer "library_id", default: 1, null: false
1200
- t.integer "items_count", default: 0, null: false
1201
- t.integer "position"
1283
+ t.string "name", null: false
1284
+ t.text "display_name"
1285
+ t.text "note"
1286
+ t.integer "library_id", null: false
1287
+ t.integer "items_count", default: 0, null: false
1288
+ t.integer "position"
1202
1289
  t.datetime "created_at"
1203
1290
  t.datetime "updated_at"
1204
1291
  t.datetime "deleted_at"
1205
- t.boolean "closed", default: false, null: false
1292
+ t.boolean "closed", default: false, null: false
1293
+ t.index ["library_id"], name: "index_shelves_on_library_id"
1206
1294
  end
1207
1295
 
1208
- add_index "shelves", ["library_id"], name: "index_shelves_on_library_id"
1209
-
1210
1296
  create_table "subject_heading_types", force: :cascade do |t|
1211
- t.string "name", null: false
1212
- t.text "display_name"
1213
- t.text "note"
1214
- t.integer "position"
1297
+ t.string "name", null: false
1298
+ t.text "display_name"
1299
+ t.text "note"
1300
+ t.integer "position"
1215
1301
  t.datetime "created_at"
1216
1302
  t.datetime "updated_at"
1217
1303
  end
1218
1304
 
1219
1305
  create_table "subject_types", force: :cascade do |t|
1220
- t.string "name", null: false
1221
- t.text "display_name"
1222
- t.text "note"
1223
- t.integer "position"
1306
+ t.string "name", null: false
1307
+ t.text "display_name"
1308
+ t.text "note"
1309
+ t.integer "position"
1224
1310
  t.datetime "created_at"
1225
1311
  t.datetime "updated_at"
1226
1312
  end
1227
1313
 
1228
1314
  create_table "subjects", force: :cascade do |t|
1229
- t.integer "parent_id"
1230
- t.integer "use_term_id"
1231
- t.string "term"
1232
- t.text "term_transcription"
1233
- t.integer "subject_type_id", null: false
1234
- t.text "scope_note"
1235
- t.text "note"
1236
- t.integer "required_role_id", default: 1, null: false
1237
- t.integer "lock_version", default: 0, null: false
1315
+ t.integer "parent_id"
1316
+ t.integer "use_term_id"
1317
+ t.string "term"
1318
+ t.text "term_transcription"
1319
+ t.integer "subject_type_id", null: false
1320
+ t.text "scope_note"
1321
+ t.text "note"
1322
+ t.integer "required_role_id", default: 1, null: false
1323
+ t.integer "lock_version", default: 0, null: false
1238
1324
  t.datetime "created_at"
1239
1325
  t.datetime "updated_at"
1240
1326
  t.datetime "deleted_at"
1241
- t.string "url"
1242
- t.integer "manifestation_id"
1243
- t.integer "subject_heading_type_id"
1327
+ t.string "url"
1328
+ t.integer "manifestation_id"
1329
+ t.integer "subject_heading_type_id"
1330
+ t.index ["manifestation_id"], name: "index_subjects_on_manifestation_id"
1331
+ t.index ["parent_id"], name: "index_subjects_on_parent_id"
1332
+ t.index ["required_role_id"], name: "index_subjects_on_required_role_id"
1333
+ t.index ["subject_type_id"], name: "index_subjects_on_subject_type_id"
1334
+ t.index ["term"], name: "index_subjects_on_term"
1335
+ t.index ["use_term_id"], name: "index_subjects_on_use_term_id"
1244
1336
  end
1245
1337
 
1246
- add_index "subjects", ["manifestation_id"], name: "index_subjects_on_manifestation_id"
1247
- add_index "subjects", ["parent_id"], name: "index_subjects_on_parent_id"
1248
- add_index "subjects", ["required_role_id"], name: "index_subjects_on_required_role_id"
1249
- add_index "subjects", ["subject_type_id"], name: "index_subjects_on_subject_type_id"
1250
- add_index "subjects", ["term"], name: "index_subjects_on_term"
1251
- add_index "subjects", ["use_term_id"], name: "index_subjects_on_use_term_id"
1252
-
1253
1338
  create_table "subscribes", force: :cascade do |t|
1254
- t.integer "subscription_id", null: false
1255
- t.integer "work_id", null: false
1256
- t.datetime "start_at", null: false
1257
- t.datetime "end_at", null: false
1339
+ t.integer "subscription_id", null: false
1340
+ t.integer "work_id", null: false
1341
+ t.datetime "start_at", null: false
1342
+ t.datetime "end_at", null: false
1258
1343
  t.datetime "created_at"
1259
1344
  t.datetime "updated_at"
1345
+ t.index ["subscription_id"], name: "index_subscribes_on_subscription_id"
1346
+ t.index ["work_id"], name: "index_subscribes_on_work_id"
1260
1347
  end
1261
1348
 
1262
- add_index "subscribes", ["subscription_id"], name: "index_subscribes_on_subscription_id"
1263
- add_index "subscribes", ["work_id"], name: "index_subscribes_on_work_id"
1264
-
1265
1349
  create_table "subscriptions", force: :cascade do |t|
1266
- t.text "title", null: false
1267
- t.text "note"
1268
- t.integer "user_id"
1269
- t.integer "order_list_id"
1350
+ t.text "title", null: false
1351
+ t.text "note"
1352
+ t.integer "user_id"
1353
+ t.integer "order_list_id"
1270
1354
  t.datetime "deleted_at"
1271
- t.integer "subscribes_count", default: 0, null: false
1355
+ t.integer "subscribes_count", default: 0, null: false
1272
1356
  t.datetime "created_at"
1273
1357
  t.datetime "updated_at"
1358
+ t.index ["order_list_id"], name: "index_subscriptions_on_order_list_id"
1359
+ t.index ["user_id"], name: "index_subscriptions_on_user_id"
1274
1360
  end
1275
1361
 
1276
- add_index "subscriptions", ["order_list_id"], name: "index_subscriptions_on_order_list_id"
1277
- add_index "subscriptions", ["user_id"], name: "index_subscriptions_on_user_id"
1278
-
1279
1362
  create_table "use_restrictions", force: :cascade do |t|
1280
- t.string "name", null: false
1281
- t.text "display_name"
1282
- t.text "note"
1283
- t.integer "position"
1363
+ t.string "name", null: false
1364
+ t.text "display_name"
1365
+ t.text "note"
1366
+ t.integer "position"
1284
1367
  t.datetime "created_at"
1285
1368
  t.datetime "updated_at"
1286
1369
  end
1287
1370
 
1288
1371
  create_table "user_checkout_stat_transitions", force: :cascade do |t|
1289
- t.string "to_state"
1290
- t.text "metadata", default: "{}"
1291
- t.integer "sort_key"
1292
- t.integer "user_checkout_stat_id"
1372
+ t.string "to_state"
1373
+ t.text "metadata", default: "{}"
1374
+ t.integer "sort_key"
1375
+ t.integer "user_checkout_stat_id"
1293
1376
  t.datetime "created_at"
1294
1377
  t.datetime "updated_at"
1378
+ t.index ["sort_key", "user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_sort_key_and_stat_id", unique: true
1379
+ t.index ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
1295
1380
  end
1296
1381
 
1297
- add_index "user_checkout_stat_transitions", ["sort_key", "user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_sort_key_and_stat_id", unique: true
1298
- add_index "user_checkout_stat_transitions", ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
1299
-
1300
1382
  create_table "user_checkout_stats", force: :cascade do |t|
1301
1383
  t.datetime "start_date"
1302
1384
  t.datetime "end_date"
1303
- t.text "note"
1385
+ t.text "note"
1304
1386
  t.datetime "created_at"
1305
1387
  t.datetime "updated_at"
1306
1388
  t.datetime "started_at"
1307
1389
  t.datetime "completed_at"
1308
- t.integer "user_id"
1390
+ t.integer "user_id"
1391
+ t.index ["user_id"], name: "index_user_checkout_stats_on_user_id"
1309
1392
  end
1310
1393
 
1311
- add_index "user_checkout_stats", ["user_id"], name: "index_user_checkout_stats_on_user_id"
1312
-
1313
1394
  create_table "user_export_file_transitions", force: :cascade do |t|
1314
- t.string "to_state"
1315
- t.text "metadata", default: "{}"
1316
- t.integer "sort_key"
1317
- t.integer "user_export_file_id"
1395
+ t.string "to_state"
1396
+ t.text "metadata", default: "{}"
1397
+ t.integer "sort_key"
1398
+ t.integer "user_export_file_id"
1318
1399
  t.datetime "created_at"
1319
1400
  t.datetime "updated_at"
1320
- t.boolean "most_recent"
1401
+ t.boolean "most_recent", null: false
1402
+ t.index ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
1403
+ t.index ["user_export_file_id", "most_recent"], name: "index_user_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1404
+ t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_file_id"
1405
+ t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
1321
1406
  end
1322
1407
 
1323
- 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
1324
- add_index "user_export_file_transitions", ["user_export_file_id"], name: "index_user_export_file_transitions_on_file_id"
1325
-
1326
1408
  create_table "user_export_files", force: :cascade do |t|
1327
- t.integer "user_id"
1328
- t.string "user_export_file_name"
1329
- t.string "user_export_content_type"
1330
- t.integer "user_export_file_size"
1409
+ t.integer "user_id"
1410
+ t.string "user_export_file_name"
1411
+ t.string "user_export_content_type"
1412
+ t.integer "user_export_file_size"
1331
1413
  t.datetime "user_export_updated_at"
1332
1414
  t.datetime "executed_at"
1333
1415
  t.datetime "created_at"
1334
1416
  t.datetime "updated_at"
1417
+ t.index ["user_id"], name: "index_user_export_files_on_user_id"
1335
1418
  end
1336
1419
 
1337
1420
  create_table "user_group_has_checkout_types", force: :cascade do |t|
1338
- t.integer "user_group_id", null: false
1339
- t.integer "checkout_type_id", null: false
1340
- t.integer "checkout_limit", default: 0, null: false
1341
- t.integer "checkout_period", default: 0, null: false
1342
- t.integer "checkout_renewal_limit", default: 0, null: false
1343
- t.integer "reservation_limit", default: 0, null: false
1344
- t.integer "reservation_expired_period", default: 7, null: false
1345
- t.boolean "set_due_date_before_closing_day", default: false, null: false
1421
+ t.integer "user_group_id", null: false
1422
+ t.integer "checkout_type_id", null: false
1423
+ t.integer "checkout_limit", default: 0, null: false
1424
+ t.integer "checkout_period", default: 0, null: false
1425
+ t.integer "checkout_renewal_limit", default: 0, null: false
1426
+ t.integer "reservation_limit", default: 0, null: false
1427
+ t.integer "reservation_expired_period", default: 7, null: false
1428
+ t.boolean "set_due_date_before_closing_day", default: false, null: false
1346
1429
  t.datetime "fixed_due_date"
1347
- t.text "note"
1348
- t.integer "position"
1430
+ t.text "note"
1431
+ t.integer "position"
1349
1432
  t.datetime "created_at"
1350
1433
  t.datetime "updated_at"
1351
- t.integer "current_checkout_count"
1434
+ t.integer "current_checkout_count"
1435
+ t.index ["checkout_type_id"], name: "index_user_group_has_checkout_types_on_checkout_type_id"
1436
+ t.index ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1352
1437
  end
1353
1438
 
1354
- add_index "user_group_has_checkout_types", ["checkout_type_id"], name: "index_user_group_has_checkout_types_on_checkout_type_id"
1355
- add_index "user_group_has_checkout_types", ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1356
-
1357
1439
  create_table "user_groups", force: :cascade do |t|
1358
- t.string "name"
1359
- t.text "display_name"
1360
- t.text "note"
1361
- t.integer "position"
1440
+ t.string "name"
1441
+ t.text "display_name"
1442
+ t.text "note"
1443
+ t.integer "position"
1362
1444
  t.datetime "created_at"
1363
1445
  t.datetime "updated_at"
1364
1446
  t.datetime "deleted_at"
1365
- t.integer "valid_period_for_new_user", default: 0, null: false
1447
+ t.integer "valid_period_for_new_user", default: 0, null: false
1366
1448
  t.datetime "expired_at"
1367
- t.integer "number_of_day_to_notify_overdue", default: 1, null: false
1368
- t.integer "number_of_day_to_notify_due_date", default: 7, null: false
1369
- t.integer "number_of_time_to_notify_overdue", default: 3, null: false
1449
+ t.integer "number_of_day_to_notify_overdue", default: 1, null: false
1450
+ t.integer "number_of_day_to_notify_due_date", default: 7, null: false
1451
+ t.integer "number_of_time_to_notify_overdue", default: 3, null: false
1370
1452
  end
1371
1453
 
1372
1454
  create_table "user_has_roles", force: :cascade do |t|
1373
- t.integer "user_id"
1374
- t.integer "role_id"
1455
+ t.integer "user_id", null: false
1456
+ t.integer "role_id", null: false
1375
1457
  t.datetime "created_at"
1376
1458
  t.datetime "updated_at"
1459
+ t.index ["role_id"], name: "index_user_has_roles_on_role_id"
1460
+ t.index ["user_id"], name: "index_user_has_roles_on_user_id"
1377
1461
  end
1378
1462
 
1379
- add_index "user_has_roles", ["role_id"], name: "index_user_has_roles_on_role_id"
1380
- add_index "user_has_roles", ["user_id"], name: "index_user_has_roles_on_user_id"
1381
-
1382
1463
  create_table "user_import_file_transitions", force: :cascade do |t|
1383
- t.string "to_state"
1384
- t.text "metadata", default: "{}"
1385
- t.integer "sort_key"
1386
- t.integer "user_import_file_id"
1464
+ t.string "to_state"
1465
+ t.text "metadata", default: "{}"
1466
+ t.integer "sort_key"
1467
+ t.integer "user_import_file_id"
1387
1468
  t.datetime "created_at"
1388
1469
  t.datetime "updated_at"
1389
- t.boolean "most_recent"
1470
+ t.boolean "most_recent", null: false
1471
+ t.index ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
1472
+ t.index ["user_import_file_id", "most_recent"], name: "index_user_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1473
+ t.index ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
1390
1474
  end
1391
1475
 
1392
- 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
1393
- add_index "user_import_file_transitions", ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
1394
-
1395
1476
  create_table "user_import_files", force: :cascade do |t|
1396
- t.integer "user_id"
1397
- t.text "note"
1477
+ t.integer "user_id"
1478
+ t.text "note"
1398
1479
  t.datetime "executed_at"
1399
- t.string "user_import_file_name"
1400
- t.string "user_import_content_type"
1401
- t.integer "user_import_file_size"
1480
+ t.string "user_import_file_name"
1481
+ t.string "user_import_content_type"
1482
+ t.integer "user_import_file_size"
1402
1483
  t.datetime "user_import_updated_at"
1403
- t.string "user_import_fingerprint"
1404
- t.string "edit_mode"
1405
- t.text "error_message"
1484
+ t.string "user_import_fingerprint"
1485
+ t.string "edit_mode"
1486
+ t.text "error_message"
1406
1487
  t.datetime "created_at"
1407
1488
  t.datetime "updated_at"
1408
- t.string "user_encoding"
1409
- t.integer "default_library_id"
1410
- t.integer "default_user_group_id"
1489
+ t.string "user_encoding"
1490
+ t.integer "default_library_id"
1491
+ t.integer "default_user_group_id"
1492
+ t.index ["user_id"], name: "index_user_import_files_on_user_id"
1411
1493
  end
1412
1494
 
1413
1495
  create_table "user_import_results", force: :cascade do |t|
1414
- t.integer "user_import_file_id"
1415
- t.integer "user_id"
1416
- t.text "body"
1496
+ t.integer "user_import_file_id"
1497
+ t.integer "user_id"
1498
+ t.text "body"
1417
1499
  t.datetime "created_at"
1418
1500
  t.datetime "updated_at"
1419
- t.text "error_message"
1501
+ t.text "error_message"
1502
+ t.index ["user_id"], name: "index_user_import_results_on_user_id"
1503
+ t.index ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
1420
1504
  end
1421
1505
 
1422
1506
  create_table "user_reserve_stat_transitions", force: :cascade do |t|
1423
- t.string "to_state"
1424
- t.text "metadata", default: "{}"
1425
- t.integer "sort_key"
1426
- t.integer "user_reserve_stat_id"
1507
+ t.string "to_state"
1508
+ t.text "metadata", default: "{}"
1509
+ t.integer "sort_key"
1510
+ t.integer "user_reserve_stat_id"
1427
1511
  t.datetime "created_at"
1428
1512
  t.datetime "updated_at"
1513
+ t.index ["sort_key", "user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_sort_key_and_stat_id", unique: true
1514
+ t.index ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
1429
1515
  end
1430
1516
 
1431
- add_index "user_reserve_stat_transitions", ["sort_key", "user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_sort_key_and_stat_id", unique: true
1432
- add_index "user_reserve_stat_transitions", ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
1433
-
1434
1517
  create_table "user_reserve_stats", force: :cascade do |t|
1435
1518
  t.datetime "start_date"
1436
1519
  t.datetime "end_date"
1437
- t.text "note"
1520
+ t.text "note"
1438
1521
  t.datetime "created_at"
1439
1522
  t.datetime "updated_at"
1440
1523
  t.datetime "started_at"
1441
1524
  t.datetime "completed_at"
1442
- t.integer "user_id"
1525
+ t.integer "user_id"
1526
+ t.index ["user_id"], name: "index_user_reserve_stats_on_user_id"
1443
1527
  end
1444
1528
 
1445
- add_index "user_reserve_stats", ["user_id"], name: "index_user_reserve_stats_on_user_id"
1446
-
1447
1529
  create_table "users", force: :cascade do |t|
1448
- t.string "email", default: "", null: false
1449
- t.string "encrypted_password", default: "", null: false
1450
- t.string "reset_password_token"
1530
+ t.string "email", default: "", null: false
1531
+ t.string "encrypted_password", default: "", null: false
1532
+ t.string "reset_password_token"
1451
1533
  t.datetime "reset_password_sent_at"
1452
1534
  t.datetime "remember_created_at"
1453
- t.integer "sign_in_count", default: 0
1535
+ t.integer "sign_in_count", default: 0
1454
1536
  t.datetime "current_sign_in_at"
1455
1537
  t.datetime "last_sign_in_at"
1456
- t.string "current_sign_in_ip"
1457
- t.string "last_sign_in_ip"
1538
+ t.string "current_sign_in_ip"
1539
+ t.string "last_sign_in_ip"
1458
1540
  t.datetime "created_at"
1459
1541
  t.datetime "updated_at"
1460
- t.boolean "save_checkout_history", default: false, null: false
1461
- t.string "checkout_icalendar_token"
1462
- t.string "username"
1542
+ t.boolean "save_checkout_history", default: false, null: false
1543
+ t.string "checkout_icalendar_token"
1544
+ t.string "username"
1463
1545
  t.datetime "deleted_at"
1464
1546
  t.datetime "expired_at"
1465
- t.integer "failed_attempts", default: 0
1466
- t.string "unlock_token"
1547
+ t.integer "failed_attempts", default: 0
1548
+ t.string "unlock_token"
1467
1549
  t.datetime "locked_at"
1468
1550
  t.datetime "confirmed_at"
1551
+ t.index ["checkout_icalendar_token"], name: "index_users_on_checkout_icalendar_token", unique: true
1552
+ t.index ["email"], name: "index_users_on_email"
1553
+ t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
1554
+ t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
1555
+ t.index ["username"], name: "index_users_on_username", unique: true
1469
1556
  end
1470
1557
 
1471
- add_index "users", ["checkout_icalendar_token"], name: "index_users_on_checkout_icalendar_token", unique: true
1472
- add_index "users", ["email"], name: "index_users_on_email"
1473
- add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
1474
- add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", unique: true
1475
- add_index "users", ["username"], name: "index_users_on_username", unique: true
1476
-
1477
1558
  create_table "versions", force: :cascade do |t|
1478
- t.string "item_type", null: false
1479
- t.integer "item_id", null: false
1480
- t.string "event", null: false
1481
- t.string "whodunnit"
1482
- t.text "object"
1559
+ t.string "item_type", null: false
1560
+ t.integer "item_id", null: false
1561
+ t.string "event", null: false
1562
+ t.string "whodunnit"
1563
+ t.text "object"
1483
1564
  t.datetime "created_at"
1565
+ t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
1484
1566
  end
1485
1567
 
1486
- add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
1487
-
1488
1568
  create_table "withdraws", force: :cascade do |t|
1489
- t.integer "basket_id"
1490
- t.integer "item_id"
1491
- t.integer "librarian_id"
1492
- t.datetime "created_at", null: false
1493
- t.datetime "updated_at", null: false
1569
+ t.integer "basket_id"
1570
+ t.integer "item_id"
1571
+ t.integer "librarian_id"
1572
+ t.datetime "created_at", null: false
1573
+ t.datetime "updated_at", null: false
1574
+ t.index ["basket_id"], name: "index_withdraws_on_basket_id"
1575
+ t.index ["item_id"], name: "index_withdraws_on_item_id"
1576
+ t.index ["librarian_id"], name: "index_withdraws_on_librarian_id"
1494
1577
  end
1495
1578
 
1496
- add_index "withdraws", ["basket_id"], name: "index_withdraws_on_basket_id"
1497
- add_index "withdraws", ["item_id"], name: "index_withdraws_on_item_id"
1498
-
1499
1579
  end