enju_circulation 0.2.5 → 0.3.0.beta.1

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