enju_seed 0.4.0.beta.1 → 0.4.0.beta.2

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