enju_seed 0.3.0.beta.4 → 0.3.0.beta.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (313) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +1 -9
  3. data/Rakefile +8 -17
  4. data/app/controllers/profiles_controller.rb +29 -30
  5. data/app/controllers/roles_controller.rb +1 -2
  6. data/app/models/concerns/enju_seed/enju_user.rb +27 -23
  7. data/app/models/concerns/master_model.rb +13 -2
  8. data/app/models/identity.rb +2 -2
  9. data/app/models/profile.rb +12 -10
  10. data/app/models/role.rb +27 -11
  11. data/app/models/user_has_role.rb +4 -4
  12. data/app/views/profiles/show.html.erb +1 -1
  13. data/app/views/roles/show.html.erb +1 -1
  14. data/db/migrate/041_create_roles.rb +7 -6
  15. data/db/migrate/20100606065209_create_user_has_roles.rb +3 -3
  16. data/db/migrate/20130221154434_add_additional_attributes_to_user.rb +2 -2
  17. data/db/migrate/20140122054321_create_profiles.rb +8 -5
  18. data/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +11 -0
  19. data/db/migrate/20140811031145_add_expired_at_to_profile.rb +1 -1
  20. data/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb +1 -1
  21. data/db/migrate/20141003182825_add_date_of_birth_to_profile.rb +1 -1
  22. data/db/migrate/20150421023923_create_identities.rb +6 -4
  23. data/db/migrate/20151126005552_add_provider_to_identity.rb +2 -2
  24. data/lib/enju_seed/engine.rb +2 -3
  25. data/lib/enju_seed/localized_name.rb +3 -1
  26. data/lib/enju_seed/version.rb +1 -1
  27. data/lib/enju_seed.rb +3 -2
  28. data/lib/generators/enju_seed/update/update_generator.rb +9 -0
  29. data/spec/controllers/my_accounts_controller_spec.rb +62 -51
  30. data/spec/controllers/profiles_controller_spec.rb +153 -156
  31. data/spec/controllers/roles_controller_spec.rb +35 -35
  32. data/spec/dummy/Rakefile +1 -1
  33. data/spec/dummy/app/controllers/application_controller.rb +1 -0
  34. data/spec/dummy/app/models/user.rb +2 -2
  35. data/spec/dummy/bin/rails +1 -1
  36. data/spec/dummy/bin/setup +19 -10
  37. data/spec/dummy/bin/update +29 -0
  38. data/spec/dummy/bin/yarn +11 -0
  39. data/spec/dummy/config/application.rb +5 -1
  40. data/spec/dummy/config/cable.yml +10 -0
  41. data/spec/dummy/config/database.yml +10 -70
  42. data/spec/dummy/config/environments/development.rb +1 -1
  43. data/spec/dummy/config/environments/production.rb +8 -3
  44. data/spec/dummy/config/environments/test.rb +1 -1
  45. data/spec/dummy/config/initializers/application_controller_renderer.rb +8 -0
  46. data/spec/dummy/config/initializers/assets.rb +7 -4
  47. data/spec/dummy/config/initializers/cookies_serializer.rb +2 -0
  48. data/spec/dummy/config/initializers/friendly_id.rb +75 -75
  49. data/spec/dummy/config/initializers/wrap_parameters.rb +2 -2
  50. data/spec/dummy/config/puma.rb +56 -0
  51. data/spec/dummy/config/routes.rb +4 -0
  52. data/spec/dummy/config/secrets.yml +15 -5
  53. data/spec/dummy/config/spring.rb +6 -0
  54. data/spec/dummy/config.ru +2 -1
  55. data/spec/dummy/db/migrate/001_create_agents.rb +7 -7
  56. data/spec/dummy/db/migrate/002_devise_create_users.rb +4 -3
  57. data/spec/dummy/db/migrate/005_create_manifestations.rb +5 -4
  58. data/spec/dummy/db/migrate/006_create_items.rb +4 -3
  59. data/spec/dummy/db/migrate/012_create_owns.rb +5 -3
  60. data/spec/dummy/db/migrate/015_create_creates.rb +5 -3
  61. data/spec/dummy/db/migrate/032_create_checkins.rb +1 -1
  62. data/spec/dummy/db/migrate/033_create_checkouts.rb +1 -1
  63. data/spec/dummy/db/migrate/035_create_reserves.rb +1 -1
  64. data/spec/dummy/db/migrate/047_create_produces.rb +5 -3
  65. data/spec/dummy/db/migrate/059_create_libraries.rb +7 -8
  66. data/spec/dummy/db/migrate/069_create_shelves.rb +3 -3
  67. data/spec/dummy/db/migrate/073_create_carrier_types.rb +2 -2
  68. data/spec/dummy/db/migrate/077_create_user_groups.rb +4 -4
  69. data/spec/dummy/db/migrate/080_create_library_groups.rb +6 -6
  70. data/spec/dummy/db/migrate/112_create_frequencies.rb +2 -2
  71. data/spec/dummy/db/migrate/117_create_form_of_works.rb +2 -2
  72. data/spec/dummy/db/migrate/120_create_baskets.rb +2 -2
  73. data/spec/dummy/db/migrate/121_create_checked_items.rb +1 -1
  74. data/spec/dummy/db/migrate/124_create_bookstores.rb +3 -3
  75. data/spec/dummy/db/migrate/125_create_donates.rb +3 -3
  76. data/spec/dummy/db/migrate/127_create_use_restrictions.rb +1 -1
  77. data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +1 -1
  78. data/spec/dummy/db/migrate/130_create_request_status_types.rb +3 -3
  79. data/spec/dummy/db/migrate/131_create_request_types.rb +3 -3
  80. data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +1 -1
  81. data/spec/dummy/db/migrate/133_create_agent_merges.rb +2 -2
  82. data/spec/dummy/db/migrate/134_create_agent_merge_lists.rb +1 -1
  83. data/spec/dummy/db/migrate/149_create_message_templates.rb +18 -0
  84. data/spec/dummy/db/migrate/154_create_messages.rb +23 -0
  85. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +18 -0
  86. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +5 -3
  87. data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +2 -2
  88. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +3 -5
  89. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +4 -3
  90. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +6 -6
  91. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +5 -5
  92. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +6 -6
  93. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +2 -2
  94. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +1 -1
  95. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
  96. data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +1 -1
  97. data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +1 -1
  98. data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +1 -1
  99. data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +1 -1
  100. data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +1 -1
  101. data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +1 -1
  102. data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +1 -1
  103. data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +1 -1
  104. data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +1 -1
  105. data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +1 -1
  106. data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +1 -1
  107. data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +1 -1
  108. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +1 -1
  109. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +1 -1
  110. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +2 -2
  111. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +2 -2
  112. data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +2 -2
  113. data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +1 -1
  114. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +1 -1
  115. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +2 -2
  116. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +1 -1
  117. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +7 -4
  118. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +2 -2
  119. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +1 -1
  120. data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
  121. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +1 -1
  122. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +6 -4
  123. data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +1 -1
  124. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +2 -2
  125. data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +1 -1
  126. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +1 -1
  127. data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +1 -1
  128. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +1 -1
  129. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +2 -2
  130. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +1 -1
  131. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +1 -1
  132. data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +1 -1
  133. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +2 -2
  134. data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +1 -1
  135. data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +1 -1
  136. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +1 -1
  137. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +1 -1
  138. data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +1 -1
  139. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +1 -1
  140. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +3 -3
  141. data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +1 -1
  142. data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +11 -0
  143. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +1 -1
  144. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +1 -1
  145. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +1 -1
  146. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +1 -1
  147. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +1 -1
  148. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +1 -1
  149. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +1 -1
  150. data/spec/dummy/db/migrate/20111129044509_add_pickup_location_to_reserve.rb +1 -1
  151. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
  152. data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +6 -0
  153. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -1
  154. data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +1 -1
  155. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -1
  156. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +2 -2
  157. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +4 -4
  158. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +1 -1
  159. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +1 -1
  160. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +1 -1
  161. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +1 -1
  162. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +1 -1
  163. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +5 -0
  164. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +5 -0
  165. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +1 -1
  166. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +1 -1
  167. data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +1 -1
  168. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +2 -2
  169. data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +1 -1
  170. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +1 -1
  171. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +1 -1
  172. data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +1 -1
  173. data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +1 -1
  174. data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
  175. data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +1 -1
  176. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +1 -1
  177. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +1 -1
  178. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +1 -1
  179. data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +1 -1
  180. data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +1 -1
  181. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +3 -2
  182. data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +1 -1
  183. data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +1 -1
  184. data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +1 -1
  185. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +3 -3
  186. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +3 -3
  187. data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +3 -3
  188. data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +18 -0
  189. data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +18 -0
  190. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +3 -3
  191. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +3 -3
  192. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +3 -3
  193. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +2 -3
  194. data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +4 -4
  195. data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +4 -4
  196. data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +5 -5
  197. data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +5 -5
  198. data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +2 -1
  199. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +3 -3
  200. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
  201. data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +1 -1
  202. data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +1 -1
  203. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +3 -2
  204. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +2 -2
  205. data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +1 -1
  206. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +2 -2
  207. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +2 -2
  208. data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +1 -1
  209. data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +3 -2
  210. data/spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb +1 -1
  211. data/spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb +1 -1
  212. data/spec/dummy/db/migrate/20140810091417_add_save_checkout_history_to_profile.rb +1 -1
  213. data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +1 -1
  214. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +2 -4
  215. data/spec/dummy/db/migrate/20140822114527_add_error_message_to_resource_import_result.rb +5 -0
  216. data/spec/dummy/db/migrate/20140823083524_add_extent_to_manifestation.rb +1 -1
  217. data/spec/dummy/db/migrate/20140823094847_add_dimensions_to_manifestation.rb +1 -1
  218. data/spec/dummy/db/migrate/20140823095740_rename_manifestation_periodical_to_serial.rb +1 -1
  219. data/spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb +1 -1
  220. data/spec/dummy/db/migrate/20141020120523_add_library_id_to_checkout.rb +1 -1
  221. data/spec/dummy/db/migrate/20150106001709_create_demands.rb +1 -1
  222. data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  223. data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +2 -2
  224. data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +5 -0
  225. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +4 -4
  226. data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +1 -1
  227. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +5 -3
  228. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +20 -3
  229. data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
  230. data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
  231. data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
  232. data/spec/dummy/db/migrate/20160703184619_add_most_recent_to_reserve_transitions.rb +1 -1
  233. data/spec/dummy/db/migrate/20160703184650_add_most_recent_to_manifestation_checkout_stat_transitions.rb +1 -1
  234. data/spec/dummy/db/migrate/20160703184723_add_most_recent_to_manifestation_reserve_stat_transitions.rb +1 -1
  235. data/spec/dummy/db/migrate/20160703184747_add_most_recent_to_user_checkout_stat_transitions.rb +1 -1
  236. data/spec/dummy/db/migrate/20160703184805_add_most_recent_to_user_reserve_stat_transitions.rb +1 -1
  237. data/spec/dummy/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +9 -0
  238. data/spec/dummy/db/migrate/20160703190209_add_foreign_key_on_manifestation_id_to_reserve.rb +5 -0
  239. data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +1 -1
  240. data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +1 -1
  241. data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +1 -1
  242. data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +1 -1
  243. data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +5 -0
  244. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
  245. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
  246. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
  247. data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +5 -0
  248. data/spec/dummy/db/schema.rb +420 -476
  249. data/spec/dummy/package.json +5 -0
  250. data/spec/factories/profile.rb +8 -8
  251. data/spec/factories/user.rb +10 -13
  252. data/spec/factories/user_group.rb +2 -2
  253. data/spec/fixtures/libraries.yml +37 -37
  254. data/spec/fixtures/library_groups.yml +19 -27
  255. data/spec/fixtures/message_requests.yml +26 -0
  256. data/spec/fixtures/message_templates.yml +98 -0
  257. data/spec/fixtures/messages.yml +56 -0
  258. data/spec/fixtures/profiles.yml +35 -27
  259. data/spec/fixtures/roles.yml +12 -12
  260. data/spec/fixtures/user_groups.yml +10 -20
  261. data/spec/fixtures/user_has_roles.yml +2 -2
  262. data/spec/fixtures/users.yml +0 -7
  263. data/spec/models/profile_spec.rb +23 -22
  264. data/spec/models/role_spec.rb +18 -17
  265. data/spec/models/user_has_role_spec.rb +6 -4
  266. data/spec/models/user_spec.rb +27 -25
  267. data/spec/rails_helper.rb +6 -7
  268. data/spec/requests/profiles_spec.rb +3 -3
  269. data/spec/routing/profiles_routing_spec.rb +18 -16
  270. data/spec/routing/roles_routing_spec.rb +18 -16
  271. data/spec/routing/users_spec.rb +7 -6
  272. data/spec/spec_helper.rb +49 -47
  273. data/spec/support/controller_macros.rb +9 -9
  274. data/spec/views/my_accounts/show.html.erb_spec.rb +6 -6
  275. data/spec/views/profiles/edit.html.erb_spec.rb +7 -7
  276. data/spec/views/profiles/index.html.erb_spec.rb +3 -3
  277. data/spec/views/profiles/new.html.erb_spec.rb +6 -5
  278. data/spec/views/profiles/show.html.erb_spec.rb +3 -3
  279. metadata +91 -109
  280. data/app/policies/user_export_file_policy.rb +0 -21
  281. data/app/policies/user_import_file_policy.rb +0 -21
  282. data/app/policies/user_import_result_policy.rb +0 -21
  283. data/db/migrate/20170114174536_add_profile_id_to_user.rb +0 -5
  284. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +0 -11
  285. data/spec/dummy/db/migrate/20140529014410_create_item_transitions.rb +0 -15
  286. data/spec/dummy/db/migrate/20141029131633_create_periodicals.rb +0 -11
  287. data/spec/dummy/db/migrate/20150302110310_add_attachment_id_to_manifestation.rb +0 -7
  288. data/spec/dummy/db/migrate/20150304183215_add_picture_id_to_picture_file.rb +0 -7
  289. data/spec/dummy/db/migrate/20150305025906_add_resource_import_id_to_resource_import_file.rb +0 -7
  290. data/spec/dummy/db/migrate/20150305030046_add_resource_export_id_to_resource_export_file.rb +0 -8
  291. data/spec/dummy/db/migrate/20150305031709_add_agent_import_id_to_agent_import_file.rb +0 -7
  292. data/spec/dummy/db/migrate/20150305105231_add_attachment_fingerprint_to_manifestation.rb +0 -5
  293. data/spec/dummy/db/migrate/20150420145354_add_attachment_to_carrier_type.rb +0 -8
  294. data/spec/dummy/db/migrate/20150420145420_add_attachment_to_content_type.rb +0 -8
  295. data/spec/dummy/db/migrate/20151216123621_create_doi_records.rb +0 -12
  296. data/spec/dummy/db/migrate/20160319144230_create_issn_records.rb +0 -12
  297. data/spec/dummy/db/migrate/20160506144040_create_isbn_records.rb +0 -12
  298. data/spec/dummy/db/migrate/20160513000929_create_agent_names.rb +0 -18
  299. data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +0 -9
  300. data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +0 -9
  301. data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +0 -9
  302. data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +0 -9
  303. data/spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb +0 -5
  304. data/spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb +0 -5
  305. data/spec/dummy/db/migrate/20161111175127_add_attachment_data_to_manifestation.rb +0 -5
  306. data/spec/dummy/db/migrate/20161111193255_add_attachment_data_to_carrier_type.rb +0 -5
  307. data/spec/dummy/db/migrate/20161111193346_add_attachment_data_to_content_type.rb +0 -5
  308. data/spec/dummy/db/migrate/20161112122706_add_attachment_data_to_resource_import_file.rb +0 -5
  309. data/spec/dummy/db/migrate/20161112122750_add_attachment_data_to_resource_export_file.rb +0 -5
  310. data/spec/dummy/db/migrate/20161112122814_add_attachment_data_to_agent_import_file.rb +0 -5
  311. data/spec/dummy/db/migrate/20161114083857_add_image_data_to_picture_file.rb +0 -5
  312. data/spec/dummy/db/migrate/20161115184747_add_attachment_data_to_user_import_file.rb +0 -5
  313. data/spec/dummy/db/migrate/20161115184756_add_attachment_data_to_user_export_file.rb +0 -5
@@ -10,35 +10,31 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 20170114174536) do
13
+ ActiveRecord::Schema.define(version: 20180102162311) do
14
14
 
15
- # These are extensions that must be enabled in order to support this database
16
- enable_extension "plpgsql"
17
- enable_extension "pgcrypto"
18
-
19
- create_table "accepts", id: :serial, force: :cascade do |t|
15
+ create_table "accepts", force: :cascade do |t|
20
16
  t.integer "basket_id"
21
- t.uuid "item_id"
17
+ t.integer "item_id"
22
18
  t.integer "librarian_id"
23
- t.datetime "created_at", null: false
24
- t.datetime "updated_at", null: false
19
+ t.datetime "created_at"
20
+ t.datetime "updated_at"
25
21
  t.index ["basket_id"], name: "index_accepts_on_basket_id"
26
22
  t.index ["item_id"], name: "index_accepts_on_item_id"
23
+ t.index ["librarian_id"], name: "index_accepts_on_librarian_id"
27
24
  end
28
25
 
29
- create_table "agent_import_file_transitions", id: :serial, force: :cascade do |t|
26
+ create_table "agent_import_file_transitions", force: :cascade do |t|
30
27
  t.string "to_state"
31
- t.jsonb "metadata", default: "{}"
28
+ t.text "metadata", default: "{}"
32
29
  t.integer "sort_key"
33
30
  t.integer "agent_import_file_id"
34
- t.datetime "created_at", null: false
35
- t.datetime "updated_at", null: false
36
- t.boolean "most_recent"
31
+ t.datetime "created_at"
32
+ t.datetime "updated_at"
37
33
  t.index ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
38
34
  t.index ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
39
35
  end
40
36
 
41
- create_table "agent_import_files", id: :serial, force: :cascade do |t|
37
+ create_table "agent_import_files", force: :cascade do |t|
42
38
  t.integer "parent_id"
43
39
  t.string "content_type"
44
40
  t.integer "size"
@@ -47,92 +43,71 @@ ActiveRecord::Schema.define(version: 20170114174536) do
47
43
  t.datetime "executed_at"
48
44
  t.string "agent_import_file_name"
49
45
  t.string "agent_import_content_type"
50
- t.integer "agent_import_size"
46
+ t.integer "agent_import_file_size"
51
47
  t.datetime "agent_import_updated_at"
52
- t.datetime "created_at", null: false
53
- t.datetime "updated_at", null: false
48
+ t.datetime "created_at"
49
+ t.datetime "updated_at"
54
50
  t.string "agent_import_fingerprint"
51
+ t.text "error_message"
55
52
  t.string "edit_mode"
56
53
  t.string "user_encoding"
57
- t.string "agent_import_id"
58
- t.jsonb "attachment_data"
59
- t.index ["agent_import_id"], name: "index_agent_import_files_on_agent_import_id"
60
54
  t.index ["parent_id"], name: "index_agent_import_files_on_parent_id"
61
55
  t.index ["user_id"], name: "index_agent_import_files_on_user_id"
62
56
  end
63
57
 
64
- create_table "agent_import_results", id: :serial, force: :cascade do |t|
58
+ create_table "agent_import_results", force: :cascade do |t|
65
59
  t.integer "agent_import_file_id"
66
60
  t.integer "agent_id"
67
61
  t.text "body"
68
- t.datetime "created_at", null: false
69
- t.datetime "updated_at", null: false
62
+ t.datetime "created_at"
63
+ t.datetime "updated_at"
70
64
  end
71
65
 
72
- create_table "agent_merge_lists", id: :serial, force: :cascade do |t|
66
+ create_table "agent_merge_lists", force: :cascade do |t|
73
67
  t.string "title"
74
- t.datetime "created_at", null: false
75
- t.datetime "updated_at", null: false
68
+ t.datetime "created_at"
69
+ t.datetime "updated_at"
76
70
  end
77
71
 
78
- create_table "agent_merges", id: :serial, force: :cascade do |t|
72
+ create_table "agent_merges", force: :cascade do |t|
79
73
  t.integer "agent_id", null: false
80
74
  t.integer "agent_merge_list_id", null: false
81
- t.datetime "created_at", null: false
82
- t.datetime "updated_at", null: false
75
+ t.datetime "created_at"
76
+ t.datetime "updated_at"
83
77
  t.index ["agent_id"], name: "index_agent_merges_on_agent_id"
84
78
  t.index ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
85
79
  end
86
80
 
87
- create_table "agent_names", id: :serial, force: :cascade do |t|
88
- t.string "first_name"
89
- t.string "middle_name"
90
- t.string "last_name"
91
- t.string "full_name"
92
- t.integer "language_id"
93
- t.integer "agent_id"
94
- t.integer "profile_id"
95
- t.integer "position"
96
- t.string "source"
97
- t.string "name_type"
98
- t.datetime "created_at", null: false
99
- t.datetime "updated_at", null: false
100
- t.index ["agent_id"], name: "index_agent_names_on_agent_id"
101
- t.index ["full_name"], name: "index_agent_names_on_full_name"
102
- t.index ["language_id"], name: "index_agent_names_on_language_id"
103
- t.index ["profile_id"], name: "index_agent_names_on_profile_id"
104
- end
105
-
106
- create_table "agent_relationship_types", id: :serial, force: :cascade do |t|
81
+ create_table "agent_relationship_types", force: :cascade do |t|
107
82
  t.string "name", null: false
108
83
  t.text "display_name"
109
84
  t.text "note"
110
85
  t.integer "position"
111
- t.datetime "created_at", null: false
112
- t.datetime "updated_at", null: false
86
+ t.datetime "created_at"
87
+ t.datetime "updated_at"
113
88
  end
114
89
 
115
- create_table "agent_relationships", id: :serial, force: :cascade do |t|
90
+ create_table "agent_relationships", force: :cascade do |t|
116
91
  t.integer "parent_id"
117
92
  t.integer "child_id"
118
93
  t.integer "agent_relationship_type_id"
119
- t.datetime "created_at", null: false
120
- t.datetime "updated_at", null: false
94
+ t.datetime "created_at"
95
+ t.datetime "updated_at"
121
96
  t.integer "position"
122
97
  t.index ["child_id"], name: "index_agent_relationships_on_child_id"
123
98
  t.index ["parent_id"], name: "index_agent_relationships_on_parent_id"
124
99
  end
125
100
 
126
- create_table "agent_types", id: :serial, force: :cascade do |t|
101
+ create_table "agent_types", force: :cascade do |t|
127
102
  t.string "name", null: false
128
103
  t.text "display_name"
129
104
  t.text "note"
130
105
  t.integer "position"
131
- t.datetime "created_at", null: false
132
- t.datetime "updated_at", null: false
106
+ t.datetime "created_at"
107
+ t.datetime "updated_at"
133
108
  end
134
109
 
135
- create_table "agents", id: :serial, force: :cascade do |t|
110
+ create_table "agents", force: :cascade do |t|
136
111
  t.string "last_name"
137
112
  t.string "middle_name"
138
113
  t.string "first_name"
@@ -144,8 +119,8 @@ ActiveRecord::Schema.define(version: 20170114174536) do
144
119
  t.string "full_name"
145
120
  t.text "full_name_transcription"
146
121
  t.text "full_name_alternative"
147
- t.datetime "created_at", null: false
148
- t.datetime "updated_at", null: false
122
+ t.datetime "created_at"
123
+ t.datetime "updated_at"
149
124
  t.datetime "deleted_at"
150
125
  t.string "zip_code_1"
151
126
  t.string "zip_code_2"
@@ -187,17 +162,17 @@ ActiveRecord::Schema.define(version: 20170114174536) do
187
162
  t.index ["required_role_id"], name: "index_agents_on_required_role_id"
188
163
  end
189
164
 
190
- create_table "baskets", id: :serial, force: :cascade do |t|
165
+ create_table "baskets", force: :cascade do |t|
191
166
  t.integer "user_id"
192
167
  t.text "note"
193
168
  t.integer "lock_version", default: 0, null: false
194
- t.datetime "created_at", null: false
195
- t.datetime "updated_at", null: false
169
+ t.datetime "created_at"
170
+ t.datetime "updated_at"
196
171
  t.index ["user_id"], name: "index_baskets_on_user_id"
197
172
  end
198
173
 
199
- create_table "bookstores", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
200
- t.string "name", null: false
174
+ create_table "bookstores", force: :cascade do |t|
175
+ t.text "name", null: false
201
176
  t.string "zip_code"
202
177
  t.text "address"
203
178
  t.text "note"
@@ -206,98 +181,93 @@ ActiveRecord::Schema.define(version: 20170114174536) do
206
181
  t.string "url"
207
182
  t.integer "position"
208
183
  t.datetime "deleted_at"
209
- t.datetime "created_at", null: false
210
- t.datetime "updated_at", null: false
184
+ t.datetime "created_at"
185
+ t.datetime "updated_at"
211
186
  end
212
187
 
213
- create_table "budget_types", id: :serial, force: :cascade do |t|
188
+ create_table "budget_types", force: :cascade do |t|
214
189
  t.string "name"
215
190
  t.text "display_name"
216
191
  t.text "note"
217
192
  t.integer "position"
218
- t.datetime "created_at", null: false
219
- t.datetime "updated_at", null: false
193
+ t.datetime "created_at"
194
+ t.datetime "updated_at"
220
195
  end
221
196
 
222
- create_table "carrier_type_has_checkout_types", id: :serial, force: :cascade do |t|
197
+ create_table "carrier_type_has_checkout_types", force: :cascade do |t|
223
198
  t.integer "carrier_type_id", null: false
224
199
  t.integer "checkout_type_id", null: false
225
200
  t.text "note"
226
201
  t.integer "position"
227
- t.datetime "created_at", null: false
228
- t.datetime "updated_at", null: false
202
+ t.datetime "created_at"
203
+ t.datetime "updated_at"
229
204
  t.index ["carrier_type_id"], name: "index_carrier_type_has_checkout_types_on_m_form_id"
230
205
  t.index ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
231
206
  end
232
207
 
233
- create_table "carrier_types", id: :serial, force: :cascade do |t|
208
+ create_table "carrier_types", force: :cascade do |t|
234
209
  t.string "name", null: false
235
- t.jsonb "display_name_translations"
210
+ t.text "display_name"
236
211
  t.text "note"
237
212
  t.integer "position"
238
- t.datetime "created_at", null: false
239
- t.datetime "updated_at", null: false
240
- t.string "attachment_id"
241
- t.string "attachment_filename"
242
- t.integer "attachment_size"
243
- t.string "attachment_content_type"
244
- t.jsonb "attachment_data"
213
+ t.datetime "created_at"
214
+ t.datetime "updated_at"
245
215
  end
246
216
 
247
- create_table "checked_items", id: :serial, force: :cascade do |t|
217
+ create_table "checked_items", force: :cascade do |t|
248
218
  t.integer "item_id", null: false
249
219
  t.integer "basket_id", null: false
250
220
  t.datetime "due_date", null: false
251
- t.datetime "created_at", null: false
252
- t.datetime "updated_at", null: false
221
+ t.datetime "created_at"
222
+ t.datetime "updated_at"
253
223
  t.integer "librarian_id"
254
224
  t.index ["basket_id"], name: "index_checked_items_on_basket_id"
255
225
  t.index ["item_id"], name: "index_checked_items_on_item_id"
256
226
  end
257
227
 
258
- create_table "checkins", id: :serial, force: :cascade do |t|
228
+ create_table "checkins", force: :cascade do |t|
259
229
  t.integer "item_id", null: false
260
230
  t.integer "librarian_id"
261
231
  t.integer "basket_id"
262
- t.datetime "created_at", null: false
263
- t.datetime "updated_at", null: false
232
+ t.datetime "created_at"
233
+ t.datetime "updated_at"
264
234
  t.integer "lock_version", default: 0, null: false
265
235
  t.index ["basket_id"], name: "index_checkins_on_basket_id"
266
236
  t.index ["item_id"], name: "index_checkins_on_item_id"
267
237
  t.index ["librarian_id"], name: "index_checkins_on_librarian_id"
268
238
  end
269
239
 
270
- create_table "checkout_stat_has_manifestations", id: :serial, force: :cascade do |t|
240
+ create_table "checkout_stat_has_manifestations", force: :cascade do |t|
271
241
  t.integer "manifestation_checkout_stat_id", null: false
272
242
  t.integer "manifestation_id", null: false
273
243
  t.integer "checkouts_count"
274
- t.datetime "created_at", null: false
275
- t.datetime "updated_at", null: false
244
+ t.datetime "created_at"
245
+ t.datetime "updated_at"
276
246
  t.index ["manifestation_checkout_stat_id"], name: "index_checkout_stat_has_manifestations_on_checkout_stat_id"
277
247
  t.index ["manifestation_id"], name: "index_checkout_stat_has_manifestations_on_manifestation_id"
278
248
  end
279
249
 
280
- create_table "checkout_stat_has_users", id: :serial, force: :cascade do |t|
250
+ create_table "checkout_stat_has_users", force: :cascade do |t|
281
251
  t.integer "user_checkout_stat_id", null: false
282
252
  t.integer "user_id", null: false
283
253
  t.integer "checkouts_count", default: 0, null: false
284
- t.datetime "created_at", null: false
285
- t.datetime "updated_at", null: false
254
+ t.datetime "created_at"
255
+ t.datetime "updated_at"
286
256
  t.index ["user_checkout_stat_id"], name: "index_checkout_stat_has_users_on_user_checkout_stat_id"
287
257
  t.index ["user_id"], name: "index_checkout_stat_has_users_on_user_id"
288
258
  end
289
259
 
290
- create_table "checkout_types", id: :serial, force: :cascade do |t|
260
+ create_table "checkout_types", force: :cascade do |t|
291
261
  t.string "name", null: false
292
262
  t.text "display_name"
293
263
  t.text "note"
294
264
  t.integer "position"
295
- t.datetime "created_at", null: false
296
- t.datetime "updated_at", null: false
265
+ t.datetime "created_at"
266
+ t.datetime "updated_at"
297
267
  t.index ["name"], name: "index_checkout_types_on_name"
298
268
  end
299
269
 
300
- create_table "checkouts", id: :serial, force: :cascade do |t|
270
+ create_table "checkouts", force: :cascade do |t|
301
271
  t.integer "user_id"
302
272
  t.integer "item_id", null: false
303
273
  t.integer "checkin_id"
@@ -306,8 +276,8 @@ ActiveRecord::Schema.define(version: 20170114174536) do
306
276
  t.datetime "due_date"
307
277
  t.integer "checkout_renewal_count", default: 0, null: false
308
278
  t.integer "lock_version", default: 0, null: false
309
- t.datetime "created_at", null: false
310
- t.datetime "updated_at", null: false
279
+ t.datetime "created_at"
280
+ t.datetime "updated_at"
311
281
  t.integer "shelf_id"
312
282
  t.integer "library_id"
313
283
  t.index ["basket_id"], name: "index_checkouts_on_basket_id"
@@ -320,40 +290,35 @@ ActiveRecord::Schema.define(version: 20170114174536) do
320
290
  t.index ["user_id"], name: "index_checkouts_on_user_id"
321
291
  end
322
292
 
323
- create_table "circulation_statuses", id: :serial, force: :cascade do |t|
293
+ create_table "circulation_statuses", force: :cascade do |t|
324
294
  t.string "name", null: false
325
295
  t.text "display_name"
326
296
  t.text "note"
327
297
  t.integer "position"
328
- t.datetime "created_at", null: false
329
- t.datetime "updated_at", null: false
298
+ t.datetime "created_at"
299
+ t.datetime "updated_at"
330
300
  end
331
301
 
332
- create_table "colors", id: :serial, force: :cascade do |t|
302
+ create_table "colors", force: :cascade do |t|
333
303
  t.integer "library_group_id"
334
304
  t.string "property"
335
305
  t.string "code"
336
306
  t.integer "position"
337
- t.datetime "created_at", null: false
338
- t.datetime "updated_at", null: false
307
+ t.datetime "created_at"
308
+ t.datetime "updated_at"
339
309
  t.index ["library_group_id"], name: "index_colors_on_library_group_id"
340
310
  end
341
311
 
342
- create_table "content_types", id: :serial, force: :cascade do |t|
312
+ create_table "content_types", force: :cascade do |t|
343
313
  t.string "name", null: false
344
- t.jsonb "display_name_translations"
314
+ t.text "display_name"
345
315
  t.text "note"
346
316
  t.integer "position"
347
- t.datetime "created_at", null: false
348
- t.datetime "updated_at", null: false
349
- t.string "attachment_id"
350
- t.string "attachment_filename"
351
- t.integer "attachment_size"
352
- t.string "attachment_content_type"
353
- t.jsonb "attachment_data"
317
+ t.datetime "created_at"
318
+ t.datetime "updated_at"
354
319
  end
355
320
 
356
- create_table "countries", id: :serial, force: :cascade do |t|
321
+ create_table "countries", force: :cascade do |t|
357
322
  t.string "name", null: false
358
323
  t.text "display_name"
359
324
  t.string "alpha_2"
@@ -367,27 +332,27 @@ ActiveRecord::Schema.define(version: 20170114174536) do
367
332
  t.index ["numeric_3"], name: "index_countries_on_numeric_3"
368
333
  end
369
334
 
370
- create_table "create_types", id: :serial, force: :cascade do |t|
335
+ create_table "create_types", force: :cascade do |t|
371
336
  t.string "name"
372
337
  t.text "display_name"
373
338
  t.text "note"
374
339
  t.integer "position"
375
- t.datetime "created_at", null: false
376
- t.datetime "updated_at", null: false
340
+ t.datetime "created_at"
341
+ t.datetime "updated_at"
377
342
  end
378
343
 
379
- create_table "creates", id: :serial, force: :cascade do |t|
344
+ create_table "creates", force: :cascade do |t|
380
345
  t.integer "agent_id", null: false
381
- t.uuid "work_id", null: false
346
+ t.integer "work_id", null: false
382
347
  t.integer "position"
383
- t.datetime "created_at", null: false
384
- t.datetime "updated_at", null: false
348
+ t.datetime "created_at"
349
+ t.datetime "updated_at"
385
350
  t.integer "create_type_id"
386
351
  t.index ["agent_id"], name: "index_creates_on_agent_id"
387
352
  t.index ["work_id"], name: "index_creates_on_work_id"
388
353
  end
389
354
 
390
- create_table "demands", id: :serial, force: :cascade do |t|
355
+ create_table "demands", force: :cascade do |t|
391
356
  t.integer "user_id"
392
357
  t.integer "item_id"
393
358
  t.integer "message_id"
@@ -398,161 +363,105 @@ ActiveRecord::Schema.define(version: 20170114174536) do
398
363
  t.index ["user_id"], name: "index_demands_on_user_id"
399
364
  end
400
365
 
401
- create_table "doi_records", id: :serial, force: :cascade do |t|
402
- t.string "body", null: false
403
- t.string "registration_agency"
404
- t.uuid "manifestation_id"
405
- t.string "source"
406
- t.datetime "created_at", null: false
407
- t.datetime "updated_at", null: false
408
- t.index ["body"], name: "index_doi_records_on_body", unique: true
409
- t.index ["manifestation_id"], name: "index_doi_records_on_manifestation_id"
410
- end
411
-
412
- create_table "donates", id: :serial, force: :cascade do |t|
366
+ create_table "donates", force: :cascade do |t|
413
367
  t.integer "agent_id", null: false
414
368
  t.integer "item_id", null: false
415
- t.datetime "created_at", null: false
416
- t.datetime "updated_at", null: false
369
+ t.datetime "created_at"
370
+ t.datetime "updated_at"
417
371
  t.index ["agent_id"], name: "index_donates_on_agent_id"
418
372
  t.index ["item_id"], name: "index_donates_on_item_id"
419
373
  end
420
374
 
421
- create_table "exemplifies", id: :serial, force: :cascade do |t|
422
- t.uuid "manifestation_id", null: false
423
- t.uuid "item_id", null: false
424
- t.integer "position"
425
- t.datetime "created_at", null: false
426
- t.datetime "updated_at", null: false
427
- t.index ["item_id"], name: "index_exemplifies_on_item_id", unique: true
428
- t.index ["manifestation_id"], name: "index_exemplifies_on_manifestation_id"
429
- end
430
-
431
- create_table "form_of_works", id: :serial, force: :cascade do |t|
375
+ create_table "form_of_works", force: :cascade do |t|
432
376
  t.string "name", null: false
433
- t.jsonb "display_name_translations"
377
+ t.text "display_name"
434
378
  t.text "note"
435
379
  t.integer "position"
436
- t.datetime "created_at", null: false
437
- t.datetime "updated_at", null: false
380
+ t.datetime "created_at"
381
+ t.datetime "updated_at"
438
382
  end
439
383
 
440
- create_table "frequencies", id: :serial, force: :cascade do |t|
384
+ create_table "frequencies", force: :cascade do |t|
441
385
  t.string "name", null: false
442
- t.jsonb "display_name_translations"
386
+ t.text "display_name"
443
387
  t.text "note"
444
388
  t.integer "position"
445
- t.datetime "created_at", null: false
446
- t.datetime "updated_at", null: false
389
+ t.datetime "created_at"
390
+ t.datetime "updated_at"
447
391
  end
448
392
 
449
- create_table "identifier_types", id: :serial, force: :cascade do |t|
393
+ create_table "identifier_types", force: :cascade do |t|
450
394
  t.string "name"
451
395
  t.text "display_name"
452
396
  t.text "note"
453
397
  t.integer "position"
454
- t.datetime "created_at", null: false
455
- t.datetime "updated_at", null: false
398
+ t.datetime "created_at"
399
+ t.datetime "updated_at"
456
400
  end
457
401
 
458
- create_table "identifiers", id: :serial, force: :cascade do |t|
402
+ create_table "identifiers", force: :cascade do |t|
459
403
  t.string "body", null: false
460
404
  t.integer "identifier_type_id", null: false
461
- t.uuid "manifestation_id"
405
+ t.integer "manifestation_id"
462
406
  t.boolean "primary"
463
407
  t.integer "position"
464
- t.datetime "created_at", null: false
465
- t.datetime "updated_at", null: false
408
+ t.datetime "created_at"
409
+ t.datetime "updated_at"
466
410
  t.index ["body", "identifier_type_id"], name: "index_identifiers_on_body_and_identifier_type_id"
467
411
  t.index ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
468
412
  end
469
413
 
470
- create_table "identities", id: :serial, force: :cascade do |t|
414
+ create_table "identities", force: :cascade do |t|
471
415
  t.string "name"
472
416
  t.string "email"
473
417
  t.string "password_digest"
474
418
  t.integer "profile_id"
475
419
  t.datetime "created_at", null: false
476
420
  t.datetime "updated_at", null: false
477
- t.string "provider", null: false
421
+ t.string "provider"
478
422
  t.index ["email"], name: "index_identities_on_email"
479
423
  t.index ["name"], name: "index_identities_on_name"
480
424
  t.index ["profile_id"], name: "index_identities_on_profile_id"
481
425
  end
482
426
 
483
- create_table "import_request_transitions", id: :serial, force: :cascade do |t|
427
+ create_table "import_request_transitions", force: :cascade do |t|
484
428
  t.string "to_state"
485
- t.jsonb "metadata", default: "{}"
429
+ t.text "metadata", default: "{}"
486
430
  t.integer "sort_key"
487
431
  t.integer "import_request_id"
488
- t.datetime "created_at", null: false
489
- t.datetime "updated_at", null: false
490
- t.boolean "most_recent"
432
+ t.datetime "created_at"
433
+ t.datetime "updated_at"
491
434
  t.index ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
492
435
  t.index ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
493
436
  end
494
437
 
495
- create_table "import_requests", id: :serial, force: :cascade do |t|
438
+ create_table "import_requests", force: :cascade do |t|
496
439
  t.string "isbn"
497
- t.uuid "manifestation_id"
440
+ t.integer "manifestation_id"
498
441
  t.integer "user_id"
499
- t.datetime "created_at", null: false
500
- t.datetime "updated_at", null: false
442
+ t.datetime "created_at"
443
+ t.datetime "updated_at"
501
444
  t.index ["isbn"], name: "index_import_requests_on_isbn"
502
445
  t.index ["manifestation_id"], name: "index_import_requests_on_manifestation_id"
503
446
  t.index ["user_id"], name: "index_import_requests_on_user_id"
504
447
  end
505
448
 
506
- create_table "isbn_records", id: :serial, force: :cascade do |t|
507
- t.string "body", null: false
508
- t.string "isbn_type"
509
- t.string "source"
510
- t.uuid "manifestation_id"
511
- t.datetime "created_at", null: false
512
- t.datetime "updated_at", null: false
513
- t.index ["body"], name: "index_isbn_records_on_body", unique: true
514
- t.index ["manifestation_id"], name: "index_isbn_records_on_manifestation_id"
515
- end
516
-
517
- create_table "issn_records", id: :serial, force: :cascade do |t|
518
- t.string "body", null: false
519
- t.string "issn_type"
520
- t.string "source"
521
- t.uuid "manifestation_id"
522
- t.datetime "created_at", null: false
523
- t.datetime "updated_at", null: false
524
- t.index ["body"], name: "index_issn_records_on_body", unique: true
525
- t.index ["manifestation_id"], name: "index_issn_records_on_manifestation_id"
526
- end
527
-
528
- create_table "item_has_use_restrictions", id: :serial, force: :cascade do |t|
449
+ create_table "item_has_use_restrictions", force: :cascade do |t|
529
450
  t.integer "item_id", null: false
530
451
  t.integer "use_restriction_id", null: false
531
- t.datetime "created_at", null: false
532
- t.datetime "updated_at", null: false
452
+ t.datetime "created_at"
453
+ t.datetime "updated_at"
533
454
  t.index ["item_id"], name: "index_item_has_use_restrictions_on_item_id"
534
455
  t.index ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
535
456
  end
536
457
 
537
- create_table "item_transitions", id: :serial, force: :cascade do |t|
538
- t.string "to_state", null: false
539
- t.jsonb "metadata", default: "{}"
540
- t.integer "sort_key", null: false
541
- t.uuid "item_id", null: false
542
- t.boolean "most_recent", null: false
543
- t.datetime "created_at", null: false
544
- t.datetime "updated_at", null: false
545
- t.index ["item_id"], name: "index_item_transitions_on_item_id"
546
- t.index ["sort_key", "item_id"], name: "index_item_transitions_on_sort_key_and_item_id", unique: true
547
- end
548
-
549
- create_table "items", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
458
+ create_table "items", force: :cascade do |t|
550
459
  t.string "call_number"
551
460
  t.string "item_identifier"
552
- t.datetime "created_at", null: false
553
- t.datetime "updated_at", null: false
461
+ t.datetime "created_at"
462
+ t.datetime "updated_at"
554
463
  t.datetime "deleted_at"
555
- t.integer "shelf_id", default: 1
464
+ t.integer "shelf_id", default: 1, null: false
556
465
  t.boolean "include_supplements", default: false, null: false
557
466
  t.text "note"
558
467
  t.string "url"
@@ -568,7 +477,7 @@ ActiveRecord::Schema.define(version: 20170114174536) do
568
477
  t.string "binding_item_identifier"
569
478
  t.string "binding_call_number"
570
479
  t.datetime "binded_at"
571
- t.uuid "manifestation_id"
480
+ t.integer "manifestation_id"
572
481
  t.index ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
573
482
  t.index ["bookstore_id"], name: "index_items_on_bookstore_id"
574
483
  t.index ["checkout_type_id"], name: "index_items_on_checkout_type_id"
@@ -579,7 +488,7 @@ ActiveRecord::Schema.define(version: 20170114174536) do
579
488
  t.index ["shelf_id"], name: "index_items_on_shelf_id"
580
489
  end
581
490
 
582
- create_table "languages", id: :serial, force: :cascade do |t|
491
+ create_table "languages", force: :cascade do |t|
583
492
  t.string "name", null: false
584
493
  t.string "native_name"
585
494
  t.text "display_name"
@@ -594,7 +503,7 @@ ActiveRecord::Schema.define(version: 20170114174536) do
594
503
  t.index ["name"], name: "index_languages_on_name", unique: true
595
504
  end
596
505
 
597
- create_table "lending_policies", id: :serial, force: :cascade do |t|
506
+ create_table "lending_policies", force: :cascade do |t|
598
507
  t.integer "item_id", null: false
599
508
  t.integer "user_group_id", null: false
600
509
  t.integer "loan_period", default: 0, null: false
@@ -603,15 +512,15 @@ ActiveRecord::Schema.define(version: 20170114174536) do
603
512
  t.integer "fine", default: 0, null: false
604
513
  t.text "note"
605
514
  t.integer "position"
606
- t.datetime "created_at", null: false
607
- t.datetime "updated_at", null: false
515
+ t.datetime "created_at"
516
+ t.datetime "updated_at"
608
517
  t.index ["item_id", "user_group_id"], name: "index_lending_policies_on_item_id_and_user_group_id", unique: true
609
518
  end
610
519
 
611
- create_table "libraries", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
520
+ create_table "libraries", force: :cascade do |t|
612
521
  t.string "name", null: false
613
- t.jsonb "display_name_translations"
614
- t.jsonb "short_display_name_translations"
522
+ t.text "display_name"
523
+ t.string "short_display_name", null: false
615
524
  t.string "zip_code"
616
525
  t.text "street"
617
526
  t.text "locality"
@@ -622,127 +531,139 @@ ActiveRecord::Schema.define(version: 20170114174536) do
622
531
  t.text "note"
623
532
  t.integer "call_number_rows", default: 1, null: false
624
533
  t.string "call_number_delimiter", default: "|", null: false
625
- t.integer "library_group_id", default: 1, null: false
534
+ t.integer "library_group_id", null: false
626
535
  t.integer "users_count", default: 0, null: false
627
536
  t.integer "position"
628
537
  t.integer "country_id"
629
- t.datetime "created_at", null: false
630
- t.datetime "updated_at", null: false
538
+ t.datetime "created_at"
539
+ t.datetime "updated_at"
631
540
  t.datetime "deleted_at"
632
541
  t.text "opening_hour"
633
542
  t.string "isil"
634
543
  t.float "latitude"
635
544
  t.float "longitude"
636
545
  t.index ["library_group_id"], name: "index_libraries_on_library_group_id"
637
- t.index ["name"], name: "index_libraries_on_name", unique: true
546
+ t.index ["name"], name: "index_libraries_on_name"
638
547
  end
639
548
 
640
- create_table "library_groups", id: :serial, force: :cascade do |t|
549
+ create_table "library_group_translations", force: :cascade do |t|
550
+ t.integer "library_group_id", null: false
551
+ t.string "locale", null: false
552
+ t.datetime "created_at", null: false
553
+ t.datetime "updated_at", null: false
554
+ t.text "login_banner"
555
+ t.text "footer_banner"
556
+ t.index ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
557
+ t.index ["locale"], name: "index_library_group_translations_on_locale"
558
+ end
559
+
560
+ create_table "library_groups", force: :cascade do |t|
641
561
  t.string "name", null: false
642
- t.jsonb "display_name_translations"
562
+ t.text "display_name"
643
563
  t.string "short_name", null: false
644
- t.cidr "my_networks"
645
- t.jsonb "login_banner_translations"
564
+ t.text "my_networks"
565
+ t.text "old_login_banner"
646
566
  t.text "note"
647
567
  t.integer "country_id"
648
568
  t.integer "position"
649
- t.datetime "created_at", null: false
650
- t.datetime "updated_at", null: false
651
- t.cidr "admin_networks"
569
+ t.datetime "created_at"
570
+ t.datetime "updated_at"
571
+ t.text "admin_networks"
652
572
  t.string "url", default: "http://localhost:3000/"
653
- t.jsonb "settings"
654
- t.jsonb "footer_banner_translations"
573
+ t.text "settings"
655
574
  t.text "html_snippet"
656
- t.string "book_jacket_source"
657
575
  t.integer "max_number_of_results", default: 500
658
576
  t.boolean "family_name_first", default: true
659
- t.string "screenshot_generator"
660
577
  t.integer "pub_year_facet_range_interval", default: 10
661
578
  t.integer "user_id"
662
- t.index ["name"], name: "index_library_groups_on_name", unique: true
663
- t.index ["short_name"], name: "index_library_groups_on_short_name", unique: true
579
+ t.boolean "csv_charset_conversion", default: false, null: false
580
+ t.string "header_logo_file_name"
581
+ t.string "header_logo_content_type"
582
+ t.integer "header_logo_file_size"
583
+ t.datetime "header_logo_updated_at"
584
+ t.text "header_logo_meta"
585
+ t.index ["short_name"], name: "index_library_groups_on_short_name"
664
586
  t.index ["user_id"], name: "index_library_groups_on_user_id"
665
587
  end
666
588
 
667
- create_table "licenses", id: :serial, force: :cascade do |t|
589
+ create_table "licenses", force: :cascade do |t|
668
590
  t.string "name", null: false
669
591
  t.string "display_name"
670
592
  t.text "note"
671
593
  t.integer "position"
672
- t.datetime "created_at", null: false
673
- t.datetime "updated_at", null: false
594
+ t.datetime "created_at"
595
+ t.datetime "updated_at"
674
596
  end
675
597
 
676
- create_table "manifestation_checkout_stat_transitions", id: :serial, force: :cascade do |t|
598
+ create_table "manifestation_checkout_stat_transitions", force: :cascade do |t|
677
599
  t.string "to_state"
678
600
  t.text "metadata", default: "{}"
679
601
  t.integer "sort_key"
680
602
  t.integer "manifestation_checkout_stat_id"
681
- t.datetime "created_at", null: false
682
- t.datetime "updated_at", null: false
603
+ t.datetime "created_at"
604
+ t.datetime "updated_at"
683
605
  t.boolean "most_recent"
684
606
  t.index ["manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_stat_id"
685
607
  t.index ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
686
608
  end
687
609
 
688
- create_table "manifestation_checkout_stats", id: :serial, force: :cascade do |t|
610
+ create_table "manifestation_checkout_stats", force: :cascade do |t|
689
611
  t.datetime "start_date"
690
612
  t.datetime "end_date"
691
613
  t.text "note"
692
- t.datetime "created_at", null: false
693
- t.datetime "updated_at", null: false
614
+ t.datetime "created_at"
615
+ t.datetime "updated_at"
694
616
  t.datetime "started_at"
695
617
  t.datetime "completed_at"
696
618
  t.integer "user_id"
697
619
  t.index ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
698
620
  end
699
621
 
700
- create_table "manifestation_relationship_types", id: :serial, force: :cascade do |t|
622
+ create_table "manifestation_relationship_types", force: :cascade do |t|
701
623
  t.string "name", null: false
702
624
  t.text "display_name"
703
625
  t.text "note"
704
626
  t.integer "position"
705
- t.datetime "created_at", null: false
706
- t.datetime "updated_at", null: false
627
+ t.datetime "created_at"
628
+ t.datetime "updated_at"
707
629
  end
708
630
 
709
- create_table "manifestation_relationships", id: :serial, force: :cascade do |t|
710
- t.uuid "parent_id"
711
- t.uuid "child_id"
631
+ create_table "manifestation_relationships", force: :cascade do |t|
632
+ t.integer "parent_id"
633
+ t.integer "child_id"
712
634
  t.integer "manifestation_relationship_type_id"
713
- t.datetime "created_at", null: false
714
- t.datetime "updated_at", null: false
635
+ t.datetime "created_at"
636
+ t.datetime "updated_at"
715
637
  t.integer "position"
716
638
  t.index ["child_id"], name: "index_manifestation_relationships_on_child_id"
717
- t.index ["manifestation_relationship_type_id"], name: "index_manifestation_relationships_on_relationship_type_id"
718
639
  t.index ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
719
640
  end
720
641
 
721
- create_table "manifestation_reserve_stat_transitions", id: :serial, force: :cascade do |t|
642
+ create_table "manifestation_reserve_stat_transitions", force: :cascade do |t|
722
643
  t.string "to_state"
723
644
  t.text "metadata", default: "{}"
724
645
  t.integer "sort_key"
725
646
  t.integer "manifestation_reserve_stat_id"
726
- t.datetime "created_at", null: false
727
- t.datetime "updated_at", null: false
647
+ t.datetime "created_at"
648
+ t.datetime "updated_at"
728
649
  t.boolean "most_recent"
729
650
  t.index ["manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_stat_id"
730
651
  t.index ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
731
652
  end
732
653
 
733
- create_table "manifestation_reserve_stats", id: :serial, force: :cascade do |t|
654
+ create_table "manifestation_reserve_stats", force: :cascade do |t|
734
655
  t.datetime "start_date"
735
656
  t.datetime "end_date"
736
657
  t.text "note"
737
- t.datetime "created_at", null: false
738
- t.datetime "updated_at", null: false
658
+ t.datetime "created_at"
659
+ t.datetime "updated_at"
739
660
  t.datetime "started_at"
740
661
  t.datetime "completed_at"
741
662
  t.integer "user_id"
742
663
  t.index ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
743
664
  end
744
665
 
745
- create_table "manifestations", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
666
+ create_table "manifestations", force: :cascade do |t|
746
667
  t.text "original_title", null: false
747
668
  t.text "title_alternative"
748
669
  t.text "title_transcription"
@@ -750,12 +671,12 @@ ActiveRecord::Schema.define(version: 20170114174536) do
750
671
  t.string "manifestation_identifier"
751
672
  t.datetime "date_of_publication"
752
673
  t.datetime "date_copyrighted"
753
- t.datetime "created_at", null: false
754
- t.datetime "updated_at", null: false
674
+ t.datetime "created_at"
675
+ t.datetime "updated_at"
755
676
  t.datetime "deleted_at"
756
677
  t.string "access_address"
757
678
  t.integer "language_id", default: 1, null: false
758
- t.integer "carrier_type_id", null: false
679
+ t.integer "carrier_type_id", default: 1, null: false
759
680
  t.integer "start_page"
760
681
  t.integer "end_page"
761
682
  t.integer "height"
@@ -776,7 +697,7 @@ ActiveRecord::Schema.define(version: 20170114174536) do
776
697
  t.boolean "subscription_master", default: false, null: false
777
698
  t.string "attachment_file_name"
778
699
  t.string "attachment_content_type"
779
- t.integer "attachment_size"
700
+ t.integer "attachment_file_size"
780
701
  t.datetime "attachment_updated_at"
781
702
  t.text "title_alternative_transcription"
782
703
  t.text "description"
@@ -801,97 +722,145 @@ ActiveRecord::Schema.define(version: 20170114174536) do
801
722
  t.text "publication_place"
802
723
  t.text "extent"
803
724
  t.text "dimensions"
804
- t.string "attachment_id"
805
- t.string "attachment_fingerprint"
806
- t.jsonb "attachment_data"
807
725
  t.index ["access_address"], name: "index_manifestations_on_access_address"
808
- t.index ["attachment_id"], name: "index_manifestations_on_attachment_id"
809
- t.index ["carrier_type_id"], name: "index_manifestations_on_carrier_type_id"
810
726
  t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
811
- t.index ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier", unique: true
727
+ t.index ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier"
812
728
  t.index ["updated_at"], name: "index_manifestations_on_updated_at"
813
729
  end
814
730
 
815
- create_table "medium_of_performances", id: :serial, force: :cascade do |t|
731
+ create_table "medium_of_performances", force: :cascade do |t|
816
732
  t.string "name", null: false
817
- t.jsonb "display_name_translations"
733
+ t.text "display_name"
818
734
  t.text "note"
819
735
  t.integer "position"
820
- t.datetime "created_at", null: false
821
- t.datetime "updated_at", null: false
736
+ t.datetime "created_at"
737
+ t.datetime "updated_at"
738
+ end
739
+
740
+ create_table "message_request_transitions", force: :cascade do |t|
741
+ t.string "to_state"
742
+ t.text "metadata", default: "{}"
743
+ t.integer "sort_key"
744
+ t.integer "message_request_id"
745
+ t.datetime "created_at"
746
+ t.datetime "updated_at"
747
+ t.index ["message_request_id"], name: "index_message_request_transitions_on_message_request_id"
748
+ t.index ["sort_key", "message_request_id"], name: "index_message_request_transitions_on_sort_key_and_request_id", unique: true
749
+ end
750
+
751
+ create_table "message_requests", force: :cascade do |t|
752
+ t.integer "sender_id"
753
+ t.integer "receiver_id"
754
+ t.integer "message_template_id"
755
+ t.datetime "sent_at"
756
+ t.datetime "deleted_at"
757
+ t.text "body"
758
+ t.datetime "created_at"
759
+ t.datetime "updated_at"
760
+ end
761
+
762
+ create_table "message_templates", force: :cascade do |t|
763
+ t.string "status", null: false
764
+ t.text "title", null: false
765
+ t.text "body", null: false
766
+ t.integer "position"
767
+ t.string "locale", default: "en"
768
+ t.datetime "created_at"
769
+ t.datetime "updated_at"
770
+ t.index ["status"], name: "index_message_templates_on_status", unique: true
771
+ end
772
+
773
+ create_table "message_transitions", force: :cascade do |t|
774
+ t.string "to_state"
775
+ t.text "metadata", default: "{}"
776
+ t.integer "sort_key"
777
+ t.integer "message_id"
778
+ t.datetime "created_at"
779
+ t.datetime "updated_at"
780
+ t.boolean "most_recent"
781
+ t.index ["message_id"], name: "index_message_transitions_on_message_id"
782
+ t.index ["sort_key", "message_id"], name: "index_message_transitions_on_sort_key_and_message_id", unique: true
783
+ end
784
+
785
+ create_table "messages", force: :cascade do |t|
786
+ t.datetime "read_at"
787
+ t.integer "receiver_id"
788
+ t.integer "sender_id"
789
+ t.string "subject", null: false
790
+ t.text "body"
791
+ t.integer "message_request_id"
792
+ t.integer "parent_id"
793
+ t.datetime "created_at"
794
+ t.datetime "updated_at"
795
+ t.integer "lft"
796
+ t.integer "rgt"
797
+ t.integer "depth"
798
+ t.index ["message_request_id"], name: "index_messages_on_message_request_id"
799
+ t.index ["parent_id"], name: "index_messages_on_parent_id"
800
+ t.index ["receiver_id"], name: "index_messages_on_receiver_id"
801
+ t.index ["sender_id"], name: "index_messages_on_sender_id"
822
802
  end
823
803
 
824
- create_table "owns", id: :serial, force: :cascade do |t|
804
+ create_table "owns", force: :cascade do |t|
825
805
  t.integer "agent_id", null: false
826
- t.uuid "item_id", null: false
806
+ t.integer "item_id", null: false
827
807
  t.integer "position"
828
- t.datetime "created_at", null: false
829
- t.datetime "updated_at", null: false
808
+ t.datetime "created_at"
809
+ t.datetime "updated_at"
830
810
  t.index ["agent_id"], name: "index_owns_on_agent_id"
831
811
  t.index ["item_id"], name: "index_owns_on_item_id"
832
812
  end
833
813
 
834
- create_table "periodicals", id: :serial, force: :cascade do |t|
835
- t.text "original_title"
836
- t.string "periodical_type"
837
- t.uuid "manifestation_id"
838
- t.datetime "created_at", null: false
839
- t.datetime "updated_at", null: false
840
- t.index ["manifestation_id"], name: "index_periodicals_on_manifestation_id"
841
- end
842
-
843
- create_table "picture_files", id: :serial, force: :cascade do |t|
814
+ create_table "picture_files", force: :cascade do |t|
844
815
  t.integer "picture_attachable_id"
845
816
  t.string "picture_attachable_type"
846
817
  t.string "content_type"
847
818
  t.text "title"
848
819
  t.string "thumbnail"
849
820
  t.integer "position"
850
- t.datetime "created_at", null: false
851
- t.datetime "updated_at", null: false
821
+ t.datetime "created_at"
822
+ t.datetime "updated_at"
852
823
  t.string "picture_file_name"
853
824
  t.string "picture_content_type"
854
- t.integer "picture_size"
825
+ t.integer "picture_file_size"
855
826
  t.datetime "picture_updated_at"
856
827
  t.text "picture_meta"
857
828
  t.string "picture_fingerprint"
858
- t.string "picture_id"
859
- t.jsonb "image_data"
860
829
  t.index ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
861
- t.index ["picture_id"], name: "index_picture_files_on_picture_id"
862
830
  end
863
831
 
864
- create_table "produce_types", id: :serial, force: :cascade do |t|
832
+ create_table "produce_types", force: :cascade do |t|
865
833
  t.string "name"
866
834
  t.text "display_name"
867
835
  t.text "note"
868
836
  t.integer "position"
869
- t.datetime "created_at", null: false
870
- t.datetime "updated_at", null: false
837
+ t.datetime "created_at"
838
+ t.datetime "updated_at"
871
839
  end
872
840
 
873
- create_table "produces", id: :serial, force: :cascade do |t|
841
+ create_table "produces", force: :cascade do |t|
874
842
  t.integer "agent_id", null: false
875
- t.uuid "manifestation_id", null: false
843
+ t.integer "manifestation_id", null: false
876
844
  t.integer "position"
877
- t.datetime "created_at", null: false
878
- t.datetime "updated_at", null: false
845
+ t.datetime "created_at"
846
+ t.datetime "updated_at"
879
847
  t.integer "produce_type_id"
880
848
  t.index ["agent_id"], name: "index_produces_on_agent_id"
881
849
  t.index ["manifestation_id"], name: "index_produces_on_manifestation_id"
882
850
  end
883
851
 
884
- create_table "profiles", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
885
- t.uuid "user_group_id"
886
- t.uuid "library_id"
852
+ create_table "profiles", force: :cascade do |t|
853
+ t.integer "user_id"
854
+ t.integer "user_group_id"
855
+ t.integer "library_id"
887
856
  t.string "locale"
888
857
  t.string "user_number"
889
858
  t.text "full_name"
890
859
  t.text "note"
891
860
  t.text "keyword_list"
892
861
  t.integer "required_role_id"
893
- t.datetime "created_at", null: false
894
- t.datetime "updated_at", null: false
862
+ t.datetime "created_at"
863
+ t.datetime "updated_at"
895
864
  t.string "checkout_icalendar_token"
896
865
  t.boolean "save_checkout_history", default: false, null: false
897
866
  t.datetime "expired_at"
@@ -900,89 +869,88 @@ ActiveRecord::Schema.define(version: 20170114174536) do
900
869
  t.index ["checkout_icalendar_token"], name: "index_profiles_on_checkout_icalendar_token", unique: true
901
870
  t.index ["library_id"], name: "index_profiles_on_library_id"
902
871
  t.index ["user_group_id"], name: "index_profiles_on_user_group_id"
872
+ t.index ["user_id"], name: "index_profiles_on_user_id"
903
873
  t.index ["user_number"], name: "index_profiles_on_user_number", unique: true
904
874
  end
905
875
 
906
- create_table "realize_types", id: :serial, force: :cascade do |t|
876
+ create_table "realize_types", force: :cascade do |t|
907
877
  t.string "name"
908
878
  t.text "display_name"
909
879
  t.text "note"
910
880
  t.integer "position"
911
- t.datetime "created_at", null: false
912
- t.datetime "updated_at", null: false
881
+ t.datetime "created_at"
882
+ t.datetime "updated_at"
913
883
  end
914
884
 
915
- create_table "realizes", id: :serial, force: :cascade do |t|
885
+ create_table "realizes", force: :cascade do |t|
916
886
  t.integer "agent_id", null: false
917
- t.uuid "expression_id", null: false
887
+ t.integer "expression_id", null: false
918
888
  t.integer "position"
919
- t.datetime "created_at", null: false
920
- t.datetime "updated_at", null: false
889
+ t.datetime "created_at"
890
+ t.datetime "updated_at"
921
891
  t.integer "realize_type_id"
922
892
  t.index ["agent_id"], name: "index_realizes_on_agent_id"
923
893
  t.index ["expression_id"], name: "index_realizes_on_expression_id"
924
894
  end
925
895
 
926
- create_table "request_status_types", id: :serial, force: :cascade do |t|
896
+ create_table "request_status_types", force: :cascade do |t|
927
897
  t.string "name", null: false
928
- t.jsonb "display_name_translations"
898
+ t.text "display_name"
929
899
  t.text "note"
930
900
  t.integer "position"
931
- t.datetime "created_at", null: false
932
- t.datetime "updated_at", null: false
933
- t.index ["name"], name: "index_request_status_types_on_name", unique: true
901
+ t.datetime "created_at"
902
+ t.datetime "updated_at"
934
903
  end
935
904
 
936
- create_table "request_types", id: :serial, force: :cascade do |t|
905
+ create_table "request_types", force: :cascade do |t|
937
906
  t.string "name", null: false
938
- t.jsonb "display_name_translations"
907
+ t.text "display_name"
939
908
  t.text "note"
940
909
  t.integer "position"
941
- t.datetime "created_at", null: false
942
- t.datetime "updated_at", null: false
943
- t.index ["name"], name: "index_request_types_on_name", unique: true
910
+ t.datetime "created_at"
911
+ t.datetime "updated_at"
944
912
  end
945
913
 
946
- create_table "reserve_stat_has_manifestations", id: :serial, force: :cascade do |t|
914
+ create_table "reserve_stat_has_manifestations", force: :cascade do |t|
947
915
  t.integer "manifestation_reserve_stat_id", null: false
948
916
  t.integer "manifestation_id", null: false
949
917
  t.integer "reserves_count"
950
- t.datetime "created_at", null: false
951
- t.datetime "updated_at", null: false
918
+ t.datetime "created_at"
919
+ t.datetime "updated_at"
952
920
  t.index ["manifestation_id"], name: "index_reserve_stat_has_manifestations_on_manifestation_id"
953
921
  t.index ["manifestation_reserve_stat_id"], name: "index_reserve_stat_has_manifestations_on_m_reserve_stat_id"
954
922
  end
955
923
 
956
- create_table "reserve_stat_has_users", id: :serial, force: :cascade do |t|
924
+ create_table "reserve_stat_has_users", force: :cascade do |t|
957
925
  t.integer "user_reserve_stat_id", null: false
958
926
  t.integer "user_id", null: false
959
927
  t.integer "reserves_count"
960
- t.datetime "created_at", null: false
961
- t.datetime "updated_at", null: false
928
+ t.datetime "created_at"
929
+ t.datetime "updated_at"
962
930
  t.index ["user_id"], name: "index_reserve_stat_has_users_on_user_id"
963
931
  t.index ["user_reserve_stat_id"], name: "index_reserve_stat_has_users_on_user_reserve_stat_id"
964
932
  end
965
933
 
966
- create_table "reserve_transitions", id: :serial, force: :cascade do |t|
934
+ create_table "reserve_transitions", force: :cascade do |t|
967
935
  t.string "to_state"
968
936
  t.text "metadata", default: "{}"
969
937
  t.integer "sort_key"
970
938
  t.integer "reserve_id"
971
- t.datetime "created_at", null: false
972
- t.datetime "updated_at", null: false
939
+ t.datetime "created_at"
940
+ t.datetime "updated_at"
973
941
  t.boolean "most_recent"
974
942
  t.index ["reserve_id"], name: "index_reserve_transitions_on_reserve_id"
975
943
  t.index ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
976
944
  end
977
945
 
978
- create_table "reserves", id: :serial, force: :cascade do |t|
946
+ create_table "reserves", force: :cascade do |t|
979
947
  t.integer "user_id", null: false
980
948
  t.integer "manifestation_id", null: false
981
949
  t.integer "item_id"
982
950
  t.integer "request_status_type_id", null: false
983
951
  t.datetime "checked_out_at"
984
- t.datetime "created_at", null: false
985
- t.datetime "updated_at", null: false
952
+ t.datetime "created_at"
953
+ t.datetime "updated_at"
986
954
  t.datetime "canceled_at"
987
955
  t.datetime "expired_at"
988
956
  t.datetime "deleted_at"
@@ -999,43 +967,40 @@ ActiveRecord::Schema.define(version: 20170114174536) do
999
967
  t.index ["user_id"], name: "index_reserves_on_user_id"
1000
968
  end
1001
969
 
1002
- create_table "resource_export_file_transitions", id: :serial, force: :cascade do |t|
970
+ create_table "resource_export_file_transitions", force: :cascade do |t|
1003
971
  t.string "to_state"
1004
- t.jsonb "metadata", default: "{}"
972
+ t.text "metadata", default: "{}"
1005
973
  t.integer "sort_key"
1006
974
  t.integer "resource_export_file_id"
1007
- t.datetime "created_at", null: false
1008
- t.datetime "updated_at", null: false
1009
- t.boolean "most_recent"
975
+ t.datetime "created_at"
976
+ t.datetime "updated_at"
1010
977
  t.index ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
1011
978
  t.index ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
1012
979
  end
1013
980
 
1014
- create_table "resource_export_files", id: :serial, force: :cascade do |t|
981
+ create_table "resource_export_files", force: :cascade do |t|
1015
982
  t.integer "user_id"
983
+ t.string "resource_export_file_name"
984
+ t.string "resource_export_content_type"
985
+ t.integer "resource_export_file_size"
986
+ t.datetime "resource_export_updated_at"
1016
987
  t.datetime "executed_at"
1017
- t.datetime "created_at", null: false
1018
- t.datetime "updated_at", null: false
1019
- t.string "resource_export_id"
1020
- t.integer "resource_export_size"
1021
- t.string "resource_export_filename"
1022
- t.jsonb "attachment_data"
1023
- t.index ["resource_export_id"], name: "index_resource_export_files_on_resource_export_id"
988
+ t.datetime "created_at"
989
+ t.datetime "updated_at"
1024
990
  end
1025
991
 
1026
- create_table "resource_import_file_transitions", id: :serial, force: :cascade do |t|
992
+ create_table "resource_import_file_transitions", force: :cascade do |t|
1027
993
  t.string "to_state"
1028
- t.jsonb "metadata", default: "{}"
994
+ t.text "metadata", default: "{}"
1029
995
  t.integer "sort_key"
1030
996
  t.integer "resource_import_file_id"
1031
- t.datetime "created_at", null: false
1032
- t.datetime "updated_at", null: false
1033
- t.boolean "most_recent"
997
+ t.datetime "created_at"
998
+ t.datetime "updated_at"
1034
999
  t.index ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
1035
1000
  t.index ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
1036
1001
  end
1037
1002
 
1038
- create_table "resource_import_files", id: :serial, force: :cascade do |t|
1003
+ create_table "resource_import_files", force: :cascade do |t|
1039
1004
  t.integer "parent_id"
1040
1005
  t.string "content_type"
1041
1006
  t.integer "size"
@@ -1044,44 +1009,43 @@ ActiveRecord::Schema.define(version: 20170114174536) do
1044
1009
  t.datetime "executed_at"
1045
1010
  t.string "resource_import_file_name"
1046
1011
  t.string "resource_import_content_type"
1047
- t.integer "resource_import_size"
1012
+ t.integer "resource_import_file_size"
1048
1013
  t.datetime "resource_import_updated_at"
1049
- t.datetime "created_at", null: false
1050
- t.datetime "updated_at", null: false
1014
+ t.datetime "created_at"
1015
+ t.datetime "updated_at"
1051
1016
  t.string "edit_mode"
1052
1017
  t.string "resource_import_fingerprint"
1018
+ t.text "error_message"
1053
1019
  t.string "user_encoding"
1054
1020
  t.integer "default_shelf_id"
1055
- t.string "resource_import_id"
1056
- t.jsonb "attachment_data"
1057
1021
  t.index ["parent_id"], name: "index_resource_import_files_on_parent_id"
1058
- t.index ["resource_import_id"], name: "index_resource_import_files_on_resource_import_id"
1059
1022
  t.index ["user_id"], name: "index_resource_import_files_on_user_id"
1060
1023
  end
1061
1024
 
1062
- create_table "resource_import_results", id: :serial, force: :cascade do |t|
1025
+ create_table "resource_import_results", force: :cascade do |t|
1063
1026
  t.integer "resource_import_file_id"
1064
1027
  t.integer "manifestation_id"
1065
1028
  t.integer "item_id"
1066
1029
  t.text "body"
1067
- t.datetime "created_at", null: false
1068
- t.datetime "updated_at", null: false
1030
+ t.datetime "created_at"
1031
+ t.datetime "updated_at"
1032
+ t.text "error_message"
1069
1033
  t.index ["item_id"], name: "index_resource_import_results_on_item_id"
1070
1034
  t.index ["manifestation_id"], name: "index_resource_import_results_on_manifestation_id"
1071
1035
  t.index ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
1072
1036
  end
1073
1037
 
1074
- create_table "roles", id: :serial, force: :cascade do |t|
1038
+ create_table "roles", force: :cascade do |t|
1075
1039
  t.string "name", null: false
1076
- t.jsonb "display_name_translations"
1040
+ t.string "display_name"
1077
1041
  t.text "note"
1078
- t.datetime "created_at", null: false
1079
- t.datetime "updated_at", null: false
1042
+ t.datetime "created_at"
1043
+ t.datetime "updated_at"
1080
1044
  t.integer "score", default: 0, null: false
1081
1045
  t.integer "position"
1082
1046
  end
1083
1047
 
1084
- create_table "search_engines", id: :serial, force: :cascade do |t|
1048
+ create_table "search_engines", force: :cascade do |t|
1085
1049
  t.string "name", null: false
1086
1050
  t.text "display_name"
1087
1051
  t.string "url", null: false
@@ -1091,33 +1055,33 @@ ActiveRecord::Schema.define(version: 20170114174536) do
1091
1055
  t.text "additional_param"
1092
1056
  t.text "note"
1093
1057
  t.integer "position"
1094
- t.datetime "created_at", null: false
1095
- t.datetime "updated_at", null: false
1058
+ t.datetime "created_at"
1059
+ t.datetime "updated_at"
1096
1060
  end
1097
1061
 
1098
- create_table "series_statement_merge_lists", id: :serial, force: :cascade do |t|
1062
+ create_table "series_statement_merge_lists", force: :cascade do |t|
1099
1063
  t.string "title"
1100
- t.datetime "created_at", null: false
1101
- t.datetime "updated_at", null: false
1064
+ t.datetime "created_at"
1065
+ t.datetime "updated_at"
1102
1066
  end
1103
1067
 
1104
- create_table "series_statement_merges", id: :serial, force: :cascade do |t|
1068
+ create_table "series_statement_merges", force: :cascade do |t|
1105
1069
  t.integer "series_statement_id", null: false
1106
1070
  t.integer "series_statement_merge_list_id", null: false
1107
- t.datetime "created_at", null: false
1108
- t.datetime "updated_at", null: false
1071
+ t.datetime "created_at"
1072
+ t.datetime "updated_at"
1109
1073
  t.index ["series_statement_id"], name: "index_series_statement_merges_on_series_statement_id"
1110
1074
  t.index ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
1111
1075
  end
1112
1076
 
1113
- create_table "series_statements", id: :serial, force: :cascade do |t|
1077
+ create_table "series_statements", force: :cascade do |t|
1114
1078
  t.text "original_title"
1115
1079
  t.text "numbering"
1116
1080
  t.text "title_subseries"
1117
1081
  t.text "numbering_subseries"
1118
1082
  t.integer "position"
1119
- t.datetime "created_at", null: false
1120
- t.datetime "updated_at", null: false
1083
+ t.datetime "created_at"
1084
+ t.datetime "updated_at"
1121
1085
  t.text "title_transcription"
1122
1086
  t.text "title_alternative"
1123
1087
  t.string "series_statement_identifier"
@@ -1134,98 +1098,103 @@ ActiveRecord::Schema.define(version: 20170114174536) do
1134
1098
  t.index ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
1135
1099
  end
1136
1100
 
1137
- create_table "shelves", id: :serial, force: :cascade do |t|
1101
+ create_table "shelves", force: :cascade do |t|
1138
1102
  t.string "name", null: false
1139
- t.jsonb "display_name_translations"
1103
+ t.text "display_name"
1140
1104
  t.text "note"
1141
- t.uuid "library_id", null: false
1105
+ t.integer "library_id", null: false
1142
1106
  t.integer "items_count", default: 0, null: false
1143
1107
  t.integer "position"
1144
- t.datetime "created_at", null: false
1145
- t.datetime "updated_at", null: false
1108
+ t.datetime "created_at"
1109
+ t.datetime "updated_at"
1146
1110
  t.datetime "deleted_at"
1147
1111
  t.boolean "closed", default: false, null: false
1148
1112
  t.index ["library_id"], name: "index_shelves_on_library_id"
1149
1113
  end
1150
1114
 
1151
- create_table "subscribes", id: :serial, force: :cascade do |t|
1152
- t.integer "subscription_id"
1153
- t.uuid "work_id", null: false
1115
+ create_table "subscribes", force: :cascade do |t|
1116
+ t.integer "subscription_id", null: false
1117
+ t.integer "work_id", null: false
1154
1118
  t.datetime "start_at", null: false
1155
1119
  t.datetime "end_at", null: false
1156
- t.datetime "created_at", null: false
1157
- t.datetime "updated_at", null: false
1120
+ t.datetime "created_at"
1121
+ t.datetime "updated_at"
1158
1122
  t.index ["subscription_id"], name: "index_subscribes_on_subscription_id"
1159
1123
  t.index ["work_id"], name: "index_subscribes_on_work_id"
1160
1124
  end
1161
1125
 
1162
- create_table "subscriptions", id: :serial, force: :cascade do |t|
1126
+ create_table "subscriptions", force: :cascade do |t|
1163
1127
  t.text "title", null: false
1164
1128
  t.text "note"
1165
1129
  t.integer "user_id"
1166
1130
  t.integer "order_list_id"
1167
1131
  t.datetime "deleted_at"
1168
1132
  t.integer "subscribes_count", default: 0, null: false
1169
- t.datetime "created_at", null: false
1170
- t.datetime "updated_at", null: false
1133
+ t.datetime "created_at"
1134
+ t.datetime "updated_at"
1171
1135
  t.index ["order_list_id"], name: "index_subscriptions_on_order_list_id"
1172
1136
  t.index ["user_id"], name: "index_subscriptions_on_user_id"
1173
1137
  end
1174
1138
 
1175
- create_table "use_restrictions", id: :serial, force: :cascade do |t|
1139
+ create_table "use_restrictions", force: :cascade do |t|
1176
1140
  t.string "name", null: false
1177
1141
  t.text "display_name"
1178
1142
  t.text "note"
1179
1143
  t.integer "position"
1180
- t.datetime "created_at", null: false
1181
- t.datetime "updated_at", null: false
1144
+ t.datetime "created_at"
1145
+ t.datetime "updated_at"
1182
1146
  end
1183
1147
 
1184
- create_table "user_checkout_stat_transitions", id: :serial, force: :cascade do |t|
1148
+ create_table "user_checkout_stat_transitions", force: :cascade do |t|
1185
1149
  t.string "to_state"
1186
1150
  t.text "metadata", default: "{}"
1187
1151
  t.integer "sort_key"
1188
1152
  t.integer "user_checkout_stat_id"
1189
- t.datetime "created_at", null: false
1190
- t.datetime "updated_at", null: false
1153
+ t.datetime "created_at"
1154
+ t.datetime "updated_at"
1191
1155
  t.boolean "most_recent"
1192
1156
  t.index ["sort_key", "user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_sort_key_and_stat_id", unique: true
1193
1157
  t.index ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
1194
1158
  end
1195
1159
 
1196
- create_table "user_checkout_stats", id: :serial, force: :cascade do |t|
1160
+ create_table "user_checkout_stats", force: :cascade do |t|
1197
1161
  t.datetime "start_date"
1198
1162
  t.datetime "end_date"
1199
1163
  t.text "note"
1200
- t.datetime "created_at", null: false
1201
- t.datetime "updated_at", null: false
1164
+ t.datetime "created_at"
1165
+ t.datetime "updated_at"
1202
1166
  t.datetime "started_at"
1203
1167
  t.datetime "completed_at"
1204
1168
  t.integer "user_id"
1205
1169
  t.index ["user_id"], name: "index_user_checkout_stats_on_user_id"
1206
1170
  end
1207
1171
 
1208
- create_table "user_export_file_transitions", id: :serial, force: :cascade do |t|
1172
+ create_table "user_export_file_transitions", force: :cascade do |t|
1209
1173
  t.string "to_state"
1210
1174
  t.text "metadata", default: "{}"
1211
1175
  t.integer "sort_key"
1212
1176
  t.integer "user_export_file_id"
1213
- t.datetime "created_at", null: false
1214
- t.datetime "updated_at", null: false
1177
+ t.datetime "created_at"
1178
+ t.datetime "updated_at"
1215
1179
  t.boolean "most_recent"
1216
1180
  t.index ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
1217
1181
  t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_file_id"
1182
+ t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
1218
1183
  end
1219
1184
 
1220
- create_table "user_export_files", id: :serial, force: :cascade do |t|
1185
+ create_table "user_export_files", force: :cascade do |t|
1221
1186
  t.integer "user_id"
1187
+ t.string "user_export_file_name"
1188
+ t.string "user_export_content_type"
1189
+ t.integer "user_export_file_size"
1190
+ t.datetime "user_export_updated_at"
1222
1191
  t.datetime "executed_at"
1223
- t.datetime "created_at", null: false
1224
- t.datetime "updated_at", null: false
1225
- t.jsonb "attachment_data"
1192
+ t.datetime "created_at"
1193
+ t.datetime "updated_at"
1194
+ t.index ["user_id"], name: "index_user_export_files_on_user_id"
1226
1195
  end
1227
1196
 
1228
- create_table "user_group_has_checkout_types", id: :serial, force: :cascade do |t|
1197
+ create_table "user_group_has_checkout_types", force: :cascade do |t|
1229
1198
  t.integer "user_group_id", null: false
1230
1199
  t.integer "checkout_type_id", null: false
1231
1200
  t.integer "checkout_limit", default: 0, null: false
@@ -1237,20 +1206,20 @@ ActiveRecord::Schema.define(version: 20170114174536) do
1237
1206
  t.datetime "fixed_due_date"
1238
1207
  t.text "note"
1239
1208
  t.integer "position"
1240
- t.datetime "created_at", null: false
1241
- t.datetime "updated_at", null: false
1209
+ t.datetime "created_at"
1210
+ t.datetime "updated_at"
1242
1211
  t.integer "current_checkout_count"
1243
1212
  t.index ["checkout_type_id"], name: "index_user_group_has_checkout_types_on_checkout_type_id"
1244
1213
  t.index ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1245
1214
  end
1246
1215
 
1247
- create_table "user_groups", id: :uuid, default: -> { "gen_random_uuid()" }, force: :cascade do |t|
1216
+ create_table "user_groups", force: :cascade do |t|
1248
1217
  t.string "name"
1249
- t.jsonb "display_name_translations"
1218
+ t.text "display_name"
1250
1219
  t.text "note"
1251
1220
  t.integer "position"
1252
- t.datetime "created_at", null: false
1253
- t.datetime "updated_at", null: false
1221
+ t.datetime "created_at"
1222
+ t.datetime "updated_at"
1254
1223
  t.datetime "deleted_at"
1255
1224
  t.integer "valid_period_for_new_user", default: 0, null: false
1256
1225
  t.datetime "expired_at"
@@ -1259,79 +1228,82 @@ ActiveRecord::Schema.define(version: 20170114174536) do
1259
1228
  t.integer "number_of_time_to_notify_overdue", default: 3, null: false
1260
1229
  end
1261
1230
 
1262
- create_table "user_has_roles", id: :serial, force: :cascade do |t|
1231
+ create_table "user_has_roles", force: :cascade do |t|
1263
1232
  t.integer "user_id", null: false
1264
1233
  t.integer "role_id", null: false
1265
- t.datetime "created_at", null: false
1266
- t.datetime "updated_at", null: false
1234
+ t.datetime "created_at"
1235
+ t.datetime "updated_at"
1267
1236
  t.index ["role_id"], name: "index_user_has_roles_on_role_id"
1268
1237
  t.index ["user_id"], name: "index_user_has_roles_on_user_id"
1269
1238
  end
1270
1239
 
1271
- create_table "user_import_file_transitions", id: :serial, force: :cascade do |t|
1240
+ create_table "user_import_file_transitions", force: :cascade do |t|
1272
1241
  t.string "to_state"
1273
1242
  t.text "metadata", default: "{}"
1274
1243
  t.integer "sort_key"
1275
1244
  t.integer "user_import_file_id"
1276
- t.datetime "created_at", null: false
1277
- t.datetime "updated_at", null: false
1245
+ t.datetime "created_at"
1246
+ t.datetime "updated_at"
1278
1247
  t.boolean "most_recent"
1279
1248
  t.index ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
1280
1249
  t.index ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
1281
1250
  end
1282
1251
 
1283
- create_table "user_import_files", id: :serial, force: :cascade do |t|
1252
+ create_table "user_import_files", force: :cascade do |t|
1284
1253
  t.integer "user_id"
1285
1254
  t.text "note"
1286
1255
  t.datetime "executed_at"
1287
1256
  t.string "user_import_file_name"
1288
1257
  t.string "user_import_content_type"
1289
- t.string "user_import_file_size"
1258
+ t.integer "user_import_file_size"
1290
1259
  t.datetime "user_import_updated_at"
1291
1260
  t.string "user_import_fingerprint"
1292
1261
  t.string "edit_mode"
1293
1262
  t.text "error_message"
1294
- t.datetime "created_at", null: false
1295
- t.datetime "updated_at", null: false
1263
+ t.datetime "created_at"
1264
+ t.datetime "updated_at"
1296
1265
  t.string "user_encoding"
1297
1266
  t.integer "default_library_id"
1298
1267
  t.integer "default_user_group_id"
1299
- t.jsonb "attachment_data"
1268
+ t.index ["user_id"], name: "index_user_import_files_on_user_id"
1300
1269
  end
1301
1270
 
1302
- create_table "user_import_results", id: :serial, force: :cascade do |t|
1271
+ create_table "user_import_results", force: :cascade do |t|
1303
1272
  t.integer "user_import_file_id"
1304
1273
  t.integer "user_id"
1305
1274
  t.text "body"
1306
- t.datetime "created_at", null: false
1307
- t.datetime "updated_at", null: false
1275
+ t.datetime "created_at"
1276
+ t.datetime "updated_at"
1277
+ t.text "error_message"
1278
+ t.index ["user_id"], name: "index_user_import_results_on_user_id"
1279
+ t.index ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
1308
1280
  end
1309
1281
 
1310
- create_table "user_reserve_stat_transitions", id: :serial, force: :cascade do |t|
1282
+ create_table "user_reserve_stat_transitions", force: :cascade do |t|
1311
1283
  t.string "to_state"
1312
1284
  t.text "metadata", default: "{}"
1313
1285
  t.integer "sort_key"
1314
1286
  t.integer "user_reserve_stat_id"
1315
- t.datetime "created_at", null: false
1316
- t.datetime "updated_at", null: false
1287
+ t.datetime "created_at"
1288
+ t.datetime "updated_at"
1317
1289
  t.boolean "most_recent"
1318
1290
  t.index ["sort_key", "user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_sort_key_and_stat_id", unique: true
1319
1291
  t.index ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
1320
1292
  end
1321
1293
 
1322
- create_table "user_reserve_stats", id: :serial, force: :cascade do |t|
1294
+ create_table "user_reserve_stats", force: :cascade do |t|
1323
1295
  t.datetime "start_date"
1324
1296
  t.datetime "end_date"
1325
1297
  t.text "note"
1326
- t.datetime "created_at", null: false
1327
- t.datetime "updated_at", null: false
1298
+ t.datetime "created_at"
1299
+ t.datetime "updated_at"
1328
1300
  t.datetime "started_at"
1329
1301
  t.datetime "completed_at"
1330
1302
  t.integer "user_id"
1331
1303
  t.index ["user_id"], name: "index_user_reserve_stats_on_user_id"
1332
1304
  end
1333
1305
 
1334
- create_table "users", id: :serial, force: :cascade do |t|
1306
+ create_table "users", force: :cascade do |t|
1335
1307
  t.string "email", default: "", null: false
1336
1308
  t.string "encrypted_password", default: "", null: false
1337
1309
  t.string "reset_password_token"
@@ -1342,8 +1314,8 @@ ActiveRecord::Schema.define(version: 20170114174536) do
1342
1314
  t.datetime "last_sign_in_at"
1343
1315
  t.string "current_sign_in_ip"
1344
1316
  t.string "last_sign_in_ip"
1345
- t.datetime "created_at", null: false
1346
- t.datetime "updated_at", null: false
1317
+ t.datetime "created_at"
1318
+ t.datetime "updated_at"
1347
1319
  t.string "username"
1348
1320
  t.datetime "deleted_at"
1349
1321
  t.datetime "expired_at"
@@ -1351,49 +1323,21 @@ ActiveRecord::Schema.define(version: 20170114174536) do
1351
1323
  t.string "unlock_token"
1352
1324
  t.datetime "locked_at"
1353
1325
  t.datetime "confirmed_at"
1354
- t.uuid "profile_id"
1355
- t.index ["email"], name: "index_users_on_email", unique: true
1356
- t.index ["profile_id"], name: "index_users_on_profile_id"
1326
+ t.index ["email"], name: "index_users_on_email"
1357
1327
  t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
1358
1328
  t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
1359
1329
  t.index ["username"], name: "index_users_on_username", unique: true
1360
1330
  end
1361
1331
 
1362
- create_table "withdraws", id: :serial, force: :cascade do |t|
1332
+ create_table "withdraws", force: :cascade do |t|
1363
1333
  t.integer "basket_id"
1364
- t.uuid "item_id"
1334
+ t.integer "item_id"
1365
1335
  t.integer "librarian_id"
1366
1336
  t.datetime "created_at", null: false
1367
1337
  t.datetime "updated_at", null: false
1368
1338
  t.index ["basket_id"], name: "index_withdraws_on_basket_id"
1369
1339
  t.index ["item_id"], name: "index_withdraws_on_item_id"
1340
+ t.index ["librarian_id"], name: "index_withdraws_on_librarian_id"
1370
1341
  end
1371
1342
 
1372
- add_foreign_key "accepts", "baskets", on_delete: :nullify
1373
- add_foreign_key "accepts", "items"
1374
- add_foreign_key "baskets", "users"
1375
- add_foreign_key "creates", "agents"
1376
- add_foreign_key "doi_records", "manifestations"
1377
- add_foreign_key "exemplifies", "items"
1378
- add_foreign_key "exemplifies", "manifestations"
1379
- add_foreign_key "identifiers", "manifestations"
1380
- add_foreign_key "import_requests", "manifestations"
1381
- add_foreign_key "import_requests", "users"
1382
- add_foreign_key "isbn_records", "manifestations"
1383
- add_foreign_key "issn_records", "manifestations"
1384
- add_foreign_key "items", "manifestations"
1385
- add_foreign_key "library_groups", "users"
1386
- add_foreign_key "owns", "agents"
1387
- add_foreign_key "owns", "items"
1388
- add_foreign_key "periodicals", "manifestations"
1389
- add_foreign_key "produces", "agents"
1390
- add_foreign_key "produces", "manifestations"
1391
- add_foreign_key "shelves", "libraries"
1392
- add_foreign_key "subscribes", "subscriptions"
1393
- add_foreign_key "subscriptions", "users"
1394
- add_foreign_key "user_has_roles", "roles"
1395
- add_foreign_key "user_has_roles", "users", on_delete: :cascade
1396
- add_foreign_key "users", "profiles", on_delete: :cascade
1397
- add_foreign_key "withdraws", "baskets", on_delete: :nullify
1398
- add_foreign_key "withdraws", "items"
1399
1343
  end