enju_seed 0.1.1.pre12 → 0.2.0.beta.1

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