enju_inventory 0.3.1 → 0.4.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (305) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +3 -5
  3. data/Rakefile +1 -1
  4. data/app/models/inventory.rb +7 -7
  5. data/app/models/inventory_file.rb +5 -8
  6. data/app/views/inventory_files/_form.html.erb +2 -2
  7. data/db/migrate/20081117143156_create_inventory_files.rb +3 -10
  8. data/db/migrate/20081117143455_create_inventories.rb +1 -1
  9. data/db/migrate/20090706125521_add_attachments_inventory_to_inventory_file.rb +1 -1
  10. data/db/migrate/20120413100431_add_fingerprint_to_inventory_file.rb +1 -1
  11. data/db/migrate/20191224083828_add_item_identifier_to_inventory.rb +1 -1
  12. data/db/migrate/20191224091957_add_current_shelf_name_to_inventory.rb +1 -1
  13. data/db/migrate/20191230082846_add_shelf_to_inventory_file.rb +1 -1
  14. data/lib/enju_inventory/version.rb +1 -1
  15. data/lib/tasks/enju_inventory_tasks.rake +5 -4
  16. data/spec/dummy/config/application.rb +2 -1
  17. data/spec/dummy/config/database.yml +70 -9
  18. data/spec/dummy/config/storage.yml +34 -0
  19. data/spec/dummy/db/migrate/001_create_agents.rb +1 -2
  20. data/spec/dummy/db/migrate/002_devise_create_users.rb +1 -1
  21. data/spec/dummy/db/migrate/005_create_manifestations.rb +1 -2
  22. data/spec/dummy/db/migrate/006_create_items.rb +1 -2
  23. data/spec/dummy/db/migrate/012_create_owns.rb +1 -3
  24. data/spec/dummy/db/migrate/015_create_creates.rb +1 -3
  25. data/spec/dummy/db/migrate/032_create_checkins.rb +9 -0
  26. data/spec/dummy/db/migrate/033_create_checkouts.rb +20 -0
  27. data/spec/dummy/db/migrate/035_create_reserves.rb +21 -0
  28. data/spec/dummy/db/migrate/041_create_roles.rb +1 -1
  29. data/spec/dummy/db/migrate/047_create_produces.rb +1 -3
  30. data/spec/dummy/db/migrate/059_create_libraries.rb +1 -2
  31. data/spec/dummy/db/migrate/069_create_shelves.rb +1 -2
  32. data/spec/dummy/db/migrate/073_create_carrier_types.rb +1 -1
  33. data/spec/dummy/db/migrate/077_create_user_groups.rb +1 -2
  34. data/spec/dummy/db/migrate/080_create_library_groups.rb +1 -1
  35. data/spec/dummy/db/migrate/112_create_frequencies.rb +1 -1
  36. data/spec/dummy/db/migrate/117_create_form_of_works.rb +1 -1
  37. data/spec/dummy/db/migrate/120_create_baskets.rb +1 -1
  38. data/spec/dummy/db/migrate/121_create_checked_items.rb +16 -0
  39. data/spec/dummy/db/migrate/124_create_bookstores.rb +1 -2
  40. data/spec/dummy/db/migrate/125_create_donates.rb +1 -1
  41. data/spec/dummy/db/migrate/127_create_use_restrictions.rb +16 -0
  42. data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +14 -0
  43. data/spec/dummy/db/migrate/130_create_request_status_types.rb +1 -1
  44. data/spec/dummy/db/migrate/131_create_request_types.rb +1 -1
  45. data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +1 -1
  46. data/spec/dummy/db/migrate/133_create_agent_merges.rb +1 -1
  47. data/spec/dummy/db/migrate/134_create_agent_merge_lists.rb +1 -1
  48. data/spec/dummy/db/migrate/149_create_message_templates.rb +1 -1
  49. data/spec/dummy/db/migrate/154_create_messages.rb +5 -9
  50. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +4 -4
  51. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +1 -3
  52. data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +1 -1
  53. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +1 -2
  54. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +1 -1
  55. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +1 -1
  56. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +1 -1
  57. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +1 -1
  58. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +1 -1
  59. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +1 -1
  60. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
  61. data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +17 -0
  62. data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +23 -0
  63. data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +17 -0
  64. data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +15 -0
  65. data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +15 -0
  66. data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +15 -0
  67. data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +17 -0
  68. data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +15 -0
  69. data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +15 -0
  70. data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +15 -0
  71. data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +23 -0
  72. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +1 -1
  73. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +1 -1
  74. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +1 -1
  75. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +1 -1
  76. data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +1 -1
  77. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +1 -1
  78. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +1 -1
  79. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +1 -1
  80. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +1 -1
  81. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +1 -1
  82. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +1 -1
  83. data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
  84. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +1 -1
  85. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +1 -1
  86. data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +3 -5
  87. data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +1 -1
  88. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +1 -1
  89. data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +1 -1
  90. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +1 -1
  91. data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +1 -1
  92. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +1 -1
  93. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +1 -1
  94. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +1 -1
  95. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +1 -1
  96. data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +9 -0
  97. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +1 -1
  98. data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +9 -0
  99. data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +1 -1
  100. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +1 -1
  101. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +1 -1
  102. data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +9 -0
  103. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +1 -1
  104. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +1 -1
  105. data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +13 -0
  106. data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +1 -1
  107. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +1 -1
  108. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +1 -1
  109. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +1 -1
  110. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +1 -1
  111. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +1 -1
  112. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +1 -1
  113. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +1 -1
  114. data/spec/dummy/db/migrate/20111129044509_add_pickup_location_to_reserve.rb +6 -0
  115. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
  116. data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +1 -1
  117. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -1
  118. data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +1 -1
  119. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -1
  120. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +1 -1
  121. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +1 -1
  122. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +1 -1
  123. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +1 -1
  124. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +1 -1
  125. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +1 -1
  126. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +1 -1
  127. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +1 -1
  128. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +1 -1
  129. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +1 -1
  130. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +1 -1
  131. data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +5 -0
  132. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +1 -1
  133. data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +1 -1
  134. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +1 -1
  135. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +1 -1
  136. data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +1 -2
  137. data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +5 -0
  138. data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +5 -0
  139. data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
  140. data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +1 -1
  141. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +1 -1
  142. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +1 -1
  143. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +1 -1
  144. data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +1 -1
  145. data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +1 -1
  146. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +1 -1
  147. data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +1 -1
  148. data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +5 -0
  149. data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +5 -0
  150. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
  151. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +1 -1
  152. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +5 -6
  153. data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +18 -0
  154. data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +1 -1
  155. data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +1 -1
  156. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +1 -1
  157. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +1 -1
  158. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +1 -1
  159. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +2 -6
  160. data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +18 -0
  161. data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +18 -0
  162. data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +18 -0
  163. data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +18 -0
  164. data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +1 -1
  165. data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +1 -1
  166. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +1 -1
  167. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
  168. data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +1 -1
  169. data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +1 -1
  170. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +1 -1
  171. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +2 -6
  172. data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +1 -1
  173. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
  174. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
  175. data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +1 -1
  176. data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +1 -1
  177. data/spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb +8 -0
  178. data/spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb +6 -0
  179. data/spec/dummy/db/migrate/20140810091417_add_save_checkout_history_to_profile.rb +5 -0
  180. data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +1 -1
  181. data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +1 -1
  182. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +1 -1
  183. data/spec/dummy/db/migrate/20140822114527_add_error_message_to_resource_import_result.rb +1 -1
  184. data/spec/dummy/db/migrate/20140823083524_add_extent_to_manifestation.rb +1 -1
  185. data/spec/dummy/db/migrate/20140823094847_add_dimensions_to_manifestation.rb +1 -1
  186. data/spec/dummy/db/migrate/20140823095740_rename_manifestation_periodical_to_serial.rb +1 -1
  187. data/spec/dummy/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb +1 -1
  188. data/spec/dummy/db/migrate/20141003182825_add_date_of_birth_to_profile.rb +1 -1
  189. data/spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb +5 -0
  190. data/spec/dummy/db/migrate/20141020120523_add_library_id_to_checkout.rb +5 -0
  191. data/spec/dummy/db/migrate/20150106001709_create_demands.rb +11 -0
  192. data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +1 -1
  193. data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +1 -1
  194. data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +1 -1
  195. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +1 -1
  196. data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +1 -1
  197. data/spec/dummy/db/migrate/20160319144230_create_issn_records.rb +11 -0
  198. data/spec/dummy/db/migrate/20160506144040_create_isbn_records.rb +11 -0
  199. data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
  200. data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
  201. data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
  202. data/spec/dummy/db/migrate/20160703184619_add_most_recent_to_reserve_transitions.rb +9 -0
  203. data/spec/dummy/db/migrate/20160703184650_add_most_recent_to_manifestation_checkout_stat_transitions.rb +9 -0
  204. data/spec/dummy/db/migrate/20160703184723_add_most_recent_to_manifestation_reserve_stat_transitions.rb +9 -0
  205. data/spec/dummy/db/migrate/20160703184747_add_most_recent_to_user_checkout_stat_transitions.rb +9 -0
  206. data/spec/dummy/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb +9 -0
  207. data/spec/dummy/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +1 -1
  208. data/spec/dummy/db/migrate/20160703190209_add_foreign_key_on_manifestation_id_to_reserve.rb +5 -0
  209. data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +1 -1
  210. data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +1 -1
  211. data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +1 -1
  212. data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +1 -1
  213. data/spec/dummy/db/migrate/20160811102604_add_picture_width_to_picture_file.rb +1 -1
  214. data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +1 -1
  215. data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +1 -1
  216. data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +1 -1
  217. data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +1 -1
  218. data/spec/dummy/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb +1 -1
  219. data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +1 -1
  220. data/spec/dummy/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
  221. data/spec/dummy/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
  222. data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +1 -1
  223. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +1 -1
  224. data/spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +1 -1
  225. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +1 -1
  226. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +1 -1
  227. data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +1 -1
  228. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +2 -2
  229. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +2 -2
  230. data/spec/dummy/db/migrate/20180107161035_add_constraints_to_most_recent_for_reserve_transitions.rb +13 -0
  231. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +1 -1
  232. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +1 -1
  233. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +1 -1
  234. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +1 -1
  235. data/spec/dummy/db/migrate/20180107161951_add_constraints_to_most_recent_for_user_checkout_stat_transitions.rb +13 -0
  236. data/spec/dummy/db/migrate/20180107162009_add_constraints_to_most_recent_for_user_reserve_stat_transitions.rb +13 -0
  237. data/spec/dummy/db/migrate/20180107162029_add_constraints_to_most_recent_for_manifestation_checkout_stat_transitions.rb +13 -0
  238. data/spec/dummy/db/migrate/20180107162048_add_constraints_to_most_recent_for_manifestation_reserve_stat_transitions.rb +13 -0
  239. data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +13 -0
  240. data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +13 -0
  241. data/spec/dummy/db/migrate/20190102034126_create_doi_records.rb +13 -0
  242. data/spec/dummy/db/migrate/20190208135957_create_active_storage_tables.active_storage.rb +27 -0
  243. data/spec/dummy/db/migrate/20190311154610_create_periodicals.rb +10 -0
  244. data/spec/dummy/db/migrate/20190312033839_create_periodical_and_manifestations.rb +11 -0
  245. data/spec/dummy/db/migrate/20190508160525_create_retains.rb +10 -0
  246. data/spec/dummy/db/migrate/20190629134017_rename_user_group_has_checkout_type_due_date_before_to_due_date_after.rb +5 -0
  247. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  248. data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
  249. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  250. data/spec/dummy/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
  251. data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  252. data/spec/dummy/db/migrate/20190713114724_add_checkout_id_to_checkin.rb +5 -0
  253. data/spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb +5 -0
  254. data/spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb +5 -0
  255. data/spec/dummy/db/migrate/20190814120827_add_display_name_translations_to_checkout_type.rb +5 -0
  256. data/spec/dummy/db/migrate/20191216131755_add_email_to_library_group.rb +6 -0
  257. data/spec/dummy/db/schema.rb +677 -250
  258. data/spec/dummy/private/system/inventory_files/inventories/000/000/001/original/inventory_file_sample.tsv +7 -0
  259. data/spec/dummy/private/system/inventory_files/inventories/000/000/004/original/inventory_file_sample.tsv +7 -0
  260. data/spec/dummy/private/system/inventory_files/inventories/000/000/005/original/inventory_file_sample.tsv +7 -0
  261. data/spec/dummy/private/system/inventory_files/inventories/000/000/006/original/inventory_file_sample.tsv +7 -0
  262. data/spec/dummy/tmp/storage/44/EP/44EPGy51PkTDwfmTxaT6bkhT +7 -0
  263. data/spec/dummy/tmp/storage/8u/8S/8u8SLMCn4ucazrnX5sceDGyN +7 -0
  264. data/spec/dummy/tmp/storage/Pt/M2/PtM2McsVVncm4itnL9emW7tf +7 -0
  265. data/spec/dummy/tmp/storage/SD/S9/SDS9jy6GHmDGPTZH5jEDLyHR +7 -0
  266. data/spec/dummy/tmp/storage/Se/bT/SebTtBwFrnqgh4Wi2kQf9dfb +7 -0
  267. data/spec/dummy/tmp/storage/W1/qT/W1qThC54yEwDqeFGuUrn7nfJ +7 -0
  268. data/spec/dummy/tmp/storage/XS/yf/XSyf3usm5HqkUNg6kJat9rat +7 -0
  269. data/spec/dummy/tmp/storage/YN/d9/YNd9Sptz3jzMDua7FYS6j2nr +7 -0
  270. data/spec/dummy/tmp/storage/cZ/Kz/cZKzVzcLQKWD1EKJ2YeqiDQr +7 -0
  271. data/spec/dummy/tmp/storage/dS/Nb/dSNbW2qin16LDx7jd9XKURJi +7 -0
  272. data/spec/dummy/tmp/storage/f7/R1/f7R1iEBpQ9CUKuWqNU5HehYi +7 -0
  273. data/spec/dummy/tmp/storage/oD/Gq/oDGqxmchhQqZxKykKyuCHVcv +7 -0
  274. data/spec/dummy/tmp/storage/q2/11/q2119zvGpdZvtvM68uJsW5Xr +7 -0
  275. data/spec/dummy/tmp/storage/qZ/Cd/qZCdPbtgCau79NVK7cXQFchn +7 -0
  276. data/spec/dummy/tmp/storage/wR/xX/wRxXBFaEq6vnkyGr8q9Z71Rv +7 -0
  277. data/spec/dummy/tmp/storage/yL/yQ/yLyQ8YsYFzq3PovvAQFVSNi8 +7 -0
  278. data/spec/dummy/tmp/storage/yT/UN/yTUNMB52xMbMFbWoMwg61NsE +7 -0
  279. data/spec/dummy/tmp/storage/zR/Vr/zRVrVidPksQY9LNsE34MTRy2 +7 -0
  280. data/spec/factories/profile.rb +9 -0
  281. data/spec/factories/user.rb +25 -31
  282. data/spec/fixtures/carrier_types.yml +12 -15
  283. data/spec/fixtures/circulation_statuses.yml +26 -34
  284. data/spec/fixtures/content_types.yml +20 -31
  285. data/spec/fixtures/inventories.yml +19 -7
  286. data/spec/fixtures/inventory_files.yml +5 -17
  287. data/spec/fixtures/items.yml +28 -37
  288. data/spec/fixtures/libraries.yml +28 -30
  289. data/spec/fixtures/library_groups.yml +38 -19
  290. data/spec/fixtures/manifestations.yml +19 -23
  291. data/spec/fixtures/profiles.yml +9 -12
  292. data/spec/fixtures/roles.yml +22 -5
  293. data/spec/fixtures/shelves.yml +16 -15
  294. data/spec/fixtures/users.yml +7 -0
  295. data/spec/models/inventory_file_spec.rb +6 -9
  296. data/spec/models/inventory_spec.rb +7 -7
  297. metadata +421 -274
  298. data/app/assets/config/enju_inventory_manifest.js +0 -0
  299. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +0 -13
  300. data/spec/dummy/db/migrate/20090719201843_create_extents.rb +0 -12
  301. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +0 -18
  302. data/spec/dummy/db/migrate/20121116033446_add_doi_to_manifestation.rb +0 -6
  303. data/spec/dummy/db/migrate/20150124152756_add_foreign_key_to_shelves_referencing_libraries.rb +0 -6
  304. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -26
  305. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
@@ -1,4 +1,4 @@
1
- class AddForeignKeyToLibraryGroupIdOnLibrary < ActiveRecord::Migration[4.2]
1
+ class AddForeignKeyToLibraryGroupIdOnLibrary < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_foreign_key :libraries, :library_groups, null: false
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddHeaderLogoMetaToLibraryGroup < ActiveRecord::Migration[4.2]
1
+ class AddHeaderLogoMetaToLibraryGroup < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :library_groups, :header_logo_meta, :text
4
4
  end
@@ -1,8 +1,8 @@
1
- class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
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
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
6
  change_column_null :user_import_file_transitions, :most_recent, false
7
7
  end
8
8
 
@@ -1,8 +1,8 @@
1
- class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
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
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
6
  change_column_null :user_export_file_transitions, :most_recent, false
7
7
  end
8
8
 
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForReserveTransitions < ActiveRecord::Migration[5.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :reserve_transitions, [:reserve_id, :most_recent], unique: true, where: "most_recent", name: "index_reserve_transitions_parent_most_recent" # , algorithm: :concurrently
6
+ change_column_null :reserve_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :reserve_transitions, name: "index_reserve_transitions_parent_most_recent"
11
+ change_column_null :reserve_transitions, :most_recent, true
12
+ end
13
+ end
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForAgentImportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForAgentImportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForResourceImportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForResourceImportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForResourceExportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForResourceExportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForImportRequestTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForImportRequestTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForUserCheckoutStatTransitions < ActiveRecord::Migration[5.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :user_checkout_stat_transitions, [:user_checkout_stat_id, :most_recent], unique: true, where: "most_recent", name: "index_user_checkout_stat_transitions_parent_most_recent" # , algorithm: :concurrently
6
+ change_column_null :user_checkout_stat_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :user_checkout_stat_transitions, name: "index_user_checkout_stat_transitions_parent_most_recent"
11
+ change_column_null :user_checkout_stat_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForUserReserveStatTransitions < ActiveRecord::Migration[5.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :user_reserve_stat_transitions, [:user_reserve_stat_id, :most_recent], unique: true, where: "most_recent", name: "index_user_reserve_stat_transitions_parent_most_recent" # , algorithm: :concurrently
6
+ change_column_null :user_reserve_stat_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :user_reserve_stat_transitions, name: "index_user_reserve_stat_transitions_parent_most_recent"
11
+ change_column_null :user_reserve_stat_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForManifestationCheckoutStatTransitions < ActiveRecord::Migration[5.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :manifestation_checkout_stat_transitions, [:manifestation_checkout_stat_id, :most_recent], unique: true, where: "most_recent", name: "index_manifestation_checkout_stat_transitions_parent_most_rece" # , algorithm: :concurrently
6
+ change_column_null :manifestation_checkout_stat_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :manifestation_checkout_stat_transitions, name: "index_manifestation_checkout_stat_transitions_parent_most_rece"
11
+ change_column_null :manifestation_checkout_stat_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForManifestationReserveStatTransitions < ActiveRecord::Migration[5.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :manifestation_reserve_stat_transitions, [:manifestation_reserve_stat_id, :most_recent], unique: true, where: "most_recent", name: "index_manifestation_reserve_stat_transitions_parent_most_recen" # , algorithm: :concurrently
6
+ change_column_null :manifestation_reserve_stat_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :manifestation_reserve_stat_transitions, name: "index_manifestation_reserve_stat_transitions_parent_most_recen"
11
+ change_column_null :manifestation_reserve_stat_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForMessageTransitions < ActiveRecord::Migration[5.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :message_transitions, [:message_id, :most_recent], unique: true, where: "most_recent", name: "index_message_transitions_parent_most_recent" # , algorithm: :concurrently
6
+ change_column_null :message_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :message_transitions, name: "index_message_transitions_parent_most_recent"
11
+ change_column_null :message_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddConstraintsToMostRecentForMessageRequestTransitions < ActiveRecord::Migration[5.2]
2
+ disable_ddl_transaction!
3
+
4
+ def up
5
+ add_index :message_request_transitions, [:message_request_id, :most_recent], unique: true, where: "most_recent", name: "index_message_request_transitions_parent_most_recent" # , algorithm: :concurrently
6
+ change_column_null :message_request_transitions, :most_recent, false
7
+ end
8
+
9
+ def down
10
+ remove_index :message_request_transitions, name: "index_message_request_transitions_parent_most_recent"
11
+ change_column_null :message_request_transitions, :most_recent, true
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class CreateDoiRecords < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :doi_records do |t|
4
+ t.string :body, index: {unique: true}, null: false
5
+ t.string :display_body, null: false
6
+ t.string :source
7
+ t.jsonb :response, default: {}, null: false
8
+ t.references :manifestation, foreign_key: true, null: false
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,27 @@
1
+ # This migration comes from active_storage (originally 20170806125915)
2
+ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
3
+ def change
4
+ create_table :active_storage_blobs do |t|
5
+ t.string :key, null: false
6
+ t.string :filename, null: false
7
+ t.string :content_type
8
+ t.text :metadata
9
+ t.bigint :byte_size, null: false
10
+ t.string :checksum, null: false
11
+ t.datetime :created_at, null: false
12
+
13
+ t.index [ :key ], unique: true
14
+ end
15
+
16
+ create_table :active_storage_attachments do |t|
17
+ t.string :name, null: false
18
+ t.references :record, null: false, polymorphic: true, index: false
19
+ t.references :blob, null: false
20
+
21
+ t.datetime :created_at, null: false
22
+
23
+ t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
24
+ t.foreign_key :active_storage_blobs, column: :blob_id
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,10 @@
1
+ class CreatePeriodicals < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :periodicals do |t|
4
+ t.text :original_title, null: false
5
+ t.references :frequency, foreign_key: true, null: false
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ class CreatePeriodicalAndManifestations < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :periodical_and_manifestations do |t|
4
+ t.references :periodical, foreign_key: true, null: false
5
+ t.references :manifestation, foreign_key: true, null: false
6
+ t.boolean :periodical_master, default: false, null: false, index: {where: 'periodical_master IS true', unique: true}
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,10 @@
1
+ class CreateRetains < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :retains do |t|
4
+ t.references :reserve, foreign_key: true, null: false
5
+ t.references :item, foreign_key: true, null: false
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,5 @@
1
+ class RenameUserGroupHasCheckoutTypeDueDateBeforeToDueDateAfter < ActiveRecord::Migration[5.2]
2
+ def change
3
+ rename_column :user_group_has_checkout_types, :set_due_date_before_closing_day, :set_due_date_after_closing_day
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ class AddDisplayNameTranslationsToLibraryGroup < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :budget_types, :display_name_translations, :jsonb, default: {}, null: false
4
+ add_column :libraries, :display_name_translations, :jsonb, default: {}, null: false
5
+ add_column :library_groups, :display_name_translations, :jsonb, default: {}, null: false
6
+ add_column :request_status_types, :display_name_translations, :jsonb, default: {}, null: false
7
+ add_column :request_types, :display_name_translations, :jsonb, default: {}, null: false
8
+ add_column :search_engines, :display_name_translations, :jsonb, default: {}, null: false
9
+ add_column :shelves, :display_name_translations, :jsonb, default: {}, null: false
10
+ add_column :user_groups, :display_name_translations, :jsonb, default: {}, null: false
11
+ end
12
+ end
@@ -0,0 +1,6 @@
1
+ class AddLoginBannerTranslationsToLibraryGroup < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :library_groups, :login_banner_translations, :jsonb, default: {}, null: false
4
+ add_column :library_groups, :footer_banner_translations, :jsonb, default: {}, null: false
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddDisplayNameTranslationsToRole < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :roles, :display_name_translations, :jsonb, default: {}, null: false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddDisplayNameTranslationsToCirculationStatus < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :circulation_statuses, :display_name_translations, :jsonb, default: {}, null: false
4
+ end
5
+ end
@@ -0,0 +1,21 @@
1
+ class AddDisplayNameTranslationsToCarrierType < ActiveRecord::Migration[5.2]
2
+ def change
3
+ [
4
+ :agent_relationship_types,
5
+ :agent_types,
6
+ :carrier_types,
7
+ :content_types,
8
+ :create_types,
9
+ :form_of_works,
10
+ :frequencies,
11
+ :languages,
12
+ :licenses,
13
+ :manifestation_relationship_types,
14
+ :medium_of_performances,
15
+ :produce_types,
16
+ :realize_types
17
+ ].each do |table|
18
+ add_column table, :display_name_translations, :jsonb, default: {}, null: false
19
+ end
20
+ end
21
+ end
@@ -0,0 +1,5 @@
1
+ class AddCheckoutIdToCheckin < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_reference :checkins, :checkout, foreign_key: true
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddProfileIdToUser < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_reference :users, :profile, foreign_key: true
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddFullNameTranslationsToProfile < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :profiles, :full_name_translations, :jsonb, default: {}, null: false
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddDisplayNameTranslationsToCheckoutType < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :checkout_types, :display_name_translations, :jsonb, default: {}, null: false
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddEmailToLibraryGroup < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :library_groups, :email, :string
4
+ add_index :library_groups, :email
5
+ end
6
+ end
@@ -12,24 +12,49 @@
12
12
 
13
13
  ActiveRecord::Schema.define(version: 2019_12_30_082846) do
14
14
 
15
+ # These are extensions that must be enabled in order to support this database
16
+ enable_extension "pgcrypto"
17
+ enable_extension "plpgsql"
18
+
15
19
  create_table "accepts", force: :cascade do |t|
16
- t.integer "basket_id"
17
- t.integer "item_id"
18
- t.integer "librarian_id"
19
- t.datetime "created_at"
20
- t.datetime "updated_at"
20
+ t.bigint "basket_id"
21
+ t.bigint "item_id"
22
+ t.bigint "librarian_id"
23
+ t.datetime "created_at", null: false
24
+ t.datetime "updated_at", null: false
21
25
  t.index ["basket_id"], name: "index_accepts_on_basket_id"
22
26
  t.index ["item_id"], name: "index_accepts_on_item_id"
23
27
  t.index ["librarian_id"], name: "index_accepts_on_librarian_id"
24
28
  end
25
29
 
30
+ create_table "active_storage_attachments", force: :cascade do |t|
31
+ t.string "name", null: false
32
+ t.string "record_type", null: false
33
+ t.bigint "record_id", null: false
34
+ t.bigint "blob_id", null: false
35
+ t.datetime "created_at", null: false
36
+ t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
37
+ t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
38
+ end
39
+
40
+ create_table "active_storage_blobs", force: :cascade do |t|
41
+ t.string "key", null: false
42
+ t.string "filename", null: false
43
+ t.string "content_type"
44
+ t.text "metadata"
45
+ t.bigint "byte_size", null: false
46
+ t.string "checksum", null: false
47
+ t.datetime "created_at", null: false
48
+ t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
49
+ end
50
+
26
51
  create_table "agent_import_file_transitions", force: :cascade do |t|
27
52
  t.string "to_state"
28
53
  t.text "metadata", default: "{}"
29
54
  t.integer "sort_key"
30
55
  t.integer "agent_import_file_id"
31
- t.datetime "created_at"
32
- t.datetime "updated_at"
56
+ t.datetime "created_at", null: false
57
+ t.datetime "updated_at", null: false
33
58
  t.boolean "most_recent", null: false
34
59
  t.index ["agent_import_file_id", "most_recent"], name: "index_agent_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
35
60
  t.index ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
@@ -47,8 +72,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
47
72
  t.string "agent_import_content_type"
48
73
  t.integer "agent_import_file_size"
49
74
  t.datetime "agent_import_updated_at"
50
- t.datetime "created_at"
51
- t.datetime "updated_at"
75
+ t.datetime "created_at", null: false
76
+ t.datetime "updated_at", null: false
52
77
  t.string "agent_import_fingerprint"
53
78
  t.text "error_message"
54
79
  t.string "edit_mode"
@@ -61,21 +86,21 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
61
86
  t.integer "agent_import_file_id"
62
87
  t.integer "agent_id"
63
88
  t.text "body"
64
- t.datetime "created_at"
65
- t.datetime "updated_at"
89
+ t.datetime "created_at", null: false
90
+ t.datetime "updated_at", null: false
66
91
  end
67
92
 
68
93
  create_table "agent_merge_lists", force: :cascade do |t|
69
94
  t.string "title"
70
- t.datetime "created_at"
71
- t.datetime "updated_at"
95
+ t.datetime "created_at", null: false
96
+ t.datetime "updated_at", null: false
72
97
  end
73
98
 
74
99
  create_table "agent_merges", force: :cascade do |t|
75
100
  t.integer "agent_id", null: false
76
101
  t.integer "agent_merge_list_id", null: false
77
- t.datetime "created_at"
78
- t.datetime "updated_at"
102
+ t.datetime "created_at", null: false
103
+ t.datetime "updated_at", null: false
79
104
  t.index ["agent_id"], name: "index_agent_merges_on_agent_id"
80
105
  t.index ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
81
106
  end
@@ -85,16 +110,17 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
85
110
  t.text "display_name"
86
111
  t.text "note"
87
112
  t.integer "position"
88
- t.datetime "created_at"
89
- t.datetime "updated_at"
113
+ t.datetime "created_at", null: false
114
+ t.datetime "updated_at", null: false
115
+ t.jsonb "display_name_translations", default: {}, null: false
90
116
  end
91
117
 
92
118
  create_table "agent_relationships", force: :cascade do |t|
93
119
  t.integer "parent_id"
94
120
  t.integer "child_id"
95
121
  t.integer "agent_relationship_type_id"
96
- t.datetime "created_at"
97
- t.datetime "updated_at"
122
+ t.datetime "created_at", null: false
123
+ t.datetime "updated_at", null: false
98
124
  t.integer "position"
99
125
  t.index ["child_id"], name: "index_agent_relationships_on_child_id"
100
126
  t.index ["parent_id"], name: "index_agent_relationships_on_parent_id"
@@ -105,8 +131,9 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
105
131
  t.text "display_name"
106
132
  t.text "note"
107
133
  t.integer "position"
108
- t.datetime "created_at"
109
- t.datetime "updated_at"
134
+ t.datetime "created_at", null: false
135
+ t.datetime "updated_at", null: false
136
+ t.jsonb "display_name_translations", default: {}, null: false
110
137
  end
111
138
 
112
139
  create_table "agents", force: :cascade do |t|
@@ -121,9 +148,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
121
148
  t.string "full_name"
122
149
  t.text "full_name_transcription"
123
150
  t.text "full_name_alternative"
124
- t.datetime "created_at"
125
- t.datetime "updated_at"
126
- t.datetime "deleted_at"
151
+ t.datetime "created_at", null: false
152
+ t.datetime "updated_at", null: false
127
153
  t.string "zip_code_1"
128
154
  t.string "zip_code_2"
129
155
  t.text "address_1"
@@ -165,11 +191,11 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
165
191
  end
166
192
 
167
193
  create_table "baskets", force: :cascade do |t|
168
- t.integer "user_id"
194
+ t.bigint "user_id"
169
195
  t.text "note"
170
196
  t.integer "lock_version", default: 0, null: false
171
- t.datetime "created_at"
172
- t.datetime "updated_at"
197
+ t.datetime "created_at", null: false
198
+ t.datetime "updated_at", null: false
173
199
  t.index ["user_id"], name: "index_baskets_on_user_id"
174
200
  end
175
201
 
@@ -182,9 +208,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
182
208
  t.string "fax_number"
183
209
  t.string "url"
184
210
  t.integer "position"
185
- t.datetime "deleted_at"
186
- t.datetime "created_at"
187
- t.datetime "updated_at"
211
+ t.datetime "created_at", null: false
212
+ t.datetime "updated_at", null: false
188
213
  end
189
214
 
190
215
  create_table "budget_types", force: :cascade do |t|
@@ -192,8 +217,9 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
192
217
  t.text "display_name"
193
218
  t.text "note"
194
219
  t.integer "position"
195
- t.datetime "created_at"
196
- t.datetime "updated_at"
220
+ t.datetime "created_at", null: false
221
+ t.datetime "updated_at", null: false
222
+ t.jsonb "display_name_translations", default: {}, null: false
197
223
  end
198
224
 
199
225
  create_table "carrier_types", force: :cascade do |t|
@@ -201,12 +227,93 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
201
227
  t.text "display_name"
202
228
  t.text "note"
203
229
  t.integer "position"
204
- t.datetime "created_at"
205
- t.datetime "updated_at"
230
+ t.datetime "created_at", null: false
231
+ t.datetime "updated_at", null: false
206
232
  t.string "attachment_file_name"
207
233
  t.string "attachment_content_type"
208
- t.integer "attachment_file_size"
234
+ t.bigint "attachment_file_size"
209
235
  t.datetime "attachment_updated_at"
236
+ t.jsonb "display_name_translations", default: {}, null: false
237
+ end
238
+
239
+ create_table "checked_items", force: :cascade do |t|
240
+ t.bigint "item_id", null: false
241
+ t.bigint "basket_id", null: false
242
+ t.bigint "librarian_id"
243
+ t.datetime "due_date", null: false
244
+ t.datetime "created_at", null: false
245
+ t.datetime "updated_at", null: false
246
+ t.bigint "user_id"
247
+ t.index ["basket_id"], name: "index_checked_items_on_basket_id"
248
+ t.index ["item_id"], name: "index_checked_items_on_item_id"
249
+ t.index ["librarian_id"], name: "index_checked_items_on_librarian_id"
250
+ t.index ["user_id"], name: "index_checked_items_on_user_id"
251
+ end
252
+
253
+ create_table "checkins", force: :cascade do |t|
254
+ t.bigint "librarian_id"
255
+ t.bigint "basket_id"
256
+ t.datetime "created_at", null: false
257
+ t.datetime "updated_at", null: false
258
+ t.integer "lock_version", default: 0, null: false
259
+ t.bigint "checkout_id"
260
+ t.index ["basket_id"], name: "index_checkins_on_basket_id"
261
+ t.index ["checkout_id"], name: "index_checkins_on_checkout_id"
262
+ t.index ["librarian_id"], name: "index_checkins_on_librarian_id"
263
+ end
264
+
265
+ create_table "checkout_stat_has_manifestations", force: :cascade do |t|
266
+ t.bigint "manifestation_checkout_stat_id", null: false
267
+ t.bigint "manifestation_id", null: false
268
+ t.integer "checkouts_count"
269
+ t.datetime "created_at", null: false
270
+ t.datetime "updated_at", null: false
271
+ t.index ["manifestation_checkout_stat_id"], name: "index_checkout_stat_has_manifestations_on_checkout_stat_id"
272
+ t.index ["manifestation_id"], name: "index_checkout_stat_has_manifestations_on_manifestation_id"
273
+ end
274
+
275
+ create_table "checkout_stat_has_users", force: :cascade do |t|
276
+ t.bigint "user_checkout_stat_id", null: false
277
+ t.bigint "user_id", null: false
278
+ t.integer "checkouts_count", default: 0, null: false
279
+ t.datetime "created_at", null: false
280
+ t.datetime "updated_at", null: false
281
+ t.index ["user_checkout_stat_id"], name: "index_checkout_stat_has_users_on_user_checkout_stat_id"
282
+ t.index ["user_id"], name: "index_checkout_stat_has_users_on_user_id"
283
+ end
284
+
285
+ create_table "checkout_types", force: :cascade do |t|
286
+ t.string "name", null: false
287
+ t.text "display_name"
288
+ t.text "note"
289
+ t.integer "position"
290
+ t.datetime "created_at", null: false
291
+ t.datetime "updated_at", null: false
292
+ t.jsonb "display_name_translations", default: {}, null: false
293
+ t.index ["name"], name: "index_checkout_types_on_name"
294
+ end
295
+
296
+ create_table "checkouts", force: :cascade do |t|
297
+ t.bigint "user_id"
298
+ t.bigint "item_id", null: false
299
+ t.bigint "checkin_id"
300
+ t.bigint "librarian_id"
301
+ t.bigint "basket_id"
302
+ t.datetime "due_date"
303
+ t.integer "checkout_renewal_count", default: 0, null: false
304
+ t.integer "lock_version", default: 0, null: false
305
+ t.datetime "created_at", null: false
306
+ t.datetime "updated_at", null: false
307
+ t.bigint "shelf_id"
308
+ t.bigint "library_id"
309
+ t.index ["basket_id"], name: "index_checkouts_on_basket_id"
310
+ t.index ["checkin_id"], name: "index_checkouts_on_checkin_id"
311
+ t.index ["item_id", "basket_id"], name: "index_checkouts_on_item_id_and_basket_id", unique: true
312
+ t.index ["item_id"], name: "index_checkouts_on_item_id"
313
+ t.index ["librarian_id"], name: "index_checkouts_on_librarian_id"
314
+ t.index ["library_id"], name: "index_checkouts_on_library_id"
315
+ t.index ["shelf_id"], name: "index_checkouts_on_shelf_id"
316
+ t.index ["user_id"], name: "index_checkouts_on_user_id"
210
317
  end
211
318
 
212
319
  create_table "circulation_statuses", force: :cascade do |t|
@@ -214,17 +321,18 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
214
321
  t.text "display_name"
215
322
  t.text "note"
216
323
  t.integer "position"
217
- t.datetime "created_at"
218
- t.datetime "updated_at"
324
+ t.datetime "created_at", null: false
325
+ t.datetime "updated_at", null: false
326
+ t.jsonb "display_name_translations", default: {}, null: false
219
327
  end
220
328
 
221
329
  create_table "colors", force: :cascade do |t|
222
- t.integer "library_group_id"
330
+ t.bigint "library_group_id"
223
331
  t.string "property"
224
332
  t.string "code"
225
333
  t.integer "position"
226
- t.datetime "created_at"
227
- t.datetime "updated_at"
334
+ t.datetime "created_at", null: false
335
+ t.datetime "updated_at", null: false
228
336
  t.index ["library_group_id"], name: "index_colors_on_library_group_id"
229
337
  end
230
338
 
@@ -233,8 +341,9 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
233
341
  t.text "display_name"
234
342
  t.text "note"
235
343
  t.integer "position"
236
- t.datetime "created_at"
237
- t.datetime "updated_at"
344
+ t.datetime "created_at", null: false
345
+ t.datetime "updated_at", null: false
346
+ t.jsonb "display_name_translations", default: {}, null: false
238
347
  end
239
348
 
240
349
  create_table "countries", force: :cascade do |t|
@@ -256,16 +365,17 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
256
365
  t.text "display_name"
257
366
  t.text "note"
258
367
  t.integer "position"
259
- t.datetime "created_at"
260
- t.datetime "updated_at"
368
+ t.datetime "created_at", null: false
369
+ t.datetime "updated_at", null: false
370
+ t.jsonb "display_name_translations", default: {}, null: false
261
371
  end
262
372
 
263
373
  create_table "creates", force: :cascade do |t|
264
- t.integer "agent_id", null: false
265
- t.integer "work_id", null: false
374
+ t.bigint "agent_id", null: false
375
+ t.bigint "work_id", null: false
266
376
  t.integer "position"
267
- t.datetime "created_at"
268
- t.datetime "updated_at"
377
+ t.datetime "created_at", null: false
378
+ t.datetime "updated_at", null: false
269
379
  t.integer "create_type_id"
270
380
  t.index ["agent_id"], name: "index_creates_on_agent_id"
271
381
  t.index ["work_id"], name: "index_creates_on_work_id"
@@ -280,41 +390,46 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
280
390
  t.datetime "updated_at", null: false
281
391
  end
282
392
 
393
+ create_table "demands", force: :cascade do |t|
394
+ t.bigint "user_id"
395
+ t.bigint "item_id"
396
+ t.bigint "message_id"
397
+ t.datetime "created_at", null: false
398
+ t.datetime "updated_at", null: false
399
+ t.index ["item_id"], name: "index_demands_on_item_id"
400
+ t.index ["message_id"], name: "index_demands_on_message_id"
401
+ t.index ["user_id"], name: "index_demands_on_user_id"
402
+ end
403
+
404
+ create_table "doi_records", force: :cascade do |t|
405
+ t.string "body", null: false
406
+ t.string "display_body", null: false
407
+ t.string "source"
408
+ t.jsonb "response", default: {}, null: false
409
+ t.bigint "manifestation_id", null: false
410
+ t.datetime "created_at", null: false
411
+ t.datetime "updated_at", null: false
412
+ t.index ["body"], name: "index_doi_records_on_body", unique: true
413
+ t.index ["manifestation_id"], name: "index_doi_records_on_manifestation_id"
414
+ end
415
+
283
416
  create_table "donates", force: :cascade do |t|
284
417
  t.integer "agent_id", null: false
285
418
  t.integer "item_id", null: false
286
- t.datetime "created_at"
287
- t.datetime "updated_at"
419
+ t.datetime "created_at", null: false
420
+ t.datetime "updated_at", null: false
288
421
  t.index ["agent_id"], name: "index_donates_on_agent_id"
289
422
  t.index ["item_id"], name: "index_donates_on_item_id"
290
423
  end
291
424
 
292
- create_table "exemplifies", force: :cascade do |t|
293
- t.integer "manifestation_id", null: false
294
- t.integer "item_id", null: false
295
- t.integer "position"
296
- t.datetime "created_at"
297
- t.datetime "updated_at"
298
- t.index ["item_id"], name: "index_exemplifies_on_item_id", unique: true
299
- t.index ["manifestation_id"], name: "index_exemplifies_on_manifestation_id"
300
- end
301
-
302
- create_table "extents", force: :cascade do |t|
303
- t.string "name", null: false
304
- t.text "display_name"
305
- t.text "note"
306
- t.integer "position"
307
- t.datetime "created_at"
308
- t.datetime "updated_at"
309
- end
310
-
311
425
  create_table "form_of_works", force: :cascade do |t|
312
426
  t.string "name", null: false
313
427
  t.text "display_name"
314
428
  t.text "note"
315
429
  t.integer "position"
316
- t.datetime "created_at"
317
- t.datetime "updated_at"
430
+ t.datetime "created_at", null: false
431
+ t.datetime "updated_at", null: false
432
+ t.jsonb "display_name_translations", default: {}, null: false
318
433
  end
319
434
 
320
435
  create_table "frequencies", force: :cascade do |t|
@@ -322,8 +437,9 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
322
437
  t.text "display_name"
323
438
  t.text "note"
324
439
  t.integer "position"
325
- t.datetime "created_at"
326
- t.datetime "updated_at"
440
+ t.datetime "created_at", null: false
441
+ t.datetime "updated_at", null: false
442
+ t.jsonb "display_name_translations", default: {}, null: false
327
443
  end
328
444
 
329
445
  create_table "identifier_types", force: :cascade do |t|
@@ -331,8 +447,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
331
447
  t.text "display_name"
332
448
  t.text "note"
333
449
  t.integer "position"
334
- t.datetime "created_at"
335
- t.datetime "updated_at"
450
+ t.datetime "created_at", null: false
451
+ t.datetime "updated_at", null: false
336
452
  end
337
453
 
338
454
  create_table "identifiers", force: :cascade do |t|
@@ -341,8 +457,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
341
457
  t.integer "manifestation_id"
342
458
  t.boolean "primary"
343
459
  t.integer "position"
344
- t.datetime "created_at"
345
- t.datetime "updated_at"
460
+ t.datetime "created_at", null: false
461
+ t.datetime "updated_at", null: false
346
462
  t.index ["body", "identifier_type_id"], name: "index_identifiers_on_body_and_identifier_type_id"
347
463
  t.index ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
348
464
  end
@@ -352,8 +468,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
352
468
  t.text "metadata", default: "{}"
353
469
  t.integer "sort_key"
354
470
  t.integer "import_request_id"
355
- t.datetime "created_at"
356
- t.datetime "updated_at"
471
+ t.datetime "created_at", null: false
472
+ t.datetime "updated_at", null: false
357
473
  t.boolean "most_recent", null: false
358
474
  t.index ["import_request_id", "most_recent"], name: "index_import_request_transitions_parent_most_recent", unique: true, where: "most_recent"
359
475
  t.index ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
@@ -364,21 +480,21 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
364
480
  t.string "isbn"
365
481
  t.integer "manifestation_id"
366
482
  t.integer "user_id"
367
- t.datetime "created_at"
368
- t.datetime "updated_at"
483
+ t.datetime "created_at", null: false
484
+ t.datetime "updated_at", null: false
369
485
  t.index ["isbn"], name: "index_import_requests_on_isbn"
370
486
  t.index ["manifestation_id"], name: "index_import_requests_on_manifestation_id"
371
487
  t.index ["user_id"], name: "index_import_requests_on_user_id"
372
488
  end
373
489
 
374
490
  create_table "inventories", force: :cascade do |t|
375
- t.integer "item_id"
376
- t.integer "inventory_file_id"
491
+ t.bigint "item_id"
492
+ t.bigint "inventory_file_id"
377
493
  t.text "note"
378
- t.datetime "created_at"
379
- t.datetime "updated_at"
380
- t.string "item_identifier"
381
- t.string "current_shelf_name"
494
+ t.datetime "created_at", null: false
495
+ t.datetime "updated_at", null: false
496
+ t.string "item_identifier", null: false
497
+ t.string "current_shelf_name", null: false
382
498
  t.index ["current_shelf_name"], name: "index_inventories_on_current_shelf_name"
383
499
  t.index ["inventory_file_id"], name: "index_inventories_on_inventory_file_id"
384
500
  t.index ["item_id"], name: "index_inventories_on_item_id"
@@ -386,29 +502,72 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
386
502
  end
387
503
 
388
504
  create_table "inventory_files", force: :cascade do |t|
389
- t.string "filename"
390
- t.string "content_type"
391
- t.integer "size"
392
- t.integer "user_id"
505
+ t.bigint "user_id"
393
506
  t.text "note"
394
- t.datetime "created_at"
395
- t.datetime "updated_at"
507
+ t.datetime "created_at", null: false
508
+ t.datetime "updated_at", null: false
396
509
  t.string "inventory_file_name"
397
510
  t.string "inventory_content_type"
398
511
  t.integer "inventory_file_size"
399
512
  t.datetime "inventory_updated_at"
400
513
  t.string "inventory_fingerprint"
401
- t.integer "shelf_id"
514
+ t.bigint "shelf_id", null: false
402
515
  t.index ["shelf_id"], name: "index_inventory_files_on_shelf_id"
403
516
  t.index ["user_id"], name: "index_inventory_files_on_user_id"
404
517
  end
405
518
 
519
+ create_table "isbn_record_and_manifestations", force: :cascade do |t|
520
+ t.bigint "isbn_record_id", null: false
521
+ t.bigint "manifestation_id", null: false
522
+ t.integer "position"
523
+ t.datetime "created_at", null: false
524
+ t.datetime "updated_at", null: false
525
+ t.index ["isbn_record_id"], name: "index_isbn_record_and_manifestations_on_isbn_record_id"
526
+ t.index ["manifestation_id"], name: "index_isbn_record_and_manifestations_on_manifestation_id"
527
+ end
528
+
529
+ create_table "isbn_records", force: :cascade do |t|
530
+ t.string "body", null: false
531
+ t.string "isbn_type"
532
+ t.string "source"
533
+ t.datetime "created_at", null: false
534
+ t.datetime "updated_at", null: false
535
+ t.index ["body"], name: "index_isbn_records_on_body", unique: true
536
+ end
537
+
538
+ create_table "issn_record_and_manifestations", force: :cascade do |t|
539
+ t.bigint "issn_record_id", null: false
540
+ t.bigint "manifestation_id", null: false
541
+ t.integer "position"
542
+ t.datetime "created_at", null: false
543
+ t.datetime "updated_at", null: false
544
+ t.index ["issn_record_id"], name: "index_issn_record_and_manifestations_on_issn_record_id"
545
+ t.index ["manifestation_id"], name: "index_issn_record_and_manifestations_on_manifestation_id"
546
+ end
547
+
548
+ create_table "issn_records", force: :cascade do |t|
549
+ t.string "body", null: false
550
+ t.string "issn_type"
551
+ t.string "source"
552
+ t.datetime "created_at", null: false
553
+ t.datetime "updated_at", null: false
554
+ t.index ["body"], name: "index_issn_records_on_body", unique: true
555
+ end
556
+
557
+ create_table "item_has_use_restrictions", force: :cascade do |t|
558
+ t.bigint "item_id", null: false
559
+ t.bigint "use_restriction_id", null: false
560
+ t.datetime "created_at", null: false
561
+ t.datetime "updated_at", null: false
562
+ t.index ["item_id"], name: "index_item_has_use_restrictions_on_item_id"
563
+ t.index ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
564
+ end
565
+
406
566
  create_table "items", force: :cascade do |t|
407
567
  t.string "call_number"
408
568
  t.string "item_identifier"
409
- t.datetime "created_at"
410
- t.datetime "updated_at"
411
- t.datetime "deleted_at"
569
+ t.datetime "created_at", null: false
570
+ t.datetime "updated_at", null: false
412
571
  t.integer "shelf_id", default: 1, null: false
413
572
  t.boolean "include_supplements", default: false, null: false
414
573
  t.text "note"
@@ -446,6 +605,7 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
446
605
  t.string "iso_639_3"
447
606
  t.text "note"
448
607
  t.integer "position"
608
+ t.jsonb "display_name_translations", default: {}, null: false
449
609
  t.index ["iso_639_1"], name: "index_languages_on_iso_639_1"
450
610
  t.index ["iso_639_2"], name: "index_languages_on_iso_639_2"
451
611
  t.index ["iso_639_3"], name: "index_languages_on_iso_639_3"
@@ -466,32 +626,22 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
466
626
  t.text "note"
467
627
  t.integer "call_number_rows", default: 1, null: false
468
628
  t.string "call_number_delimiter", default: "|", null: false
469
- t.integer "library_group_id", null: false
629
+ t.bigint "library_group_id", null: false
470
630
  t.integer "users_count", default: 0, null: false
471
631
  t.integer "position"
472
- t.integer "country_id"
473
- t.datetime "created_at"
474
- t.datetime "updated_at"
475
- t.datetime "deleted_at"
632
+ t.bigint "country_id"
633
+ t.datetime "created_at", null: false
634
+ t.datetime "updated_at", null: false
476
635
  t.text "opening_hour"
477
636
  t.string "isil"
478
637
  t.float "latitude"
479
638
  t.float "longitude"
639
+ t.jsonb "display_name_translations", default: {}, null: false
640
+ t.index ["country_id"], name: "index_libraries_on_country_id"
480
641
  t.index ["library_group_id"], name: "index_libraries_on_library_group_id"
481
642
  t.index ["name"], name: "index_libraries_on_name"
482
643
  end
483
644
 
484
- create_table "library_group_translations", force: :cascade do |t|
485
- t.integer "library_group_id", null: false
486
- t.string "locale", null: false
487
- t.datetime "created_at", null: false
488
- t.datetime "updated_at", null: false
489
- t.text "login_banner"
490
- t.text "footer_banner"
491
- t.index ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
492
- t.index ["locale"], name: "index_library_group_translations_on_locale"
493
- end
494
-
495
645
  create_table "library_groups", force: :cascade do |t|
496
646
  t.string "name", null: false
497
647
  t.text "display_name"
@@ -501,8 +651,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
501
651
  t.text "note"
502
652
  t.integer "country_id"
503
653
  t.integer "position"
504
- t.datetime "created_at"
505
- t.datetime "updated_at"
654
+ t.datetime "created_at", null: false
655
+ t.datetime "updated_at", null: false
506
656
  t.text "admin_networks"
507
657
  t.string "url", default: "http://localhost:3000/"
508
658
  t.text "settings"
@@ -510,13 +660,18 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
510
660
  t.integer "max_number_of_results", default: 500
511
661
  t.boolean "family_name_first", default: true
512
662
  t.integer "pub_year_facet_range_interval", default: 10
513
- t.integer "user_id"
663
+ t.bigint "user_id"
514
664
  t.boolean "csv_charset_conversion", default: false, null: false
515
665
  t.string "header_logo_file_name"
516
666
  t.string "header_logo_content_type"
517
- t.integer "header_logo_file_size"
667
+ t.bigint "header_logo_file_size"
518
668
  t.datetime "header_logo_updated_at"
519
669
  t.text "header_logo_meta"
670
+ t.jsonb "display_name_translations", default: {}, null: false
671
+ t.jsonb "login_banner_translations", default: {}, null: false
672
+ t.jsonb "footer_banner_translations", default: {}, null: false
673
+ t.string "email"
674
+ t.index ["email"], name: "index_library_groups_on_email"
520
675
  t.index ["short_name"], name: "index_library_groups_on_short_name"
521
676
  t.index ["user_id"], name: "index_library_groups_on_user_id"
522
677
  end
@@ -526,8 +681,34 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
526
681
  t.string "display_name"
527
682
  t.text "note"
528
683
  t.integer "position"
529
- t.datetime "created_at"
530
- t.datetime "updated_at"
684
+ t.datetime "created_at", null: false
685
+ t.datetime "updated_at", null: false
686
+ t.jsonb "display_name_translations", default: {}, null: false
687
+ end
688
+
689
+ create_table "manifestation_checkout_stat_transitions", force: :cascade do |t|
690
+ t.string "to_state"
691
+ t.text "metadata", default: "{}"
692
+ t.integer "sort_key"
693
+ t.integer "manifestation_checkout_stat_id"
694
+ t.datetime "created_at", null: false
695
+ t.datetime "updated_at", null: false
696
+ t.boolean "most_recent", null: false
697
+ t.index ["manifestation_checkout_stat_id", "most_recent"], name: "index_manifestation_checkout_stat_transitions_parent_most_rece", unique: true, where: "most_recent"
698
+ t.index ["manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_stat_id"
699
+ t.index ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
700
+ end
701
+
702
+ create_table "manifestation_checkout_stats", force: :cascade do |t|
703
+ t.datetime "start_date"
704
+ t.datetime "end_date"
705
+ t.text "note"
706
+ t.datetime "created_at", null: false
707
+ t.datetime "updated_at", null: false
708
+ t.datetime "started_at"
709
+ t.datetime "completed_at"
710
+ t.bigint "user_id"
711
+ t.index ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
531
712
  end
532
713
 
533
714
  create_table "manifestation_relationship_types", force: :cascade do |t|
@@ -535,21 +716,47 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
535
716
  t.text "display_name"
536
717
  t.text "note"
537
718
  t.integer "position"
538
- t.datetime "created_at"
539
- t.datetime "updated_at"
719
+ t.datetime "created_at", null: false
720
+ t.datetime "updated_at", null: false
721
+ t.jsonb "display_name_translations", default: {}, null: false
540
722
  end
541
723
 
542
724
  create_table "manifestation_relationships", force: :cascade do |t|
543
725
  t.integer "parent_id"
544
726
  t.integer "child_id"
545
727
  t.integer "manifestation_relationship_type_id"
546
- t.datetime "created_at"
547
- t.datetime "updated_at"
728
+ t.datetime "created_at", null: false
729
+ t.datetime "updated_at", null: false
548
730
  t.integer "position"
549
731
  t.index ["child_id"], name: "index_manifestation_relationships_on_child_id"
550
732
  t.index ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
551
733
  end
552
734
 
735
+ create_table "manifestation_reserve_stat_transitions", force: :cascade do |t|
736
+ t.string "to_state"
737
+ t.text "metadata", default: "{}"
738
+ t.integer "sort_key"
739
+ t.integer "manifestation_reserve_stat_id"
740
+ t.datetime "created_at", null: false
741
+ t.datetime "updated_at", null: false
742
+ t.boolean "most_recent", null: false
743
+ t.index ["manifestation_reserve_stat_id", "most_recent"], name: "index_manifestation_reserve_stat_transitions_parent_most_recen", unique: true, where: "most_recent"
744
+ t.index ["manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_stat_id"
745
+ t.index ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
746
+ end
747
+
748
+ create_table "manifestation_reserve_stats", force: :cascade do |t|
749
+ t.datetime "start_date"
750
+ t.datetime "end_date"
751
+ t.text "note"
752
+ t.datetime "created_at", null: false
753
+ t.datetime "updated_at", null: false
754
+ t.datetime "started_at"
755
+ t.datetime "completed_at"
756
+ t.bigint "user_id"
757
+ t.index ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
758
+ end
759
+
553
760
  create_table "manifestations", force: :cascade do |t|
554
761
  t.text "original_title", null: false
555
762
  t.text "title_alternative"
@@ -558,9 +765,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
558
765
  t.string "manifestation_identifier"
559
766
  t.datetime "date_of_publication"
560
767
  t.datetime "date_copyrighted"
561
- t.datetime "created_at"
562
- t.datetime "updated_at"
563
- t.datetime "deleted_at"
768
+ t.datetime "created_at", null: false
769
+ t.datetime "updated_at", null: false
564
770
  t.string "access_address"
565
771
  t.integer "language_id", default: 1, null: false
566
772
  t.integer "carrier_type_id", default: 1, null: false
@@ -604,7 +810,6 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
604
810
  t.text "attachment_meta"
605
811
  t.integer "month_of_publication"
606
812
  t.boolean "fulltext_content"
607
- t.string "doi"
608
813
  t.boolean "serial"
609
814
  t.text "statement_of_responsibility"
610
815
  t.text "publication_place"
@@ -613,7 +818,6 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
613
818
  t.text "memo"
614
819
  t.index ["access_address"], name: "index_manifestations_on_access_address"
615
820
  t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
616
- t.index ["doi"], name: "index_manifestations_on_doi"
617
821
  t.index ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier"
618
822
  t.index ["updated_at"], name: "index_manifestations_on_updated_at"
619
823
  end
@@ -623,8 +827,9 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
623
827
  t.text "display_name"
624
828
  t.text "note"
625
829
  t.integer "position"
626
- t.datetime "created_at"
627
- t.datetime "updated_at"
830
+ t.datetime "created_at", null: false
831
+ t.datetime "updated_at", null: false
832
+ t.jsonb "display_name_translations", default: {}, null: false
628
833
  end
629
834
 
630
835
  create_table "message_request_transitions", force: :cascade do |t|
@@ -632,22 +837,26 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
632
837
  t.text "metadata", default: "{}"
633
838
  t.integer "sort_key"
634
839
  t.integer "message_request_id"
635
- t.datetime "created_at"
636
- t.datetime "updated_at"
637
- t.boolean "most_recent"
840
+ t.datetime "created_at", null: false
841
+ t.datetime "updated_at", null: false
842
+ t.boolean "most_recent", null: false
843
+ t.index ["message_request_id", "most_recent"], name: "index_message_request_transitions_parent_most_recent", unique: true, where: "most_recent"
638
844
  t.index ["message_request_id"], name: "index_message_request_transitions_on_message_request_id"
639
845
  t.index ["sort_key", "message_request_id"], name: "index_message_request_transitions_on_sort_key_and_request_id", unique: true
640
846
  end
641
847
 
642
848
  create_table "message_requests", force: :cascade do |t|
643
- t.integer "sender_id"
644
- t.integer "receiver_id"
645
- t.integer "message_template_id"
849
+ t.bigint "sender_id"
850
+ t.bigint "receiver_id"
851
+ t.bigint "message_template_id"
646
852
  t.datetime "sent_at"
647
853
  t.datetime "deleted_at"
648
854
  t.text "body"
649
- t.datetime "created_at"
650
- t.datetime "updated_at"
855
+ t.datetime "created_at", null: false
856
+ t.datetime "updated_at", null: false
857
+ t.index ["message_template_id"], name: "index_message_requests_on_message_template_id"
858
+ t.index ["receiver_id"], name: "index_message_requests_on_receiver_id"
859
+ t.index ["sender_id"], name: "index_message_requests_on_sender_id"
651
860
  end
652
861
 
653
862
  create_table "message_templates", force: :cascade do |t|
@@ -656,8 +865,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
656
865
  t.text "body", null: false
657
866
  t.integer "position"
658
867
  t.string "locale", default: "en"
659
- t.datetime "created_at"
660
- t.datetime "updated_at"
868
+ t.datetime "created_at", null: false
869
+ t.datetime "updated_at", null: false
661
870
  t.index ["status"], name: "index_message_templates_on_status", unique: true
662
871
  end
663
872
 
@@ -666,23 +875,24 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
666
875
  t.text "metadata", default: "{}"
667
876
  t.integer "sort_key"
668
877
  t.integer "message_id"
669
- t.datetime "created_at"
670
- t.datetime "updated_at"
671
- t.boolean "most_recent"
878
+ t.datetime "created_at", null: false
879
+ t.datetime "updated_at", null: false
880
+ t.boolean "most_recent", null: false
881
+ t.index ["message_id", "most_recent"], name: "index_message_transitions_parent_most_recent", unique: true, where: "most_recent"
672
882
  t.index ["message_id"], name: "index_message_transitions_on_message_id"
673
883
  t.index ["sort_key", "message_id"], name: "index_message_transitions_on_sort_key_and_message_id", unique: true
674
884
  end
675
885
 
676
886
  create_table "messages", force: :cascade do |t|
677
887
  t.datetime "read_at"
678
- t.integer "receiver_id"
679
- t.integer "sender_id"
888
+ t.bigint "sender_id"
889
+ t.bigint "receiver_id"
680
890
  t.string "subject", null: false
681
891
  t.text "body"
682
- t.integer "message_request_id"
683
- t.integer "parent_id"
684
- t.datetime "created_at"
685
- t.datetime "updated_at"
892
+ t.bigint "message_request_id"
893
+ t.bigint "parent_id"
894
+ t.datetime "created_at", null: false
895
+ t.datetime "updated_at", null: false
686
896
  t.integer "lft"
687
897
  t.integer "rgt"
688
898
  t.integer "depth"
@@ -693,15 +903,34 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
693
903
  end
694
904
 
695
905
  create_table "owns", force: :cascade do |t|
696
- t.integer "agent_id", null: false
697
- t.integer "item_id", null: false
906
+ t.bigint "agent_id", null: false
907
+ t.bigint "item_id", null: false
698
908
  t.integer "position"
699
- t.datetime "created_at"
700
- t.datetime "updated_at"
909
+ t.datetime "created_at", null: false
910
+ t.datetime "updated_at", null: false
701
911
  t.index ["agent_id"], name: "index_owns_on_agent_id"
702
912
  t.index ["item_id"], name: "index_owns_on_item_id"
703
913
  end
704
914
 
915
+ create_table "periodical_and_manifestations", force: :cascade do |t|
916
+ t.bigint "periodical_id", null: false
917
+ t.bigint "manifestation_id", null: false
918
+ t.boolean "periodical_master", default: false, null: false
919
+ t.datetime "created_at", null: false
920
+ t.datetime "updated_at", null: false
921
+ t.index ["manifestation_id"], name: "index_periodical_and_manifestations_on_manifestation_id"
922
+ t.index ["periodical_id"], name: "index_periodical_and_manifestations_on_periodical_id"
923
+ t.index ["periodical_master"], name: "index_periodical_and_manifestations_on_periodical_master", unique: true, where: "(periodical_master IS TRUE)"
924
+ end
925
+
926
+ create_table "periodicals", force: :cascade do |t|
927
+ t.text "original_title", null: false
928
+ t.bigint "frequency_id", null: false
929
+ t.datetime "created_at", null: false
930
+ t.datetime "updated_at", null: false
931
+ t.index ["frequency_id"], name: "index_periodicals_on_frequency_id"
932
+ end
933
+
705
934
  create_table "picture_files", force: :cascade do |t|
706
935
  t.integer "picture_attachable_id"
707
936
  t.string "picture_attachable_type"
@@ -709,8 +938,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
709
938
  t.text "title"
710
939
  t.string "thumbnail"
711
940
  t.integer "position"
712
- t.datetime "created_at"
713
- t.datetime "updated_at"
941
+ t.datetime "created_at", null: false
942
+ t.datetime "updated_at", null: false
714
943
  t.string "picture_file_name"
715
944
  t.string "picture_content_type"
716
945
  t.integer "picture_file_size"
@@ -727,36 +956,43 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
727
956
  t.text "display_name"
728
957
  t.text "note"
729
958
  t.integer "position"
730
- t.datetime "created_at"
731
- t.datetime "updated_at"
959
+ t.datetime "created_at", null: false
960
+ t.datetime "updated_at", null: false
961
+ t.jsonb "display_name_translations", default: {}, null: false
732
962
  end
733
963
 
734
964
  create_table "produces", force: :cascade do |t|
735
- t.integer "agent_id", null: false
736
- t.integer "manifestation_id", null: false
965
+ t.bigint "agent_id", null: false
966
+ t.bigint "manifestation_id", null: false
737
967
  t.integer "position"
738
- t.datetime "created_at"
739
- t.datetime "updated_at"
968
+ t.datetime "created_at", null: false
969
+ t.datetime "updated_at", null: false
740
970
  t.integer "produce_type_id"
741
971
  t.index ["agent_id"], name: "index_produces_on_agent_id"
742
972
  t.index ["manifestation_id"], name: "index_produces_on_manifestation_id"
743
973
  end
744
974
 
745
975
  create_table "profiles", force: :cascade do |t|
746
- t.integer "user_id"
747
- t.integer "user_group_id"
748
- t.integer "library_id"
976
+ t.bigint "user_id"
977
+ t.bigint "user_group_id"
978
+ t.bigint "library_id"
749
979
  t.string "locale"
750
980
  t.string "user_number"
751
981
  t.text "full_name"
752
982
  t.text "note"
753
983
  t.text "keyword_list"
754
- t.integer "required_role_id"
755
- t.datetime "created_at"
756
- t.datetime "updated_at"
984
+ t.bigint "required_role_id"
985
+ t.datetime "created_at", null: false
986
+ t.datetime "updated_at", null: false
987
+ t.string "checkout_icalendar_token"
988
+ t.boolean "save_checkout_history", default: false, null: false
757
989
  t.datetime "expired_at"
758
990
  t.text "full_name_transcription"
759
991
  t.datetime "date_of_birth"
992
+ t.jsonb "full_name_translations", default: {}, null: false
993
+ t.index ["checkout_icalendar_token"], name: "index_profiles_on_checkout_icalendar_token", unique: true
994
+ t.index ["library_id"], name: "index_profiles_on_library_id"
995
+ t.index ["user_group_id"], name: "index_profiles_on_user_group_id"
760
996
  t.index ["user_id"], name: "index_profiles_on_user_id"
761
997
  t.index ["user_number"], name: "index_profiles_on_user_number", unique: true
762
998
  end
@@ -766,16 +1002,17 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
766
1002
  t.text "display_name"
767
1003
  t.text "note"
768
1004
  t.integer "position"
769
- t.datetime "created_at"
770
- t.datetime "updated_at"
1005
+ t.datetime "created_at", null: false
1006
+ t.datetime "updated_at", null: false
1007
+ t.jsonb "display_name_translations", default: {}, null: false
771
1008
  end
772
1009
 
773
1010
  create_table "realizes", force: :cascade do |t|
774
- t.integer "agent_id", null: false
775
- t.integer "expression_id", null: false
1011
+ t.bigint "agent_id", null: false
1012
+ t.bigint "expression_id", null: false
776
1013
  t.integer "position"
777
- t.datetime "created_at"
778
- t.datetime "updated_at"
1014
+ t.datetime "created_at", null: false
1015
+ t.datetime "updated_at", null: false
779
1016
  t.integer "realize_type_id"
780
1017
  t.index ["agent_id"], name: "index_realizes_on_agent_id"
781
1018
  t.index ["expression_id"], name: "index_realizes_on_expression_id"
@@ -786,8 +1023,9 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
786
1023
  t.text "display_name"
787
1024
  t.text "note"
788
1025
  t.integer "position"
789
- t.datetime "created_at"
790
- t.datetime "updated_at"
1026
+ t.datetime "created_at", null: false
1027
+ t.datetime "updated_at", null: false
1028
+ t.jsonb "display_name_translations", default: {}, null: false
791
1029
  end
792
1030
 
793
1031
  create_table "request_types", force: :cascade do |t|
@@ -795,8 +1033,66 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
795
1033
  t.text "display_name"
796
1034
  t.text "note"
797
1035
  t.integer "position"
798
- t.datetime "created_at"
799
- t.datetime "updated_at"
1036
+ t.datetime "created_at", null: false
1037
+ t.datetime "updated_at", null: false
1038
+ t.jsonb "display_name_translations", default: {}, null: false
1039
+ end
1040
+
1041
+ create_table "reserve_stat_has_manifestations", force: :cascade do |t|
1042
+ t.bigint "manifestation_reserve_stat_id", null: false
1043
+ t.bigint "manifestation_id", null: false
1044
+ t.integer "reserves_count"
1045
+ t.datetime "created_at", null: false
1046
+ t.datetime "updated_at", null: false
1047
+ t.index ["manifestation_id"], name: "index_reserve_stat_has_manifestations_on_manifestation_id"
1048
+ t.index ["manifestation_reserve_stat_id"], name: "index_reserve_stat_has_manifestations_on_m_reserve_stat_id"
1049
+ end
1050
+
1051
+ create_table "reserve_stat_has_users", force: :cascade do |t|
1052
+ t.bigint "user_reserve_stat_id", null: false
1053
+ t.bigint "user_id", null: false
1054
+ t.integer "reserves_count"
1055
+ t.datetime "created_at", null: false
1056
+ t.datetime "updated_at", null: false
1057
+ t.index ["user_id"], name: "index_reserve_stat_has_users_on_user_id"
1058
+ t.index ["user_reserve_stat_id"], name: "index_reserve_stat_has_users_on_user_reserve_stat_id"
1059
+ end
1060
+
1061
+ create_table "reserve_transitions", force: :cascade do |t|
1062
+ t.string "to_state"
1063
+ t.text "metadata", default: "{}"
1064
+ t.integer "sort_key"
1065
+ t.integer "reserve_id"
1066
+ t.datetime "created_at", null: false
1067
+ t.datetime "updated_at", null: false
1068
+ t.boolean "most_recent", null: false
1069
+ t.index ["reserve_id", "most_recent"], name: "index_reserve_transitions_parent_most_recent", unique: true, where: "most_recent"
1070
+ t.index ["reserve_id"], name: "index_reserve_transitions_on_reserve_id"
1071
+ t.index ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
1072
+ end
1073
+
1074
+ create_table "reserves", force: :cascade do |t|
1075
+ t.bigint "user_id", null: false
1076
+ t.bigint "manifestation_id", null: false
1077
+ t.bigint "item_id"
1078
+ t.bigint "request_status_type_id", null: false
1079
+ t.datetime "checked_out_at"
1080
+ t.datetime "created_at", null: false
1081
+ t.datetime "updated_at", null: false
1082
+ t.datetime "canceled_at"
1083
+ t.datetime "expired_at"
1084
+ t.datetime "deleted_at"
1085
+ t.boolean "expiration_notice_to_patron", default: false
1086
+ t.boolean "expiration_notice_to_library", default: false
1087
+ t.integer "pickup_location_id"
1088
+ t.datetime "retained_at"
1089
+ t.datetime "postponed_at"
1090
+ t.integer "lock_version", default: 0, null: false
1091
+ t.index ["item_id"], name: "index_reserves_on_item_id"
1092
+ t.index ["manifestation_id"], name: "index_reserves_on_manifestation_id"
1093
+ t.index ["pickup_location_id"], name: "index_reserves_on_pickup_location_id"
1094
+ t.index ["request_status_type_id"], name: "index_reserves_on_request_status_type_id"
1095
+ t.index ["user_id"], name: "index_reserves_on_user_id"
800
1096
  end
801
1097
 
802
1098
  create_table "resource_export_file_transitions", force: :cascade do |t|
@@ -804,8 +1100,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
804
1100
  t.text "metadata", default: "{}"
805
1101
  t.integer "sort_key"
806
1102
  t.integer "resource_export_file_id"
807
- t.datetime "created_at"
808
- t.datetime "updated_at"
1103
+ t.datetime "created_at", null: false
1104
+ t.datetime "updated_at", null: false
809
1105
  t.boolean "most_recent", null: false
810
1106
  t.index ["resource_export_file_id", "most_recent"], name: "index_resource_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
811
1107
  t.index ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
@@ -816,11 +1112,11 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
816
1112
  t.integer "user_id"
817
1113
  t.string "resource_export_file_name"
818
1114
  t.string "resource_export_content_type"
819
- t.integer "resource_export_file_size"
1115
+ t.bigint "resource_export_file_size"
820
1116
  t.datetime "resource_export_updated_at"
821
1117
  t.datetime "executed_at"
822
- t.datetime "created_at"
823
- t.datetime "updated_at"
1118
+ t.datetime "created_at", null: false
1119
+ t.datetime "updated_at", null: false
824
1120
  end
825
1121
 
826
1122
  create_table "resource_import_file_transitions", force: :cascade do |t|
@@ -828,8 +1124,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
828
1124
  t.text "metadata", default: "{}"
829
1125
  t.integer "sort_key"
830
1126
  t.integer "resource_import_file_id"
831
- t.datetime "created_at"
832
- t.datetime "updated_at"
1127
+ t.datetime "created_at", null: false
1128
+ t.datetime "updated_at", null: false
833
1129
  t.boolean "most_recent", null: false
834
1130
  t.index ["resource_import_file_id", "most_recent"], name: "index_resource_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
835
1131
  t.index ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
@@ -847,8 +1143,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
847
1143
  t.string "resource_import_content_type"
848
1144
  t.integer "resource_import_file_size"
849
1145
  t.datetime "resource_import_updated_at"
850
- t.datetime "created_at"
851
- t.datetime "updated_at"
1146
+ t.datetime "created_at", null: false
1147
+ t.datetime "updated_at", null: false
852
1148
  t.string "edit_mode"
853
1149
  t.string "resource_import_fingerprint"
854
1150
  t.text "error_message"
@@ -863,14 +1159,23 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
863
1159
  t.integer "manifestation_id"
864
1160
  t.integer "item_id"
865
1161
  t.text "body"
866
- t.datetime "created_at"
867
- t.datetime "updated_at"
1162
+ t.datetime "created_at", null: false
1163
+ t.datetime "updated_at", null: false
868
1164
  t.text "error_message"
869
1165
  t.index ["item_id"], name: "index_resource_import_results_on_item_id"
870
1166
  t.index ["manifestation_id"], name: "index_resource_import_results_on_manifestation_id"
871
1167
  t.index ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
872
1168
  end
873
1169
 
1170
+ create_table "retains", force: :cascade do |t|
1171
+ t.bigint "reserve_id", null: false
1172
+ t.bigint "item_id", null: false
1173
+ t.datetime "created_at", null: false
1174
+ t.datetime "updated_at", null: false
1175
+ t.index ["item_id"], name: "index_retains_on_item_id"
1176
+ t.index ["reserve_id"], name: "index_retains_on_reserve_id"
1177
+ end
1178
+
874
1179
  create_table "roles", force: :cascade do |t|
875
1180
  t.string "name", null: false
876
1181
  t.string "display_name"
@@ -879,6 +1184,7 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
879
1184
  t.datetime "updated_at"
880
1185
  t.integer "score", default: 0, null: false
881
1186
  t.integer "position"
1187
+ t.jsonb "display_name_translations", default: {}, null: false
882
1188
  end
883
1189
 
884
1190
  create_table "search_engines", force: :cascade do |t|
@@ -891,21 +1197,22 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
891
1197
  t.text "additional_param"
892
1198
  t.text "note"
893
1199
  t.integer "position"
894
- t.datetime "created_at"
895
- t.datetime "updated_at"
1200
+ t.datetime "created_at", null: false
1201
+ t.datetime "updated_at", null: false
1202
+ t.jsonb "display_name_translations", default: {}, null: false
896
1203
  end
897
1204
 
898
1205
  create_table "series_statement_merge_lists", force: :cascade do |t|
899
1206
  t.string "title"
900
- t.datetime "created_at"
901
- t.datetime "updated_at"
1207
+ t.datetime "created_at", null: false
1208
+ t.datetime "updated_at", null: false
902
1209
  end
903
1210
 
904
1211
  create_table "series_statement_merges", force: :cascade do |t|
905
1212
  t.integer "series_statement_id", null: false
906
1213
  t.integer "series_statement_merge_list_id", null: false
907
- t.datetime "created_at"
908
- t.datetime "updated_at"
1214
+ t.datetime "created_at", null: false
1215
+ t.datetime "updated_at", null: false
909
1216
  t.index ["series_statement_id"], name: "index_series_statement_merges_on_series_statement_id"
910
1217
  t.index ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
911
1218
  end
@@ -916,8 +1223,8 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
916
1223
  t.text "title_subseries"
917
1224
  t.text "numbering_subseries"
918
1225
  t.integer "position"
919
- t.datetime "created_at"
920
- t.datetime "updated_at"
1226
+ t.datetime "created_at", null: false
1227
+ t.datetime "updated_at", null: false
921
1228
  t.text "title_transcription"
922
1229
  t.text "title_alternative"
923
1230
  t.string "series_statement_identifier"
@@ -938,23 +1245,23 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
938
1245
  t.string "name", null: false
939
1246
  t.text "display_name"
940
1247
  t.text "note"
941
- t.integer "library_id", null: false
1248
+ t.bigint "library_id", null: false
942
1249
  t.integer "items_count", default: 0, null: false
943
1250
  t.integer "position"
944
- t.datetime "created_at"
945
- t.datetime "updated_at"
946
- t.datetime "deleted_at"
1251
+ t.datetime "created_at", null: false
1252
+ t.datetime "updated_at", null: false
947
1253
  t.boolean "closed", default: false, null: false
1254
+ t.jsonb "display_name_translations", default: {}, null: false
948
1255
  t.index ["library_id"], name: "index_shelves_on_library_id"
949
1256
  end
950
1257
 
951
1258
  create_table "subscribes", force: :cascade do |t|
952
- t.integer "subscription_id", null: false
1259
+ t.bigint "subscription_id", null: false
953
1260
  t.integer "work_id", null: false
954
1261
  t.datetime "start_at", null: false
955
1262
  t.datetime "end_at", null: false
956
- t.datetime "created_at"
957
- t.datetime "updated_at"
1263
+ t.datetime "created_at", null: false
1264
+ t.datetime "updated_at", null: false
958
1265
  t.index ["subscription_id"], name: "index_subscribes_on_subscription_id"
959
1266
  t.index ["work_id"], name: "index_subscribes_on_work_id"
960
1267
  end
@@ -962,23 +1269,56 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
962
1269
  create_table "subscriptions", force: :cascade do |t|
963
1270
  t.text "title", null: false
964
1271
  t.text "note"
965
- t.integer "user_id"
966
- t.integer "order_list_id"
967
- t.datetime "deleted_at"
1272
+ t.bigint "user_id"
1273
+ t.bigint "order_list_id"
968
1274
  t.integer "subscribes_count", default: 0, null: false
969
- t.datetime "created_at"
970
- t.datetime "updated_at"
1275
+ t.datetime "created_at", null: false
1276
+ t.datetime "updated_at", null: false
971
1277
  t.index ["order_list_id"], name: "index_subscriptions_on_order_list_id"
972
1278
  t.index ["user_id"], name: "index_subscriptions_on_user_id"
973
1279
  end
974
1280
 
1281
+ create_table "use_restrictions", force: :cascade do |t|
1282
+ t.string "name", null: false
1283
+ t.text "display_name"
1284
+ t.text "note"
1285
+ t.integer "position"
1286
+ t.datetime "created_at", null: false
1287
+ t.datetime "updated_at", null: false
1288
+ end
1289
+
1290
+ create_table "user_checkout_stat_transitions", force: :cascade do |t|
1291
+ t.string "to_state"
1292
+ t.text "metadata", default: "{}"
1293
+ t.integer "sort_key"
1294
+ t.integer "user_checkout_stat_id"
1295
+ t.datetime "created_at", null: false
1296
+ t.datetime "updated_at", null: false
1297
+ t.boolean "most_recent", null: false
1298
+ t.index ["sort_key", "user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_sort_key_and_stat_id", unique: true
1299
+ t.index ["user_checkout_stat_id", "most_recent"], name: "index_user_checkout_stat_transitions_parent_most_recent", unique: true, where: "most_recent"
1300
+ t.index ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
1301
+ end
1302
+
1303
+ create_table "user_checkout_stats", force: :cascade do |t|
1304
+ t.datetime "start_date"
1305
+ t.datetime "end_date"
1306
+ t.text "note"
1307
+ t.datetime "created_at", null: false
1308
+ t.datetime "updated_at", null: false
1309
+ t.datetime "started_at"
1310
+ t.datetime "completed_at"
1311
+ t.bigint "user_id"
1312
+ t.index ["user_id"], name: "index_user_checkout_stats_on_user_id"
1313
+ end
1314
+
975
1315
  create_table "user_export_file_transitions", force: :cascade do |t|
976
1316
  t.string "to_state"
977
1317
  t.text "metadata", default: "{}"
978
1318
  t.integer "sort_key"
979
- t.integer "user_export_file_id"
980
- t.datetime "created_at"
981
- t.datetime "updated_at"
1319
+ t.bigint "user_export_file_id"
1320
+ t.datetime "created_at", null: false
1321
+ t.datetime "updated_at", null: false
982
1322
  t.boolean "most_recent", null: false
983
1323
  t.index ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
984
1324
  t.index ["user_export_file_id", "most_recent"], name: "index_user_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
@@ -987,34 +1327,56 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
987
1327
  end
988
1328
 
989
1329
  create_table "user_export_files", force: :cascade do |t|
990
- t.integer "user_id"
1330
+ t.bigint "user_id"
991
1331
  t.string "user_export_file_name"
992
1332
  t.string "user_export_content_type"
993
- t.integer "user_export_file_size"
1333
+ t.bigint "user_export_file_size"
994
1334
  t.datetime "user_export_updated_at"
995
1335
  t.datetime "executed_at"
996
- t.datetime "created_at"
997
- t.datetime "updated_at"
1336
+ t.datetime "created_at", null: false
1337
+ t.datetime "updated_at", null: false
998
1338
  t.index ["user_id"], name: "index_user_export_files_on_user_id"
999
1339
  end
1000
1340
 
1341
+ create_table "user_group_has_checkout_types", force: :cascade do |t|
1342
+ t.bigint "user_group_id", null: false
1343
+ t.bigint "checkout_type_id", null: false
1344
+ t.integer "checkout_limit", default: 0, null: false
1345
+ t.integer "checkout_period", default: 0, null: false
1346
+ t.integer "checkout_renewal_limit", default: 0, null: false
1347
+ t.integer "reservation_limit", default: 0, null: false
1348
+ t.integer "reservation_expired_period", default: 7, null: false
1349
+ t.boolean "set_due_date_after_closing_day", default: false, null: false
1350
+ t.datetime "fixed_due_date"
1351
+ t.text "note"
1352
+ t.integer "position"
1353
+ t.datetime "created_at", null: false
1354
+ t.datetime "updated_at", null: false
1355
+ t.integer "current_checkout_count"
1356
+ t.index ["checkout_type_id"], name: "index_user_group_has_checkout_types_on_checkout_type_id"
1357
+ t.index ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1358
+ end
1359
+
1001
1360
  create_table "user_groups", force: :cascade do |t|
1002
1361
  t.string "name"
1003
1362
  t.text "display_name"
1004
1363
  t.text "note"
1005
1364
  t.integer "position"
1006
- t.datetime "created_at"
1007
- t.datetime "updated_at"
1008
- t.datetime "deleted_at"
1365
+ t.datetime "created_at", null: false
1366
+ t.datetime "updated_at", null: false
1009
1367
  t.integer "valid_period_for_new_user", default: 0, null: false
1010
1368
  t.datetime "expired_at"
1369
+ t.integer "number_of_day_to_notify_overdue", default: 7, null: false
1370
+ t.integer "number_of_day_to_notify_due_date", default: 3, null: false
1371
+ t.integer "number_of_time_to_notify_overdue", default: 3, null: false
1372
+ t.jsonb "display_name_translations", default: {}, null: false
1011
1373
  end
1012
1374
 
1013
1375
  create_table "user_has_roles", force: :cascade do |t|
1014
- t.integer "user_id"
1015
- t.integer "role_id"
1016
- t.datetime "created_at"
1017
- t.datetime "updated_at"
1376
+ t.bigint "user_id", null: false
1377
+ t.bigint "role_id", null: false
1378
+ t.datetime "created_at", null: false
1379
+ t.datetime "updated_at", null: false
1018
1380
  t.index ["role_id"], name: "index_user_has_roles_on_role_id"
1019
1381
  t.index ["user_id"], name: "index_user_has_roles_on_user_id"
1020
1382
  end
@@ -1023,9 +1385,9 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
1023
1385
  t.string "to_state"
1024
1386
  t.text "metadata", default: "{}"
1025
1387
  t.integer "sort_key"
1026
- t.integer "user_import_file_id"
1027
- t.datetime "created_at"
1028
- t.datetime "updated_at"
1388
+ t.bigint "user_import_file_id"
1389
+ t.datetime "created_at", null: false
1390
+ t.datetime "updated_at", null: false
1029
1391
  t.boolean "most_recent", null: false
1030
1392
  t.index ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
1031
1393
  t.index ["user_import_file_id", "most_recent"], name: "index_user_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
@@ -1033,7 +1395,7 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
1033
1395
  end
1034
1396
 
1035
1397
  create_table "user_import_files", force: :cascade do |t|
1036
- t.integer "user_id"
1398
+ t.bigint "user_id"
1037
1399
  t.text "note"
1038
1400
  t.datetime "executed_at"
1039
1401
  t.string "user_import_file_name"
@@ -1043,25 +1405,52 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
1043
1405
  t.string "user_import_fingerprint"
1044
1406
  t.string "edit_mode"
1045
1407
  t.text "error_message"
1046
- t.datetime "created_at"
1047
- t.datetime "updated_at"
1408
+ t.datetime "created_at", null: false
1409
+ t.datetime "updated_at", null: false
1048
1410
  t.string "user_encoding"
1049
- t.integer "default_library_id"
1050
- t.integer "default_user_group_id"
1411
+ t.bigint "default_library_id"
1412
+ t.bigint "default_user_group_id"
1413
+ t.index ["default_library_id"], name: "index_user_import_files_on_default_library_id"
1414
+ t.index ["default_user_group_id"], name: "index_user_import_files_on_default_user_group_id"
1051
1415
  t.index ["user_id"], name: "index_user_import_files_on_user_id"
1052
1416
  end
1053
1417
 
1054
1418
  create_table "user_import_results", force: :cascade do |t|
1055
- t.integer "user_import_file_id"
1056
- t.integer "user_id"
1419
+ t.bigint "user_import_file_id"
1420
+ t.bigint "user_id"
1057
1421
  t.text "body"
1058
- t.datetime "created_at"
1059
- t.datetime "updated_at"
1422
+ t.datetime "created_at", null: false
1423
+ t.datetime "updated_at", null: false
1060
1424
  t.text "error_message"
1061
1425
  t.index ["user_id"], name: "index_user_import_results_on_user_id"
1062
1426
  t.index ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
1063
1427
  end
1064
1428
 
1429
+ create_table "user_reserve_stat_transitions", force: :cascade do |t|
1430
+ t.string "to_state"
1431
+ t.text "metadata", default: "{}"
1432
+ t.integer "sort_key"
1433
+ t.integer "user_reserve_stat_id"
1434
+ t.datetime "created_at", null: false
1435
+ t.datetime "updated_at", null: false
1436
+ t.boolean "most_recent", null: false
1437
+ t.index ["sort_key", "user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_sort_key_and_stat_id", unique: true
1438
+ t.index ["user_reserve_stat_id", "most_recent"], name: "index_user_reserve_stat_transitions_parent_most_recent", unique: true, where: "most_recent"
1439
+ t.index ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
1440
+ end
1441
+
1442
+ create_table "user_reserve_stats", force: :cascade do |t|
1443
+ t.datetime "start_date"
1444
+ t.datetime "end_date"
1445
+ t.text "note"
1446
+ t.datetime "created_at", null: false
1447
+ t.datetime "updated_at", null: false
1448
+ t.datetime "started_at"
1449
+ t.datetime "completed_at"
1450
+ t.bigint "user_id"
1451
+ t.index ["user_id"], name: "index_user_reserve_stats_on_user_id"
1452
+ end
1453
+
1065
1454
  create_table "users", force: :cascade do |t|
1066
1455
  t.string "email", default: "", null: false
1067
1456
  t.string "encrypted_password", default: "", null: false
@@ -1073,35 +1462,26 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
1073
1462
  t.datetime "last_sign_in_at"
1074
1463
  t.string "current_sign_in_ip"
1075
1464
  t.string "last_sign_in_ip"
1076
- t.datetime "created_at"
1077
- t.datetime "updated_at"
1465
+ t.datetime "created_at", null: false
1466
+ t.datetime "updated_at", null: false
1078
1467
  t.string "username"
1079
- t.datetime "deleted_at"
1080
1468
  t.datetime "expired_at"
1081
1469
  t.integer "failed_attempts", default: 0
1082
1470
  t.string "unlock_token"
1083
1471
  t.datetime "locked_at"
1084
1472
  t.datetime "confirmed_at"
1473
+ t.bigint "profile_id"
1085
1474
  t.index ["email"], name: "index_users_on_email"
1475
+ t.index ["profile_id"], name: "index_users_on_profile_id"
1086
1476
  t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
1087
1477
  t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
1088
1478
  t.index ["username"], name: "index_users_on_username", unique: true
1089
1479
  end
1090
1480
 
1091
- create_table "versions", force: :cascade do |t|
1092
- t.string "item_type", null: false
1093
- t.integer "item_id", null: false
1094
- t.string "event", null: false
1095
- t.string "whodunnit"
1096
- t.text "object"
1097
- t.datetime "created_at"
1098
- t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
1099
- end
1100
-
1101
1481
  create_table "withdraws", force: :cascade do |t|
1102
- t.integer "basket_id"
1103
- t.integer "item_id"
1104
- t.integer "librarian_id"
1482
+ t.bigint "basket_id"
1483
+ t.bigint "item_id"
1484
+ t.bigint "librarian_id"
1105
1485
  t.datetime "created_at", null: false
1106
1486
  t.datetime "updated_at", null: false
1107
1487
  t.index ["basket_id"], name: "index_withdraws_on_basket_id"
@@ -1109,4 +1489,51 @@ ActiveRecord::Schema.define(version: 2019_12_30_082846) do
1109
1489
  t.index ["librarian_id"], name: "index_withdraws_on_librarian_id"
1110
1490
  end
1111
1491
 
1492
+ add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
1493
+ add_foreign_key "checked_items", "baskets"
1494
+ add_foreign_key "checked_items", "items"
1495
+ add_foreign_key "checked_items", "users"
1496
+ add_foreign_key "checkins", "checkouts"
1497
+ add_foreign_key "checkout_stat_has_manifestations", "manifestations"
1498
+ add_foreign_key "checkout_stat_has_users", "user_checkout_stats"
1499
+ add_foreign_key "checkout_stat_has_users", "users"
1500
+ add_foreign_key "checkouts", "checkins"
1501
+ add_foreign_key "checkouts", "items"
1502
+ add_foreign_key "checkouts", "libraries"
1503
+ add_foreign_key "checkouts", "shelves"
1504
+ add_foreign_key "checkouts", "users"
1505
+ add_foreign_key "demands", "items"
1506
+ add_foreign_key "demands", "messages"
1507
+ add_foreign_key "demands", "users"
1508
+ add_foreign_key "doi_records", "manifestations"
1509
+ add_foreign_key "inventory_files", "shelves"
1510
+ add_foreign_key "isbn_record_and_manifestations", "isbn_records"
1511
+ add_foreign_key "isbn_record_and_manifestations", "manifestations"
1512
+ add_foreign_key "issn_record_and_manifestations", "issn_records"
1513
+ add_foreign_key "issn_record_and_manifestations", "manifestations"
1514
+ add_foreign_key "item_has_use_restrictions", "items"
1515
+ add_foreign_key "item_has_use_restrictions", "use_restrictions"
1516
+ add_foreign_key "items", "manifestations"
1517
+ add_foreign_key "libraries", "library_groups"
1518
+ add_foreign_key "library_groups", "users"
1519
+ add_foreign_key "manifestation_checkout_stats", "users"
1520
+ add_foreign_key "manifestation_reserve_stats", "users"
1521
+ add_foreign_key "periodical_and_manifestations", "manifestations"
1522
+ add_foreign_key "periodical_and_manifestations", "periodicals"
1523
+ add_foreign_key "periodicals", "frequencies"
1524
+ add_foreign_key "profiles", "users"
1525
+ add_foreign_key "reserve_stat_has_manifestations", "manifestations"
1526
+ add_foreign_key "reserve_stat_has_users", "user_reserve_stats"
1527
+ add_foreign_key "reserve_stat_has_users", "users"
1528
+ add_foreign_key "reserves", "manifestations"
1529
+ add_foreign_key "reserves", "users"
1530
+ add_foreign_key "retains", "items"
1531
+ add_foreign_key "retains", "reserves", column: "reserve_id"
1532
+ add_foreign_key "user_checkout_stats", "users"
1533
+ add_foreign_key "user_group_has_checkout_types", "checkout_types"
1534
+ add_foreign_key "user_group_has_checkout_types", "user_groups"
1535
+ add_foreign_key "user_has_roles", "roles"
1536
+ add_foreign_key "user_has_roles", "users"
1537
+ add_foreign_key "user_reserve_stats", "users"
1538
+ add_foreign_key "users", "profiles"
1112
1539
  end