enju_biblio 0.3.13 → 0.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (385) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -3
  3. data/app/controllers/agents_controller.rb +6 -0
  4. data/app/controllers/content_types_controller.rb +1 -1
  5. data/app/controllers/items_controller.rb +10 -18
  6. data/app/controllers/manifestations_controller.rb +85 -80
  7. data/app/controllers/resource_import_results_controller.rb +2 -6
  8. data/app/controllers/series_statements_controller.rb +6 -0
  9. data/app/helpers/enju_biblio/application_helper.rb +5 -5
  10. data/app/helpers/manifestations_helper.rb +12 -12
  11. data/app/models/agent.rb +4 -13
  12. data/app/models/agent_import_file.rb +1 -1
  13. data/app/models/agent_relationship_type.rb +8 -7
  14. data/app/models/agent_type.rb +10 -7
  15. data/app/models/carrier_type.rb +14 -11
  16. data/app/models/content_type.rb +10 -7
  17. data/app/models/create_type.rb +8 -7
  18. data/app/models/doi_record.rb +36 -0
  19. data/app/models/form_of_work.rb +11 -8
  20. data/app/models/frequency.rb +11 -8
  21. data/app/models/identifier.rb +1 -1
  22. data/app/models/identifier_type.rb +1 -0
  23. data/app/models/import_request.rb +3 -4
  24. data/app/models/isbn_record.rb +51 -0
  25. data/app/models/isbn_record_and_manifestation.rb +18 -0
  26. data/app/models/issn_record.rb +49 -0
  27. data/app/models/issn_record_and_manifestation.rb +18 -0
  28. data/app/models/item.rb +7 -55
  29. data/app/models/language.rb +10 -9
  30. data/app/models/license.rb +9 -7
  31. data/app/models/manifestation.rb +271 -158
  32. data/app/models/manifestation_relationship_type.rb +9 -7
  33. data/app/models/medium_of_performance.rb +11 -8
  34. data/app/models/periodical.rb +33 -0
  35. data/app/models/periodical_and_manifestation.rb +16 -0
  36. data/app/models/picture_file.rb +2 -0
  37. data/app/models/produce_type.rb +8 -7
  38. data/app/models/realize_type.rb +8 -7
  39. data/app/models/resource_export_file.rb +8 -6
  40. data/app/models/resource_export_file_state_machine.rb +1 -1
  41. data/app/models/resource_import_file.rb +62 -153
  42. data/app/views/agent_import_results/index.txt.erb +3 -0
  43. data/app/views/agent_relationship_types/index.html.erb +1 -1
  44. data/app/views/agent_relationship_types/show.html.erb +1 -1
  45. data/app/views/agent_relationships/_form.html.erb +1 -1
  46. data/app/views/agent_types/index.html.erb +1 -1
  47. data/app/views/agent_types/show.html.erb +1 -1
  48. data/app/views/agents/_agent.html.erb +1 -1
  49. data/app/views/agents/_agent_list.html.erb +2 -2
  50. data/app/views/agents/_form.html.erb +4 -4
  51. data/app/views/agents/_index_agent.html.erb +1 -1
  52. data/app/views/agents/_index_agent_merge_list.html.erb +1 -1
  53. data/app/views/agents/_index_expression.html.erb +2 -2
  54. data/app/views/agents/_index_manifestation.html.erb +2 -2
  55. data/app/views/agents/_index_work.html.erb +2 -2
  56. data/app/views/agents/index.atom.builder +1 -1
  57. data/app/views/agents/index.rss.builder +3 -3
  58. data/app/views/agents/show.html+phone.erb +2 -2
  59. data/app/views/agents/show.html.erb +2 -2
  60. data/app/views/carrier_types/index.html.erb +2 -2
  61. data/app/views/carrier_types/show.html.erb +3 -3
  62. data/app/views/content_types/index.html.erb +1 -1
  63. data/app/views/content_types/show.html.erb +1 -1
  64. data/app/views/countries/index.html.erb +1 -1
  65. data/app/views/countries/show.html.erb +1 -1
  66. data/app/views/create_types/index.html.erb +1 -1
  67. data/app/views/create_types/show.html.erb +1 -1
  68. data/app/views/creates/_form.html.erb +1 -1
  69. data/app/views/form_of_works/index.html.erb +1 -1
  70. data/app/views/form_of_works/show.html.erb +1 -1
  71. data/app/views/frequencies/index.html.erb +1 -1
  72. data/app/views/frequencies/show.html.erb +1 -1
  73. data/app/views/identifier_types/index.html.erb +1 -1
  74. data/app/views/identifier_types/show.html.erb +1 -1
  75. data/app/views/items/_form.html.erb +13 -33
  76. data/app/views/items/index.html+phone.erb +3 -3
  77. data/app/views/items/index.html.erb +3 -3
  78. data/app/views/items/show.html+phone.erb +5 -5
  79. data/app/views/items/show.html.erb +119 -134
  80. data/app/views/languages/index.html.erb +1 -1
  81. data/app/views/languages/show.html.erb +1 -1
  82. data/app/views/layouts/agents.html.erb +2 -2
  83. data/app/views/layouts/items.html.erb +1 -1
  84. data/app/views/layouts/manifestations.html.erb +4 -4
  85. data/app/views/licenses/index.html.erb +1 -1
  86. data/app/views/licenses/show.html.erb +1 -1
  87. data/app/views/manifestation_relationship_types/index.html.erb +1 -1
  88. data/app/views/manifestation_relationship_types/show.html.erb +1 -1
  89. data/app/views/manifestation_relationships/_form.html.erb +1 -1
  90. data/app/views/manifestations/_call_number.html.erb +3 -3
  91. data/app/views/manifestations/_carrier_type_facet.html.erb +1 -1
  92. data/app/views/manifestations/_classification_facet.html.erb +2 -2
  93. data/app/views/manifestations/_export_detail.html.erb +0 -1
  94. data/app/views/manifestations/_export_list.html.erb +3 -4
  95. data/app/views/manifestations/_form.html.erb +8 -31
  96. data/app/views/manifestations/_identifier_fields.html.erb +1 -1
  97. data/app/views/manifestations/_language_facet.html.erb +1 -1
  98. data/app/views/manifestations/_library_facet.html.erb +1 -1
  99. data/app/views/manifestations/_manifestation.txt.erb +1 -1
  100. data/app/views/manifestations/_pub_year_facet.html.erb +1 -1
  101. data/app/views/manifestations/_reservable_facet.html.erb +2 -2
  102. data/app/views/manifestations/_show_creators.html.erb +1 -1
  103. data/app/views/manifestations/_show_detail_librarian.html.erb +13 -37
  104. data/app/views/manifestations/_show_detail_user.html.erb +13 -25
  105. data/app/views/manifestations/_show_holding.html+phone.erb +3 -3
  106. data/app/views/manifestations/_show_holding.html.erb +2 -2
  107. data/app/views/manifestations/explain.sru +9 -0
  108. data/app/views/manifestations/index.atom.builder +1 -1
  109. data/app/views/manifestations/index.html.erb +7 -7
  110. data/app/views/manifestations/index.opds.builder +1 -1
  111. data/app/views/manifestations/index.rdf.builder +3 -3
  112. data/app/views/manifestations/index.rss.builder +3 -3
  113. data/app/views/manifestations/index.sru.builder +101 -0
  114. data/app/views/manifestations/index.txt.erb +1 -0
  115. data/app/views/manifestations/show.txt.erb +1 -0
  116. data/app/views/medium_of_performances/index.html.erb +1 -1
  117. data/app/views/medium_of_performances/show.html.erb +1 -1
  118. data/app/views/notifier/manifestation_info.en.text.erb +1 -1
  119. data/app/views/notifier/manifestation_info.ja.text.erb +1 -1
  120. data/app/views/picture_files/edit.html.erb +0 -4
  121. data/app/views/produce_types/index.html.erb +1 -1
  122. data/app/views/produce_types/show.html.erb +1 -1
  123. data/app/views/produces/_form.html.erb +1 -1
  124. data/app/views/realize_types/index.html.erb +1 -1
  125. data/app/views/realize_types/show.html.erb +1 -1
  126. data/app/views/realizes/_form.html.erb +1 -1
  127. data/app/views/resource_import_files/_results.html.erb +0 -6
  128. data/app/views/resource_import_files/new.html.erb +2 -2
  129. data/app/views/resource_import_results/index.html.erb +11 -0
  130. data/app/views/resource_import_results/index.txt.erb +3 -0
  131. data/app/views/series_statements/_form.html.erb +8 -6
  132. data/app/views/series_statements/show.html.erb +0 -12
  133. data/config/locales/translation_en.yml +1 -28
  134. data/config/locales/translation_ja.yml +3 -30
  135. data/config/routes.rb +0 -2
  136. data/db/migrate/20081027150907_create_picture_files.rb +2 -0
  137. data/db/migrate/20160319144230_create_issn_records.rb +11 -0
  138. data/db/migrate/20160506144040_create_isbn_records.rb +11 -0
  139. data/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
  140. data/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
  141. data/db/migrate/20190102034126_create_doi_records.rb +13 -0
  142. data/db/migrate/20190311154610_create_periodicals.rb +10 -0
  143. data/db/migrate/20190312033839_create_periodical_and_manifestations.rb +11 -0
  144. data/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  145. data/lib/enju_biblio/openurl.rb +1 -5
  146. data/lib/enju_biblio/porta_cql.rb +282 -0
  147. data/lib/enju_biblio/sru.rb +83 -0
  148. data/lib/enju_biblio/version.rb +1 -1
  149. data/lib/enju_biblio.rb +2 -0
  150. data/lib/generators/enju_biblio/setup/setup_generator.rb +0 -2
  151. data/lib/generators/enju_biblio/setup/templates/db/fixtures/agent_relationship_types.yml +3 -3
  152. data/lib/generators/enju_biblio/setup/templates/db/fixtures/agent_types.yml +2 -4
  153. data/lib/generators/enju_biblio/setup/templates/db/fixtures/carrier_types.yml +8 -26
  154. data/lib/generators/enju_biblio/setup/templates/db/fixtures/content_types.yml +12 -24
  155. data/lib/generators/enju_biblio/setup/templates/db/fixtures/create_types.yml +4 -22
  156. data/lib/generators/enju_biblio/setup/templates/db/fixtures/form_of_works.yml +1 -1
  157. data/lib/generators/enju_biblio/setup/templates/db/fixtures/frequencies.yml +9 -18
  158. data/lib/generators/enju_biblio/setup/templates/db/fixtures/languages.yml +2 -4
  159. data/lib/generators/enju_biblio/setup/templates/db/fixtures/licenses.yml +2 -2
  160. data/lib/generators/enju_biblio/setup/templates/db/fixtures/manifestation_relationship_types.yml +2 -4
  161. data/lib/generators/enju_biblio/setup/templates/db/fixtures/medium_of_performances.yml +15 -0
  162. data/lib/generators/enju_biblio/setup/templates/db/fixtures/produce_types.yml +2 -19
  163. data/lib/generators/enju_biblio/setup/templates/db/fixtures/realize_types.yml +3 -21
  164. data/spec/cassette_library/ImportRequestsController/POST_create/When_logged_in_as_Administrator/with_isbn_which_is_already_imported/assigns_a_newly_created_import_request_as_import_request.yml +121 -0
  165. data/spec/controllers/content_types_controller_spec.rb +1 -1
  166. data/spec/controllers/items_controller_spec.rb +1 -59
  167. data/spec/controllers/manifestations_controller_spec.rb +19 -49
  168. data/spec/dummy/app/helpers/application_helper.rb +1 -1
  169. data/spec/dummy/app/models/user.rb +4 -0
  170. data/spec/dummy/bin/bundle +1 -1
  171. data/spec/dummy/bin/setup +1 -3
  172. data/spec/dummy/bin/update +4 -2
  173. data/spec/dummy/bin/yarn +3 -3
  174. data/spec/dummy/config/application.rb +1 -2
  175. data/spec/dummy/config/database.yml +70 -9
  176. data/spec/dummy/config/initializers/assets.rb +2 -2
  177. data/spec/dummy/db/development.sqlite3 +0 -0
  178. data/spec/dummy/db/migrate/002_devise_create_users.rb +1 -0
  179. data/spec/dummy/db/migrate/113_create_events.rb +2 -4
  180. data/spec/dummy/db/migrate/154_create_messages.rb +4 -8
  181. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +3 -3
  182. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +2 -4
  183. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +2 -4
  184. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +2 -2
  185. data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +1 -0
  186. data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +1 -1
  187. data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +1 -1
  188. data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +1 -1
  189. data/spec/dummy/db/migrate/20140524135607_create_bookmark_stat_transitions.rb +1 -1
  190. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +1 -1
  191. data/spec/dummy/db/migrate/20140812152348_create_event_export_files.rb +1 -1
  192. data/spec/dummy/db/migrate/20140812153137_create_event_export_file_transitions.rb +1 -1
  193. data/spec/dummy/db/migrate/20140814070854_add_default_event_category_id_to_event_import_file.rb +1 -1
  194. data/spec/dummy/db/migrate/20151128142913_create_places.rb +14 -0
  195. data/spec/dummy/db/migrate/20151201163718_add_place_id_to_event.rb +5 -0
  196. data/spec/dummy/db/migrate/20160703184258_add_most_recent_to_event_import_file_transitions.rb +9 -0
  197. data/spec/dummy/db/migrate/20160703184311_add_most_recent_to_event_export_file_transitions.rb +9 -0
  198. data/spec/dummy/db/migrate/20160813191533_add_book_jacket_source_to_library_group.rb +1 -1
  199. data/spec/dummy/db/migrate/20160813191820_add_screenshot_generator_to_library_group.rb +1 -1
  200. data/spec/dummy/db/migrate/20160815045420_add_most_recent_to_bookmark_stat_transitions.rb +9 -0
  201. data/spec/dummy/db/migrate/20170116150432_create_jpno_records.rb +10 -0
  202. data/spec/dummy/db/migrate/20171126072934_create_ndla_records.rb +10 -0
  203. data/spec/dummy/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +13 -0
  204. data/spec/dummy/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +13 -0
  205. data/spec/dummy/db/migrate/20180107164558_add_constraints_to_most_recent_for_event_import_file_transitions.rb +13 -0
  206. data/spec/dummy/db/migrate/20180107164617_add_constraints_to_most_recent_for_event_export_file_transitions.rb +13 -0
  207. data/spec/dummy/db/migrate/20180107172413_add_constraints_to_most_recent_for_bookmark_stat_transitions.rb +13 -0
  208. data/spec/dummy/db/migrate/20180709023035_acts_as_taggable_on_migration.acts_as_taggable_on_engine.rb +36 -0
  209. data/spec/dummy/db/migrate/20180709023036_add_missing_unique_indices.acts_as_taggable_on_engine.rb +26 -0
  210. data/spec/dummy/db/migrate/20180709023037_add_taggings_counter_cache_to_tags.acts_as_taggable_on_engine.rb +20 -0
  211. data/spec/dummy/db/migrate/20180709023038_add_missing_taggable_index.acts_as_taggable_on_engine.rb +15 -0
  212. data/spec/dummy/db/migrate/20180709023039_change_collation_for_tag_names.acts_as_taggable_on_engine.rb +15 -0
  213. data/spec/dummy/db/migrate/20180709023040_add_missing_indexes_on_taggings.acts_as_taggable_on_engine.rb +23 -0
  214. data/spec/dummy/db/migrate/20180709161346_add_created_at_to_tag.rb +6 -0
  215. data/spec/dummy/db/migrate/20181119170645_add_foreign_key_to_events_referencing_event_categories.rb +5 -0
  216. data/spec/dummy/db/migrate/20190501043418_create_ndl_bib_id_records.rb +10 -0
  217. data/spec/dummy/db/migrate/20190508160525_create_retains.rb +10 -0
  218. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  219. data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
  220. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  221. data/spec/dummy/db/migrate/20190630153136_add_display_name_translations_to_event.rb +6 -0
  222. data/spec/dummy/db/migrate/20190706052525_add_display_name_translations_to_circulation_status.rb +5 -0
  223. data/spec/dummy/db/schema.rb +335 -221
  224. data/spec/dummy/db/test.sqlite3 +0 -0
  225. data/spec/factories/create_types.rb +8 -7
  226. data/spec/factories/produce_types.rb +8 -7
  227. data/spec/factories/realize_types.rb +8 -7
  228. data/spec/factories/series_statement.rb +3 -4
  229. data/spec/fixtures/agent_relationship_types.yml +8 -7
  230. data/spec/fixtures/agent_types.yml +11 -10
  231. data/spec/fixtures/carrier_types.yml +16 -15
  232. data/spec/fixtures/content_types.yml +20 -31
  233. data/spec/fixtures/create_types.yml +12 -15
  234. data/spec/fixtures/creates.yml +0 -2
  235. data/spec/fixtures/form_of_works.yml +11 -10
  236. data/spec/fixtures/frequencies.yml +17 -25
  237. data/spec/fixtures/items.yml +11 -12
  238. data/spec/fixtures/languages.yml +11 -11
  239. data/spec/fixtures/libraries.yml +30 -30
  240. data/spec/fixtures/library_groups.yml +11 -6
  241. data/spec/fixtures/licenses.yml +8 -7
  242. data/spec/fixtures/manifestation_relationship_types.yml +12 -11
  243. data/spec/fixtures/manifestations.yml +0 -1
  244. data/spec/fixtures/medium_of_performances.yml +10 -9
  245. data/spec/fixtures/picture_files.yml +2 -0
  246. data/spec/fixtures/produce_types.yml +10 -11
  247. data/spec/fixtures/produces.yml +0 -2
  248. data/spec/fixtures/profiles.yml +8 -5
  249. data/spec/fixtures/realize_types.yml +11 -13
  250. data/spec/fixtures/realizes.yml +0 -2
  251. data/spec/fixtures/request_status_types.yml +14 -14
  252. data/spec/fixtures/request_types.yml +13 -13
  253. data/spec/fixtures/resource_export_files.yml +1 -1
  254. data/spec/fixtures/resource_import_results.yml +2 -2
  255. data/spec/fixtures/roles.yml +22 -5
  256. data/spec/fixtures/shelves.yml +16 -16
  257. data/spec/fixtures/user_groups.yml +12 -12
  258. data/spec/fixtures/user_has_roles.yml +3 -4
  259. data/spec/fixtures/users.yml +0 -3
  260. data/spec/models/agent_relationship_type_spec.rb +8 -7
  261. data/spec/models/agent_type_spec.rb +8 -7
  262. data/spec/models/carrier_type_spec.rb +12 -11
  263. data/spec/models/content_type_spec.rb +8 -7
  264. data/spec/models/create_type_spec.rb +8 -7
  265. data/spec/models/doi_record_spec.rb +19 -0
  266. data/spec/models/form_of_work_spec.rb +8 -7
  267. data/spec/models/frequency_spec.rb +8 -7
  268. data/spec/models/item_spec.rb +0 -7
  269. data/spec/models/language_spec.rb +10 -9
  270. data/spec/models/license_spec.rb +8 -7
  271. data/spec/models/manifestation_relationship_type_spec.rb +8 -7
  272. data/spec/models/manifestation_spec.rb +81 -24
  273. data/spec/models/medium_of_performance_spec.rb +8 -7
  274. data/spec/models/periodical_and_manifestation_spec.rb +17 -0
  275. data/spec/models/periodical_spec.rb +16 -0
  276. data/spec/models/picture_file_spec.rb +2 -0
  277. data/spec/models/produce_type_spec.rb +8 -7
  278. data/spec/models/realize_type_spec.rb +8 -7
  279. data/spec/models/resource_export_file_spec.rb +9 -62
  280. data/spec/models/resource_import_file_spec.rb +14 -44
  281. data/spec/rails_helper.rb +8 -4
  282. data/spec/system/manifestations_spec.rb +0 -30
  283. data/spec/views/items/index.html.erb_spec.rb +6 -7
  284. data/spec/views/manifestations/index.html.erb_spec.rb +1 -1
  285. data/spec/views/manifestations/index.rdf.builder_spec.rb +1 -0
  286. data/spec/views/manifestations/{index.txt.ruby_spec.rb → index.txt.erb_spec.rb} +1 -1
  287. data/spec/views/manifestations/{show.txt.ruby_spec.rb → show.txt.erb_spec.rb} +2 -2
  288. data/spec/views/resource_import_results/show.html.erb_spec.rb +1 -1
  289. metadata +560 -718
  290. data/app/controllers/item_custom_properties_controller.rb +0 -69
  291. data/app/controllers/manifestation_custom_properties_controller.rb +0 -69
  292. data/app/models/item_custom_property.rb +0 -18
  293. data/app/models/item_custom_value.rb +0 -17
  294. data/app/models/manifestation_custom_property.rb +0 -18
  295. data/app/models/manifestation_custom_value.rb +0 -17
  296. data/app/policies/item_custom_property_policy.rb +0 -21
  297. data/app/policies/manifestation_custom_property_policy.rb +0 -21
  298. data/app/views/agent_import_results/index.txt.ruby +0 -5
  299. data/app/views/item_custom_properties/_form.html.erb +0 -32
  300. data/app/views/item_custom_properties/edit.html.erb +0 -13
  301. data/app/views/item_custom_properties/index.html.erb +0 -43
  302. data/app/views/item_custom_properties/new.html.erb +0 -12
  303. data/app/views/item_custom_properties/show.html.erb +0 -28
  304. data/app/views/items/_item.json.jbuilder +0 -17
  305. data/app/views/items/index.json.jbuilder +0 -5
  306. data/app/views/items/show.json.jbuilder +0 -1
  307. data/app/views/manifestation_custom_properties/_form.html.erb +0 -32
  308. data/app/views/manifestation_custom_properties/edit.html.erb +0 -13
  309. data/app/views/manifestation_custom_properties/index.html.erb +0 -43
  310. data/app/views/manifestation_custom_properties/new.html.erb +0 -12
  311. data/app/views/manifestation_custom_properties/show.html.erb +0 -28
  312. data/app/views/manifestations/index.txt.ruby +0 -7
  313. data/app/views/manifestations/show.json.jbuilder +0 -2
  314. data/app/views/manifestations/show.txt.ruby +0 -5
  315. data/app/views/resource_import_results/index.txt.ruby +0 -5
  316. data/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
  317. data/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
  318. data/db/migrate/20200425072340_create_manifestation_custom_properties.rb +0 -12
  319. data/db/migrate/20200425072349_create_item_custom_properties.rb +0 -12
  320. data/db/migrate/20200425074758_create_manifestation_custom_values.rb +0 -12
  321. data/db/migrate/20200425074822_create_item_custom_values.rb +0 -12
  322. data/lib/generators/enju_biblio/setup/templates/db/fixtures/agents.yml +0 -19
  323. data/spec/cassette_library/ResourceImportFile/when_its_mode_is_create_/when_it_is_written_in_utf-8/should_import_custom_values.yml +0 -121
  324. data/spec/cassette_library/resource_import_results/index_txt_ruby/renders_a_list_of_resource_import_results.yml +0 -121
  325. data/spec/controllers/item_custom_properties_controller_spec.rb +0 -449
  326. data/spec/controllers/manifestation_custom_properties_controller_spec.rb +0 -449
  327. data/spec/dummy/db/migrate/20081117143156_create_inventory_files.rb +0 -18
  328. data/spec/dummy/db/migrate/20081117143455_create_inventories.rb +0 -17
  329. data/spec/dummy/db/migrate/20090706125521_add_attachments_inventory_to_inventory_file.rb +0 -15
  330. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +0 -18
  331. data/spec/dummy/db/migrate/20100525171356_acts_as_taggable_on_migration.rb +0 -30
  332. data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +0 -5
  333. data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +0 -6
  334. data/spec/dummy/db/migrate/20120413100431_add_fingerprint_to_inventory_file.rb +0 -5
  335. data/spec/dummy/db/migrate/20150421023923_create_identities.rb +0 -14
  336. data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +0 -5
  337. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -18
  338. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +0 -22
  339. data/spec/factories/item_custom_property.rb +0 -6
  340. data/spec/factories/item_custom_value.rb +0 -6
  341. data/spec/factories/manifestation_custom_property.rb +0 -6
  342. data/spec/factories/manifestation_custom_value.rb +0 -6
  343. data/spec/fixtures/carrier_type_has_checkout_types.yml +0 -31
  344. data/spec/fixtures/checkout_stat_has_manifestations.yml +0 -24
  345. data/spec/fixtures/checkout_stat_has_users.yml +0 -24
  346. data/spec/fixtures/checkout_types.yml +0 -34
  347. data/spec/fixtures/circulation_statuses.yml +0 -136
  348. data/spec/fixtures/inventory_files.yml +0 -40
  349. data/spec/fixtures/item_custom_properties.yml +0 -24
  350. data/spec/fixtures/manifestation_checkout_stats.yml +0 -29
  351. data/spec/fixtures/manifestation_custom_properties.yml +0 -24
  352. data/spec/fixtures/manifestation_reserve_stats.yml +0 -29
  353. data/spec/fixtures/reserve_stat_has_manifestations.yml +0 -24
  354. data/spec/fixtures/reserve_stat_has_users.yml +0 -24
  355. data/spec/fixtures/reserve_transitions.yml +0 -104
  356. data/spec/fixtures/reserves.yml +0 -143
  357. data/spec/fixtures/use_restrictions.yml +0 -93
  358. data/spec/fixtures/user_checkout_stats.yml +0 -28
  359. data/spec/fixtures/user_group_has_checkout_types.yml +0 -111
  360. data/spec/fixtures/user_reserve_stats.yml +0 -28
  361. data/spec/models/item_custom_property_spec.rb +0 -18
  362. data/spec/models/item_custom_value_spec.rb +0 -17
  363. data/spec/models/manifestation_custom_property_spec.rb +0 -18
  364. data/spec/models/manifestation_custom_value_spec.rb +0 -17
  365. data/spec/requests/item_custom_properties_spec.rb +0 -129
  366. data/spec/requests/manifestation_custom_properties_spec.rb +0 -129
  367. data/spec/routing/item_custom_properties_routing_spec.rb +0 -38
  368. data/spec/routing/manifestation_custom_properties_routing_spec.rb +0 -38
  369. data/spec/system/items_spec.rb +0 -121
  370. data/spec/system/series_statements_spec.rb +0 -16
  371. data/spec/views/agent_import_results/index.html.erb_spec.rb +0 -29
  372. data/spec/views/agent_import_results/index.txt.ruby_spec.rb +0 -20
  373. data/spec/views/agent_import_results/show.html.erb_spec.rb +0 -24
  374. data/spec/views/item_custom_properties/edit.html.erb_spec.rb +0 -21
  375. data/spec/views/item_custom_properties/index.html.erb_spec.rb +0 -25
  376. data/spec/views/item_custom_properties/new.html.erb_spec.rb +0 -21
  377. data/spec/views/item_custom_properties/show.html.erb_spec.rb +0 -16
  378. data/spec/views/items/index.json.jbuilder_spec.rb +0 -15
  379. data/spec/views/items/show.json.jbuilder_spec.rb +0 -15
  380. data/spec/views/manifestation_custom_properties/edit.html.erb_spec.rb +0 -21
  381. data/spec/views/manifestation_custom_properties/index.html.erb_spec.rb +0 -25
  382. data/spec/views/manifestation_custom_properties/new.html.erb_spec.rb +0 -21
  383. data/spec/views/manifestation_custom_properties/show.html.erb_spec.rb +0 -16
  384. data/spec/views/manifestations/show.json.jbuilder_spec.rb +0 -16
  385. data/spec/views/resource_import_results/index.txt.ruby_spec.rb +0 -22
@@ -10,9 +10,13 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2020_04_25_074822) do
13
+ ActiveRecord::Schema.define(version: 2019_07_12_163038) do
14
14
 
15
- create_table "accepts", force: :cascade do |t|
15
+ # These are extensions that must be enabled in order to support this database
16
+ enable_extension "pgcrypto"
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "accepts", id: :serial, force: :cascade do |t|
16
20
  t.integer "basket_id"
17
21
  t.integer "item_id"
18
22
  t.integer "librarian_id"
@@ -23,7 +27,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
23
27
  t.index ["librarian_id"], name: "index_accepts_on_librarian_id"
24
28
  end
25
29
 
26
- create_table "agent_import_file_transitions", force: :cascade do |t|
30
+ create_table "agent_import_file_transitions", id: :serial, force: :cascade do |t|
27
31
  t.string "to_state"
28
32
  t.text "metadata", default: "{}"
29
33
  t.integer "sort_key"
@@ -36,7 +40,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
36
40
  t.index ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
37
41
  end
38
42
 
39
- create_table "agent_import_files", force: :cascade do |t|
43
+ create_table "agent_import_files", id: :serial, force: :cascade do |t|
40
44
  t.integer "parent_id"
41
45
  t.string "content_type"
42
46
  t.integer "size"
@@ -57,7 +61,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
57
61
  t.index ["user_id"], name: "index_agent_import_files_on_user_id"
58
62
  end
59
63
 
60
- create_table "agent_import_results", force: :cascade do |t|
64
+ create_table "agent_import_results", id: :serial, force: :cascade do |t|
61
65
  t.integer "agent_import_file_id"
62
66
  t.integer "agent_id"
63
67
  t.text "body"
@@ -65,13 +69,13 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
65
69
  t.datetime "updated_at"
66
70
  end
67
71
 
68
- create_table "agent_merge_lists", force: :cascade do |t|
72
+ create_table "agent_merge_lists", id: :serial, force: :cascade do |t|
69
73
  t.string "title"
70
74
  t.datetime "created_at"
71
75
  t.datetime "updated_at"
72
76
  end
73
77
 
74
- create_table "agent_merges", force: :cascade do |t|
78
+ create_table "agent_merges", id: :serial, force: :cascade do |t|
75
79
  t.integer "agent_id", null: false
76
80
  t.integer "agent_merge_list_id", null: false
77
81
  t.datetime "created_at"
@@ -80,16 +84,17 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
80
84
  t.index ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
81
85
  end
82
86
 
83
- create_table "agent_relationship_types", force: :cascade do |t|
87
+ create_table "agent_relationship_types", id: :serial, force: :cascade do |t|
84
88
  t.string "name", null: false
85
89
  t.text "display_name"
86
90
  t.text "note"
87
91
  t.integer "position"
88
92
  t.datetime "created_at"
89
93
  t.datetime "updated_at"
94
+ t.jsonb "display_name_translations", default: {}, null: false
90
95
  end
91
96
 
92
- create_table "agent_relationships", force: :cascade do |t|
97
+ create_table "agent_relationships", id: :serial, force: :cascade do |t|
93
98
  t.integer "parent_id"
94
99
  t.integer "child_id"
95
100
  t.integer "agent_relationship_type_id"
@@ -100,16 +105,17 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
100
105
  t.index ["parent_id"], name: "index_agent_relationships_on_parent_id"
101
106
  end
102
107
 
103
- create_table "agent_types", force: :cascade do |t|
108
+ create_table "agent_types", id: :serial, force: :cascade do |t|
104
109
  t.string "name", null: false
105
110
  t.text "display_name"
106
111
  t.text "note"
107
112
  t.integer "position"
108
113
  t.datetime "created_at"
109
114
  t.datetime "updated_at"
115
+ t.jsonb "display_name_translations", default: {}, null: false
110
116
  end
111
117
 
112
- create_table "agents", force: :cascade do |t|
118
+ create_table "agents", id: :serial, force: :cascade do |t|
113
119
  t.string "last_name"
114
120
  t.string "middle_name"
115
121
  t.string "first_name"
@@ -164,7 +170,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
164
170
  t.index ["required_role_id"], name: "index_agents_on_required_role_id"
165
171
  end
166
172
 
167
- create_table "baskets", force: :cascade do |t|
173
+ create_table "baskets", id: :serial, force: :cascade do |t|
168
174
  t.integer "user_id"
169
175
  t.text "note"
170
176
  t.integer "lock_version", default: 0, null: false
@@ -173,7 +179,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
173
179
  t.index ["user_id"], name: "index_baskets_on_user_id"
174
180
  end
175
181
 
176
- create_table "bookmark_stat_has_manifestations", force: :cascade do |t|
182
+ create_table "bookmark_stat_has_manifestations", id: :serial, force: :cascade do |t|
177
183
  t.integer "bookmark_stat_id", null: false
178
184
  t.integer "manifestation_id", null: false
179
185
  t.integer "bookmarks_count"
@@ -183,18 +189,20 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
183
189
  t.index ["manifestation_id"], name: "index_bookmark_stat_has_manifestations_on_manifestation_id"
184
190
  end
185
191
 
186
- create_table "bookmark_stat_transitions", force: :cascade do |t|
192
+ create_table "bookmark_stat_transitions", id: :serial, force: :cascade do |t|
187
193
  t.string "to_state"
188
194
  t.text "metadata", default: "{}"
189
195
  t.integer "sort_key"
190
196
  t.integer "bookmark_stat_id"
191
197
  t.datetime "created_at"
192
198
  t.datetime "updated_at"
199
+ t.boolean "most_recent", null: false
200
+ t.index ["bookmark_stat_id", "most_recent"], name: "index_bookmark_stat_transitions_parent_most_recent", unique: true, where: "most_recent"
193
201
  t.index ["bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_bookmark_stat_id"
194
202
  t.index ["sort_key", "bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_sort_key_and_stat_id", unique: true
195
203
  end
196
204
 
197
- create_table "bookmark_stats", force: :cascade do |t|
205
+ create_table "bookmark_stats", id: :serial, force: :cascade do |t|
198
206
  t.datetime "start_date"
199
207
  t.datetime "end_date"
200
208
  t.datetime "started_at"
@@ -204,7 +212,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
204
212
  t.datetime "updated_at"
205
213
  end
206
214
 
207
- create_table "bookmarks", force: :cascade do |t|
215
+ create_table "bookmarks", id: :serial, force: :cascade do |t|
208
216
  t.integer "user_id", null: false
209
217
  t.integer "manifestation_id"
210
218
  t.text "title"
@@ -218,7 +226,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
218
226
  t.index ["user_id"], name: "index_bookmarks_on_user_id"
219
227
  end
220
228
 
221
- create_table "bookstores", force: :cascade do |t|
229
+ create_table "bookstores", id: :serial, force: :cascade do |t|
222
230
  t.text "name", null: false
223
231
  t.string "zip_code"
224
232
  t.text "address"
@@ -232,16 +240,17 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
232
240
  t.datetime "updated_at"
233
241
  end
234
242
 
235
- create_table "budget_types", force: :cascade do |t|
243
+ create_table "budget_types", id: :serial, force: :cascade do |t|
236
244
  t.string "name"
237
245
  t.text "display_name"
238
246
  t.text "note"
239
247
  t.integer "position"
240
248
  t.datetime "created_at"
241
249
  t.datetime "updated_at"
250
+ t.jsonb "display_name_translations", default: {}, null: false
242
251
  end
243
252
 
244
- create_table "carrier_type_has_checkout_types", force: :cascade do |t|
253
+ create_table "carrier_type_has_checkout_types", id: :serial, force: :cascade do |t|
245
254
  t.integer "carrier_type_id", null: false
246
255
  t.integer "checkout_type_id", null: false
247
256
  t.text "note"
@@ -252,7 +261,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
252
261
  t.index ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
253
262
  end
254
263
 
255
- create_table "carrier_types", force: :cascade do |t|
264
+ create_table "carrier_types", id: :serial, force: :cascade do |t|
256
265
  t.string "name", null: false
257
266
  t.text "display_name"
258
267
  t.text "note"
@@ -261,11 +270,12 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
261
270
  t.datetime "updated_at"
262
271
  t.string "attachment_file_name"
263
272
  t.string "attachment_content_type"
264
- t.integer "attachment_file_size"
273
+ t.bigint "attachment_file_size"
265
274
  t.datetime "attachment_updated_at"
275
+ t.jsonb "display_name_translations", default: {}, null: false
266
276
  end
267
277
 
268
- create_table "checked_items", force: :cascade do |t|
278
+ create_table "checked_items", id: :serial, force: :cascade do |t|
269
279
  t.integer "item_id", null: false
270
280
  t.integer "basket_id", null: false
271
281
  t.integer "librarian_id"
@@ -279,7 +289,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
279
289
  t.index ["user_id"], name: "index_checked_items_on_user_id"
280
290
  end
281
291
 
282
- create_table "checkins", force: :cascade do |t|
292
+ create_table "checkins", id: :serial, force: :cascade do |t|
283
293
  t.integer "item_id", null: false
284
294
  t.integer "librarian_id"
285
295
  t.integer "basket_id"
@@ -291,7 +301,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
291
301
  t.index ["librarian_id"], name: "index_checkins_on_librarian_id"
292
302
  end
293
303
 
294
- create_table "checkout_stat_has_manifestations", force: :cascade do |t|
304
+ create_table "checkout_stat_has_manifestations", id: :serial, force: :cascade do |t|
295
305
  t.integer "manifestation_checkout_stat_id", null: false
296
306
  t.integer "manifestation_id", null: false
297
307
  t.integer "checkouts_count"
@@ -301,7 +311,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
301
311
  t.index ["manifestation_id"], name: "index_checkout_stat_has_manifestations_on_manifestation_id"
302
312
  end
303
313
 
304
- create_table "checkout_stat_has_users", force: :cascade do |t|
314
+ create_table "checkout_stat_has_users", id: :serial, force: :cascade do |t|
305
315
  t.integer "user_checkout_stat_id", null: false
306
316
  t.integer "user_id", null: false
307
317
  t.integer "checkouts_count", default: 0, null: false
@@ -311,7 +321,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
311
321
  t.index ["user_id"], name: "index_checkout_stat_has_users_on_user_id"
312
322
  end
313
323
 
314
- create_table "checkout_types", force: :cascade do |t|
324
+ create_table "checkout_types", id: :serial, force: :cascade do |t|
315
325
  t.string "name", null: false
316
326
  t.text "display_name"
317
327
  t.text "note"
@@ -321,7 +331,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
321
331
  t.index ["name"], name: "index_checkout_types_on_name"
322
332
  end
323
333
 
324
- create_table "checkouts", force: :cascade do |t|
334
+ create_table "checkouts", id: :serial, force: :cascade do |t|
325
335
  t.integer "user_id"
326
336
  t.integer "item_id", null: false
327
337
  t.integer "checkin_id"
@@ -344,16 +354,17 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
344
354
  t.index ["user_id"], name: "index_checkouts_on_user_id"
345
355
  end
346
356
 
347
- create_table "circulation_statuses", force: :cascade do |t|
357
+ create_table "circulation_statuses", id: :serial, force: :cascade do |t|
348
358
  t.string "name", null: false
349
359
  t.text "display_name"
350
360
  t.text "note"
351
361
  t.integer "position"
352
362
  t.datetime "created_at"
353
363
  t.datetime "updated_at"
364
+ t.jsonb "display_name_translations", default: {}, null: false
354
365
  end
355
366
 
356
- create_table "classification_types", force: :cascade do |t|
367
+ create_table "classification_types", id: :serial, force: :cascade do |t|
357
368
  t.string "name", null: false
358
369
  t.text "display_name"
359
370
  t.text "note"
@@ -362,7 +373,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
362
373
  t.datetime "updated_at"
363
374
  end
364
375
 
365
- create_table "classifications", force: :cascade do |t|
376
+ create_table "classifications", id: :serial, force: :cascade do |t|
366
377
  t.integer "parent_id"
367
378
  t.string "category", null: false
368
379
  t.text "note"
@@ -380,7 +391,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
380
391
  t.index ["parent_id"], name: "index_classifications_on_parent_id"
381
392
  end
382
393
 
383
- create_table "colors", force: :cascade do |t|
394
+ create_table "colors", id: :serial, force: :cascade do |t|
384
395
  t.integer "library_group_id"
385
396
  t.string "property"
386
397
  t.string "code"
@@ -390,16 +401,17 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
390
401
  t.index ["library_group_id"], name: "index_colors_on_library_group_id"
391
402
  end
392
403
 
393
- create_table "content_types", force: :cascade do |t|
404
+ create_table "content_types", id: :serial, force: :cascade do |t|
394
405
  t.string "name", null: false
395
406
  t.text "display_name"
396
407
  t.text "note"
397
408
  t.integer "position"
398
409
  t.datetime "created_at"
399
410
  t.datetime "updated_at"
411
+ t.jsonb "display_name_translations", default: {}, null: false
400
412
  end
401
413
 
402
- create_table "countries", force: :cascade do |t|
414
+ create_table "countries", id: :serial, force: :cascade do |t|
403
415
  t.string "name", null: false
404
416
  t.text "display_name"
405
417
  t.string "alpha_2"
@@ -413,16 +425,17 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
413
425
  t.index ["numeric_3"], name: "index_countries_on_numeric_3"
414
426
  end
415
427
 
416
- create_table "create_types", force: :cascade do |t|
428
+ create_table "create_types", id: :serial, force: :cascade do |t|
417
429
  t.string "name"
418
430
  t.text "display_name"
419
431
  t.text "note"
420
432
  t.integer "position"
421
433
  t.datetime "created_at"
422
434
  t.datetime "updated_at"
435
+ t.jsonb "display_name_translations", default: {}, null: false
423
436
  end
424
437
 
425
- create_table "creates", force: :cascade do |t|
438
+ create_table "creates", id: :serial, force: :cascade do |t|
426
439
  t.integer "agent_id", null: false
427
440
  t.integer "work_id", null: false
428
441
  t.integer "position"
@@ -433,7 +446,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
433
446
  t.index ["work_id"], name: "index_creates_on_work_id"
434
447
  end
435
448
 
436
- create_table "demands", force: :cascade do |t|
449
+ create_table "demands", id: :serial, force: :cascade do |t|
437
450
  t.integer "user_id"
438
451
  t.integer "item_id"
439
452
  t.integer "message_id"
@@ -444,7 +457,19 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
444
457
  t.index ["user_id"], name: "index_demands_on_user_id"
445
458
  end
446
459
 
447
- create_table "donates", force: :cascade do |t|
460
+ create_table "doi_records", force: :cascade do |t|
461
+ t.string "body", null: false
462
+ t.string "display_body", null: false
463
+ t.string "source"
464
+ t.jsonb "response", default: {}, null: false
465
+ t.bigint "manifestation_id", null: false
466
+ t.datetime "created_at", null: false
467
+ t.datetime "updated_at", null: false
468
+ t.index ["body"], name: "index_doi_records_on_body", unique: true
469
+ t.index ["manifestation_id"], name: "index_doi_records_on_manifestation_id"
470
+ end
471
+
472
+ create_table "donates", id: :serial, force: :cascade do |t|
448
473
  t.integer "agent_id", null: false
449
474
  t.integer "item_id", null: false
450
475
  t.datetime "created_at"
@@ -453,49 +478,55 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
453
478
  t.index ["item_id"], name: "index_donates_on_item_id"
454
479
  end
455
480
 
456
- create_table "event_categories", force: :cascade do |t|
481
+ create_table "event_categories", id: :serial, force: :cascade do |t|
457
482
  t.string "name", null: false
458
483
  t.text "display_name"
459
484
  t.text "note"
460
485
  t.integer "position"
461
486
  t.datetime "created_at"
462
487
  t.datetime "updated_at"
488
+ t.jsonb "display_name_translations", default: {}, null: false
463
489
  end
464
490
 
465
- create_table "event_export_file_transitions", force: :cascade do |t|
491
+ create_table "event_export_file_transitions", id: :serial, force: :cascade do |t|
466
492
  t.string "to_state"
467
493
  t.text "metadata", default: "{}"
468
494
  t.integer "sort_key"
469
495
  t.integer "event_export_file_id"
470
496
  t.datetime "created_at"
471
497
  t.datetime "updated_at"
498
+ t.boolean "most_recent", null: false
499
+ t.index ["event_export_file_id", "most_recent"], name: "index_event_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
472
500
  t.index ["event_export_file_id"], name: "index_event_export_file_transitions_on_file_id"
473
501
  t.index ["sort_key", "event_export_file_id"], name: "index_event_export_file_transitions_on_sort_key_and_file_id", unique: true
474
502
  end
475
503
 
476
- create_table "event_export_files", force: :cascade do |t|
504
+ create_table "event_export_files", id: :serial, force: :cascade do |t|
477
505
  t.integer "user_id"
478
506
  t.string "event_export_file_name"
479
507
  t.string "event_export_content_type"
480
- t.integer "event_export_file_size"
508
+ t.bigint "event_export_file_size"
481
509
  t.datetime "event_export_updated_at"
482
510
  t.datetime "executed_at"
483
511
  t.datetime "created_at"
484
512
  t.datetime "updated_at"
513
+ t.index ["user_id"], name: "index_event_export_files_on_user_id"
485
514
  end
486
515
 
487
- create_table "event_import_file_transitions", force: :cascade do |t|
516
+ create_table "event_import_file_transitions", id: :serial, force: :cascade do |t|
488
517
  t.string "to_state"
489
518
  t.text "metadata", default: "{}"
490
519
  t.integer "sort_key"
491
520
  t.integer "event_import_file_id"
492
521
  t.datetime "created_at"
493
522
  t.datetime "updated_at"
523
+ t.boolean "most_recent", null: false
524
+ t.index ["event_import_file_id", "most_recent"], name: "index_event_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
494
525
  t.index ["event_import_file_id"], name: "index_event_import_file_transitions_on_event_import_file_id"
495
526
  t.index ["sort_key", "event_import_file_id"], name: "index_event_import_file_transitions_on_sort_key_and_file_id", unique: true
496
527
  end
497
528
 
498
- create_table "event_import_files", force: :cascade do |t|
529
+ create_table "event_import_files", id: :serial, force: :cascade do |t|
499
530
  t.integer "parent_id"
500
531
  t.string "content_type"
501
532
  t.integer "size"
@@ -518,7 +549,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
518
549
  t.index ["user_id"], name: "index_event_import_files_on_user_id"
519
550
  end
520
551
 
521
- create_table "event_import_results", force: :cascade do |t|
552
+ create_table "event_import_results", id: :serial, force: :cascade do |t|
522
553
  t.integer "event_import_file_id"
523
554
  t.integer "event_id"
524
555
  t.text "body"
@@ -526,7 +557,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
526
557
  t.datetime "updated_at"
527
558
  end
528
559
 
529
- create_table "events", force: :cascade do |t|
560
+ create_table "events", id: :serial, force: :cascade do |t|
530
561
  t.integer "library_id", null: false
531
562
  t.integer "event_category_id", null: false
532
563
  t.string "name"
@@ -538,29 +569,34 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
538
569
  t.text "display_name"
539
570
  t.datetime "created_at"
540
571
  t.datetime "updated_at"
572
+ t.integer "place_id"
573
+ t.jsonb "display_name_translations", default: {}, null: false
541
574
  t.index ["event_category_id"], name: "index_events_on_event_category_id"
542
575
  t.index ["library_id"], name: "index_events_on_library_id"
576
+ t.index ["place_id"], name: "index_events_on_place_id"
543
577
  end
544
578
 
545
- create_table "form_of_works", force: :cascade do |t|
579
+ create_table "form_of_works", id: :serial, force: :cascade do |t|
546
580
  t.string "name", null: false
547
581
  t.text "display_name"
548
582
  t.text "note"
549
583
  t.integer "position"
550
584
  t.datetime "created_at"
551
585
  t.datetime "updated_at"
586
+ t.jsonb "display_name_translations", default: {}, null: false
552
587
  end
553
588
 
554
- create_table "frequencies", force: :cascade do |t|
589
+ create_table "frequencies", id: :serial, force: :cascade do |t|
555
590
  t.string "name", null: false
556
591
  t.text "display_name"
557
592
  t.text "note"
558
593
  t.integer "position"
559
594
  t.datetime "created_at"
560
595
  t.datetime "updated_at"
596
+ t.jsonb "display_name_translations", default: {}, null: false
561
597
  end
562
598
 
563
- create_table "identifier_types", force: :cascade do |t|
599
+ create_table "identifier_types", id: :serial, force: :cascade do |t|
564
600
  t.string "name"
565
601
  t.text "display_name"
566
602
  t.text "note"
@@ -569,7 +605,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
569
605
  t.datetime "updated_at"
570
606
  end
571
607
 
572
- create_table "identifiers", force: :cascade do |t|
608
+ create_table "identifiers", id: :serial, force: :cascade do |t|
573
609
  t.string "body", null: false
574
610
  t.integer "identifier_type_id", null: false
575
611
  t.integer "manifestation_id"
@@ -581,20 +617,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
581
617
  t.index ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
582
618
  end
583
619
 
584
- create_table "identities", force: :cascade do |t|
585
- t.string "name"
586
- t.string "email"
587
- t.string "password_digest"
588
- t.integer "profile_id"
589
- t.datetime "created_at", null: false
590
- t.datetime "updated_at", null: false
591
- t.string "provider"
592
- t.index ["email"], name: "index_identities_on_email"
593
- t.index ["name"], name: "index_identities_on_name"
594
- t.index ["profile_id"], name: "index_identities_on_profile_id"
595
- end
596
-
597
- create_table "import_request_transitions", force: :cascade do |t|
620
+ create_table "import_request_transitions", id: :serial, force: :cascade do |t|
598
621
  t.string "to_state"
599
622
  t.text "metadata", default: "{}"
600
623
  t.integer "sort_key"
@@ -607,7 +630,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
607
630
  t.index ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
608
631
  end
609
632
 
610
- create_table "import_requests", force: :cascade do |t|
633
+ create_table "import_requests", id: :serial, force: :cascade do |t|
611
634
  t.string "isbn"
612
635
  t.integer "manifestation_id"
613
636
  t.integer "user_id"
@@ -618,54 +641,45 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
618
641
  t.index ["user_id"], name: "index_import_requests_on_user_id"
619
642
  end
620
643
 
621
- create_table "inventories", force: :cascade do |t|
622
- t.integer "item_id"
623
- t.integer "inventory_file_id"
624
- t.text "note"
625
- t.datetime "created_at"
626
- t.datetime "updated_at"
627
- t.index ["inventory_file_id"], name: "index_inventories_on_inventory_file_id"
628
- t.index ["item_id"], name: "index_inventories_on_item_id"
644
+ create_table "isbn_record_and_manifestations", force: :cascade do |t|
645
+ t.bigint "isbn_record_id", null: false
646
+ t.bigint "manifestation_id", null: false
647
+ t.integer "position"
648
+ t.datetime "created_at", null: false
649
+ t.datetime "updated_at", null: false
650
+ t.index ["isbn_record_id"], name: "index_isbn_record_and_manifestations_on_isbn_record_id"
651
+ t.index ["manifestation_id"], name: "index_isbn_record_and_manifestations_on_manifestation_id"
629
652
  end
630
653
 
631
- create_table "inventory_files", force: :cascade do |t|
632
- t.string "filename"
633
- t.string "content_type"
634
- t.integer "size"
635
- t.integer "user_id"
636
- t.text "note"
637
- t.datetime "created_at"
638
- t.datetime "updated_at"
639
- t.string "inventory_file_name"
640
- t.string "inventory_content_type"
641
- t.integer "inventory_file_size"
642
- t.datetime "inventory_updated_at"
643
- t.string "inventory_fingerprint"
644
- t.index ["user_id"], name: "index_inventory_files_on_user_id"
654
+ create_table "isbn_records", force: :cascade do |t|
655
+ t.string "body", null: false
656
+ t.string "isbn_type"
657
+ t.string "source"
658
+ t.datetime "created_at", null: false
659
+ t.datetime "updated_at", null: false
660
+ t.index ["body"], name: "index_isbn_records_on_body", unique: true
645
661
  end
646
662
 
647
- create_table "item_custom_properties", force: :cascade do |t|
648
- t.string "name", null: false
649
- t.text "display_name", null: false
650
- t.text "note"
651
- t.integer "position", default: 1, null: false
663
+ create_table "issn_record_and_manifestations", force: :cascade do |t|
664
+ t.bigint "issn_record_id", null: false
665
+ t.bigint "manifestation_id", null: false
666
+ t.integer "position"
652
667
  t.datetime "created_at", null: false
653
668
  t.datetime "updated_at", null: false
654
- t.index ["name"], name: "index_item_custom_properties_on_name", unique: true
669
+ t.index ["issn_record_id"], name: "index_issn_record_and_manifestations_on_issn_record_id"
670
+ t.index ["manifestation_id"], name: "index_issn_record_and_manifestations_on_manifestation_id"
655
671
  end
656
672
 
657
- create_table "item_custom_values", force: :cascade do |t|
658
- t.integer "item_custom_property_id", null: false
659
- t.integer "item_id", null: false
660
- t.text "value"
673
+ create_table "issn_records", force: :cascade do |t|
674
+ t.string "body", null: false
675
+ t.string "issn_type"
676
+ t.string "source"
661
677
  t.datetime "created_at", null: false
662
678
  t.datetime "updated_at", null: false
663
- t.index ["item_custom_property_id", "item_id"], name: "index_item_custom_values_on_custom_item_property_and_item_id", unique: true
664
- t.index ["item_custom_property_id"], name: "index_item_custom_values_on_custom_property_id"
665
- t.index ["item_id"], name: "index_item_custom_values_on_item_id"
679
+ t.index ["body"], name: "index_issn_records_on_body", unique: true
666
680
  end
667
681
 
668
- create_table "item_has_use_restrictions", force: :cascade do |t|
682
+ create_table "item_has_use_restrictions", id: :serial, force: :cascade do |t|
669
683
  t.integer "item_id", null: false
670
684
  t.integer "use_restriction_id", null: false
671
685
  t.datetime "created_at"
@@ -674,7 +688,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
674
688
  t.index ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
675
689
  end
676
690
 
677
- create_table "items", force: :cascade do |t|
691
+ create_table "items", id: :serial, force: :cascade do |t|
678
692
  t.string "call_number"
679
693
  t.string "item_identifier"
680
694
  t.datetime "created_at"
@@ -697,7 +711,6 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
697
711
  t.string "binding_call_number"
698
712
  t.datetime "binded_at"
699
713
  t.integer "manifestation_id", null: false
700
- t.text "memo"
701
714
  t.index ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
702
715
  t.index ["bookstore_id"], name: "index_items_on_bookstore_id"
703
716
  t.index ["checkout_type_id"], name: "index_items_on_checkout_type_id"
@@ -708,7 +721,16 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
708
721
  t.index ["shelf_id"], name: "index_items_on_shelf_id"
709
722
  end
710
723
 
711
- create_table "languages", force: :cascade do |t|
724
+ create_table "jpno_records", force: :cascade do |t|
725
+ t.string "body", null: false
726
+ t.bigint "manifestation_id", null: false
727
+ t.datetime "created_at", null: false
728
+ t.datetime "updated_at", null: false
729
+ t.index ["body"], name: "index_jpno_records_on_body", unique: true
730
+ t.index ["manifestation_id"], name: "index_jpno_records_on_manifestation_id"
731
+ end
732
+
733
+ create_table "languages", id: :serial, force: :cascade do |t|
712
734
  t.string "name", null: false
713
735
  t.string "native_name"
714
736
  t.text "display_name"
@@ -717,13 +739,14 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
717
739
  t.string "iso_639_3"
718
740
  t.text "note"
719
741
  t.integer "position"
742
+ t.jsonb "display_name_translations", default: {}, null: false
720
743
  t.index ["iso_639_1"], name: "index_languages_on_iso_639_1"
721
744
  t.index ["iso_639_2"], name: "index_languages_on_iso_639_2"
722
745
  t.index ["iso_639_3"], name: "index_languages_on_iso_639_3"
723
746
  t.index ["name"], name: "index_languages_on_name", unique: true
724
747
  end
725
748
 
726
- create_table "lending_policies", force: :cascade do |t|
749
+ create_table "lending_policies", id: :serial, force: :cascade do |t|
727
750
  t.integer "item_id", null: false
728
751
  t.integer "user_group_id", null: false
729
752
  t.integer "loan_period", default: 0, null: false
@@ -737,7 +760,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
737
760
  t.index ["item_id", "user_group_id"], name: "index_lending_policies_on_item_id_and_user_group_id", unique: true
738
761
  end
739
762
 
740
- create_table "libraries", force: :cascade do |t|
763
+ create_table "libraries", id: :serial, force: :cascade do |t|
741
764
  t.string "name", null: false
742
765
  t.text "display_name"
743
766
  t.string "short_display_name", null: false
@@ -762,22 +785,12 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
762
785
  t.string "isil"
763
786
  t.float "latitude"
764
787
  t.float "longitude"
788
+ t.jsonb "display_name_translations", default: {}, null: false
765
789
  t.index ["library_group_id"], name: "index_libraries_on_library_group_id"
766
790
  t.index ["name"], name: "index_libraries_on_name"
767
791
  end
768
792
 
769
- create_table "library_group_translations", force: :cascade do |t|
770
- t.integer "library_group_id", null: false
771
- t.string "locale", null: false
772
- t.datetime "created_at", null: false
773
- t.datetime "updated_at", null: false
774
- t.text "login_banner"
775
- t.text "footer_banner"
776
- t.index ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
777
- t.index ["locale"], name: "index_library_group_translations_on_locale"
778
- end
779
-
780
- create_table "library_groups", force: :cascade do |t|
793
+ create_table "library_groups", id: :serial, force: :cascade do |t|
781
794
  t.string "name", null: false
782
795
  t.text "display_name"
783
796
  t.string "short_name", null: false
@@ -802,23 +815,27 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
802
815
  t.boolean "csv_charset_conversion", default: false, null: false
803
816
  t.string "header_logo_file_name"
804
817
  t.string "header_logo_content_type"
805
- t.integer "header_logo_file_size"
818
+ t.bigint "header_logo_file_size"
806
819
  t.datetime "header_logo_updated_at"
807
820
  t.text "header_logo_meta"
821
+ t.jsonb "display_name_translations", default: {}, null: false
822
+ t.jsonb "login_banner_translations", default: {}, null: false
823
+ t.jsonb "footer_banner_translations", default: {}, null: false
808
824
  t.index ["short_name"], name: "index_library_groups_on_short_name"
809
825
  t.index ["user_id"], name: "index_library_groups_on_user_id"
810
826
  end
811
827
 
812
- create_table "licenses", force: :cascade do |t|
828
+ create_table "licenses", id: :serial, force: :cascade do |t|
813
829
  t.string "name", null: false
814
830
  t.string "display_name"
815
831
  t.text "note"
816
832
  t.integer "position"
817
833
  t.datetime "created_at"
818
834
  t.datetime "updated_at"
835
+ t.jsonb "display_name_translations", default: {}, null: false
819
836
  end
820
837
 
821
- create_table "manifestation_checkout_stat_transitions", force: :cascade do |t|
838
+ create_table "manifestation_checkout_stat_transitions", id: :serial, force: :cascade do |t|
822
839
  t.string "to_state"
823
840
  t.text "metadata", default: "{}"
824
841
  t.integer "sort_key"
@@ -831,7 +848,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
831
848
  t.index ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
832
849
  end
833
850
 
834
- create_table "manifestation_checkout_stats", force: :cascade do |t|
851
+ create_table "manifestation_checkout_stats", id: :serial, force: :cascade do |t|
835
852
  t.datetime "start_date"
836
853
  t.datetime "end_date"
837
854
  t.text "note"
@@ -843,37 +860,17 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
843
860
  t.index ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
844
861
  end
845
862
 
846
- create_table "manifestation_custom_properties", force: :cascade do |t|
847
- t.string "name", null: false
848
- t.text "display_name", null: false
849
- t.text "note"
850
- t.integer "position", default: 1, null: false
851
- t.datetime "created_at", null: false
852
- t.datetime "updated_at", null: false
853
- t.index ["name"], name: "index_manifestation_custom_properties_on_name", unique: true
854
- end
855
-
856
- create_table "manifestation_custom_values", force: :cascade do |t|
857
- t.integer "manifestation_custom_property_id", null: false
858
- t.integer "manifestation_id", null: false
859
- t.text "value"
860
- t.datetime "created_at", null: false
861
- t.datetime "updated_at", null: false
862
- t.index ["manifestation_custom_property_id", "manifestation_id"], name: "index_manifestation_custom_values_on_property_manifestation", unique: true
863
- t.index ["manifestation_custom_property_id"], name: "index_manifestation_custom_values_on_custom_property_id"
864
- t.index ["manifestation_id"], name: "index_manifestation_custom_values_on_manifestation_id"
865
- end
866
-
867
- create_table "manifestation_relationship_types", force: :cascade do |t|
863
+ create_table "manifestation_relationship_types", id: :serial, force: :cascade do |t|
868
864
  t.string "name", null: false
869
865
  t.text "display_name"
870
866
  t.text "note"
871
867
  t.integer "position"
872
868
  t.datetime "created_at"
873
869
  t.datetime "updated_at"
870
+ t.jsonb "display_name_translations", default: {}, null: false
874
871
  end
875
872
 
876
- create_table "manifestation_relationships", force: :cascade do |t|
873
+ create_table "manifestation_relationships", id: :serial, force: :cascade do |t|
877
874
  t.integer "parent_id"
878
875
  t.integer "child_id"
879
876
  t.integer "manifestation_relationship_type_id"
@@ -884,7 +881,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
884
881
  t.index ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
885
882
  end
886
883
 
887
- create_table "manifestation_reserve_stat_transitions", force: :cascade do |t|
884
+ create_table "manifestation_reserve_stat_transitions", id: :serial, force: :cascade do |t|
888
885
  t.string "to_state"
889
886
  t.text "metadata", default: "{}"
890
887
  t.integer "sort_key"
@@ -897,7 +894,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
897
894
  t.index ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
898
895
  end
899
896
 
900
- create_table "manifestation_reserve_stats", force: :cascade do |t|
897
+ create_table "manifestation_reserve_stats", id: :serial, force: :cascade do |t|
901
898
  t.datetime "start_date"
902
899
  t.datetime "end_date"
903
900
  t.text "note"
@@ -909,7 +906,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
909
906
  t.index ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
910
907
  end
911
908
 
912
- create_table "manifestations", force: :cascade do |t|
909
+ create_table "manifestations", id: :serial, force: :cascade do |t|
913
910
  t.text "original_title", null: false
914
911
  t.text "title_alternative"
915
912
  t.text "title_transcription"
@@ -968,35 +965,36 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
968
965
  t.text "publication_place"
969
966
  t.text "extent"
970
967
  t.text "dimensions"
971
- t.text "memo"
972
968
  t.index ["access_address"], name: "index_manifestations_on_access_address"
973
969
  t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
974
970
  t.index ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier"
975
971
  t.index ["updated_at"], name: "index_manifestations_on_updated_at"
976
972
  end
977
973
 
978
- create_table "medium_of_performances", force: :cascade do |t|
974
+ create_table "medium_of_performances", id: :serial, force: :cascade do |t|
979
975
  t.string "name", null: false
980
976
  t.text "display_name"
981
977
  t.text "note"
982
978
  t.integer "position"
983
979
  t.datetime "created_at"
984
980
  t.datetime "updated_at"
981
+ t.jsonb "display_name_translations", default: {}, null: false
985
982
  end
986
983
 
987
- create_table "message_request_transitions", force: :cascade do |t|
984
+ create_table "message_request_transitions", id: :serial, force: :cascade do |t|
988
985
  t.string "to_state"
989
986
  t.text "metadata", default: "{}"
990
987
  t.integer "sort_key"
991
988
  t.integer "message_request_id"
992
989
  t.datetime "created_at"
993
990
  t.datetime "updated_at"
994
- t.boolean "most_recent"
991
+ t.boolean "most_recent", null: false
992
+ t.index ["message_request_id", "most_recent"], name: "index_message_request_transitions_parent_most_recent", unique: true, where: "most_recent"
995
993
  t.index ["message_request_id"], name: "index_message_request_transitions_on_message_request_id"
996
994
  t.index ["sort_key", "message_request_id"], name: "index_message_request_transitions_on_sort_key_and_request_id", unique: true
997
995
  end
998
996
 
999
- create_table "message_requests", force: :cascade do |t|
997
+ create_table "message_requests", id: :serial, force: :cascade do |t|
1000
998
  t.integer "sender_id"
1001
999
  t.integer "receiver_id"
1002
1000
  t.integer "message_template_id"
@@ -1007,7 +1005,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1007
1005
  t.datetime "updated_at"
1008
1006
  end
1009
1007
 
1010
- create_table "message_templates", force: :cascade do |t|
1008
+ create_table "message_templates", id: :serial, force: :cascade do |t|
1011
1009
  t.string "status", null: false
1012
1010
  t.text "title", null: false
1013
1011
  t.text "body", null: false
@@ -1018,22 +1016,23 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1018
1016
  t.index ["status"], name: "index_message_templates_on_status", unique: true
1019
1017
  end
1020
1018
 
1021
- create_table "message_transitions", force: :cascade do |t|
1019
+ create_table "message_transitions", id: :serial, force: :cascade do |t|
1022
1020
  t.string "to_state"
1023
1021
  t.text "metadata", default: "{}"
1024
1022
  t.integer "sort_key"
1025
1023
  t.integer "message_id"
1026
1024
  t.datetime "created_at"
1027
1025
  t.datetime "updated_at"
1028
- t.boolean "most_recent"
1026
+ t.boolean "most_recent", null: false
1027
+ t.index ["message_id", "most_recent"], name: "index_message_transitions_parent_most_recent", unique: true, where: "most_recent"
1029
1028
  t.index ["message_id"], name: "index_message_transitions_on_message_id"
1030
1029
  t.index ["sort_key", "message_id"], name: "index_message_transitions_on_sort_key_and_message_id", unique: true
1031
1030
  end
1032
1031
 
1033
- create_table "messages", force: :cascade do |t|
1032
+ create_table "messages", id: :serial, force: :cascade do |t|
1034
1033
  t.datetime "read_at"
1035
- t.integer "receiver_id"
1036
1034
  t.integer "sender_id"
1035
+ t.integer "receiver_id"
1037
1036
  t.string "subject", null: false
1038
1037
  t.text "body"
1039
1038
  t.integer "message_request_id"
@@ -1049,7 +1048,25 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1049
1048
  t.index ["sender_id"], name: "index_messages_on_sender_id"
1050
1049
  end
1051
1050
 
1052
- create_table "owns", force: :cascade do |t|
1051
+ create_table "ndl_bib_id_records", force: :cascade do |t|
1052
+ t.string "body", null: false
1053
+ t.bigint "manifestation_id", null: false
1054
+ t.datetime "created_at", null: false
1055
+ t.datetime "updated_at", null: false
1056
+ t.index ["body"], name: "index_ndl_bib_id_records_on_body", unique: true
1057
+ t.index ["manifestation_id"], name: "index_ndl_bib_id_records_on_manifestation_id"
1058
+ end
1059
+
1060
+ create_table "ndla_records", force: :cascade do |t|
1061
+ t.bigint "agent_id"
1062
+ t.string "body", null: false
1063
+ t.datetime "created_at", null: false
1064
+ t.datetime "updated_at", null: false
1065
+ t.index ["agent_id"], name: "index_ndla_records_on_agent_id"
1066
+ t.index ["body"], name: "index_ndla_records_on_body", unique: true
1067
+ end
1068
+
1069
+ create_table "owns", id: :serial, force: :cascade do |t|
1053
1070
  t.integer "agent_id", null: false
1054
1071
  t.integer "item_id", null: false
1055
1072
  t.integer "position"
@@ -1059,7 +1076,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1059
1076
  t.index ["item_id"], name: "index_owns_on_item_id"
1060
1077
  end
1061
1078
 
1062
- create_table "participates", force: :cascade do |t|
1079
+ create_table "participates", id: :serial, force: :cascade do |t|
1063
1080
  t.integer "agent_id", null: false
1064
1081
  t.integer "event_id", null: false
1065
1082
  t.integer "position"
@@ -1069,10 +1086,31 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1069
1086
  t.index ["event_id"], name: "index_participates_on_event_id"
1070
1087
  end
1071
1088
 
1072
- create_table "picture_files", force: :cascade do |t|
1089
+ create_table "periodical_and_manifestations", force: :cascade do |t|
1090
+ t.bigint "periodical_id", null: false
1091
+ t.bigint "manifestation_id", null: false
1092
+ t.boolean "periodical_master", default: false, null: false
1093
+ t.datetime "created_at", null: false
1094
+ t.datetime "updated_at", null: false
1095
+ t.index ["manifestation_id"], name: "index_periodical_and_manifestations_on_manifestation_id"
1096
+ t.index ["periodical_id"], name: "index_periodical_and_manifestations_on_periodical_id"
1097
+ t.index ["periodical_master"], name: "index_periodical_and_manifestations_on_periodical_master", unique: true, where: "(periodical_master IS TRUE)"
1098
+ end
1099
+
1100
+ create_table "periodicals", force: :cascade do |t|
1101
+ t.text "original_title", null: false
1102
+ t.bigint "frequency_id", null: false
1103
+ t.datetime "created_at", null: false
1104
+ t.datetime "updated_at", null: false
1105
+ t.index ["frequency_id"], name: "index_periodicals_on_frequency_id"
1106
+ end
1107
+
1108
+ create_table "picture_files", id: :serial, force: :cascade do |t|
1073
1109
  t.integer "picture_attachable_id"
1074
1110
  t.string "picture_attachable_type"
1111
+ t.string "content_type"
1075
1112
  t.text "title"
1113
+ t.string "thumbnail"
1076
1114
  t.integer "position"
1077
1115
  t.datetime "created_at"
1078
1116
  t.datetime "updated_at"
@@ -1087,16 +1125,29 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1087
1125
  t.index ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
1088
1126
  end
1089
1127
 
1090
- create_table "produce_types", force: :cascade do |t|
1128
+ create_table "places", id: :serial, force: :cascade do |t|
1129
+ t.string "term"
1130
+ t.text "city"
1131
+ t.integer "country_id"
1132
+ t.float "latitude"
1133
+ t.float "longitude"
1134
+ t.datetime "created_at", null: false
1135
+ t.datetime "updated_at", null: false
1136
+ t.index ["country_id"], name: "index_places_on_country_id"
1137
+ t.index ["term"], name: "index_places_on_term"
1138
+ end
1139
+
1140
+ create_table "produce_types", id: :serial, force: :cascade do |t|
1091
1141
  t.string "name"
1092
1142
  t.text "display_name"
1093
1143
  t.text "note"
1094
1144
  t.integer "position"
1095
1145
  t.datetime "created_at"
1096
1146
  t.datetime "updated_at"
1147
+ t.jsonb "display_name_translations", default: {}, null: false
1097
1148
  end
1098
1149
 
1099
- create_table "produces", force: :cascade do |t|
1150
+ create_table "produces", id: :serial, force: :cascade do |t|
1100
1151
  t.integer "agent_id", null: false
1101
1152
  t.integer "manifestation_id", null: false
1102
1153
  t.integer "position"
@@ -1107,7 +1158,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1107
1158
  t.index ["manifestation_id"], name: "index_produces_on_manifestation_id"
1108
1159
  end
1109
1160
 
1110
- create_table "profiles", force: :cascade do |t|
1161
+ create_table "profiles", id: :serial, force: :cascade do |t|
1111
1162
  t.integer "user_id"
1112
1163
  t.integer "user_group_id"
1113
1164
  t.integer "library_id"
@@ -1132,16 +1183,17 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1132
1183
  t.index ["user_number"], name: "index_profiles_on_user_number", unique: true
1133
1184
  end
1134
1185
 
1135
- create_table "realize_types", force: :cascade do |t|
1186
+ create_table "realize_types", id: :serial, force: :cascade do |t|
1136
1187
  t.string "name"
1137
1188
  t.text "display_name"
1138
1189
  t.text "note"
1139
1190
  t.integer "position"
1140
1191
  t.datetime "created_at"
1141
1192
  t.datetime "updated_at"
1193
+ t.jsonb "display_name_translations", default: {}, null: false
1142
1194
  end
1143
1195
 
1144
- create_table "realizes", force: :cascade do |t|
1196
+ create_table "realizes", id: :serial, force: :cascade do |t|
1145
1197
  t.integer "agent_id", null: false
1146
1198
  t.integer "expression_id", null: false
1147
1199
  t.integer "position"
@@ -1152,25 +1204,27 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1152
1204
  t.index ["expression_id"], name: "index_realizes_on_expression_id"
1153
1205
  end
1154
1206
 
1155
- create_table "request_status_types", force: :cascade do |t|
1207
+ create_table "request_status_types", id: :serial, force: :cascade do |t|
1156
1208
  t.string "name", null: false
1157
1209
  t.text "display_name"
1158
1210
  t.text "note"
1159
1211
  t.integer "position"
1160
1212
  t.datetime "created_at"
1161
1213
  t.datetime "updated_at"
1214
+ t.jsonb "display_name_translations", default: {}, null: false
1162
1215
  end
1163
1216
 
1164
- create_table "request_types", force: :cascade do |t|
1217
+ create_table "request_types", id: :serial, force: :cascade do |t|
1165
1218
  t.string "name", null: false
1166
1219
  t.text "display_name"
1167
1220
  t.text "note"
1168
1221
  t.integer "position"
1169
1222
  t.datetime "created_at"
1170
1223
  t.datetime "updated_at"
1224
+ t.jsonb "display_name_translations", default: {}, null: false
1171
1225
  end
1172
1226
 
1173
- create_table "reserve_stat_has_manifestations", force: :cascade do |t|
1227
+ create_table "reserve_stat_has_manifestations", id: :serial, force: :cascade do |t|
1174
1228
  t.integer "manifestation_reserve_stat_id", null: false
1175
1229
  t.integer "manifestation_id", null: false
1176
1230
  t.integer "reserves_count"
@@ -1180,7 +1234,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1180
1234
  t.index ["manifestation_reserve_stat_id"], name: "index_reserve_stat_has_manifestations_on_m_reserve_stat_id"
1181
1235
  end
1182
1236
 
1183
- create_table "reserve_stat_has_users", force: :cascade do |t|
1237
+ create_table "reserve_stat_has_users", id: :serial, force: :cascade do |t|
1184
1238
  t.integer "user_reserve_stat_id", null: false
1185
1239
  t.integer "user_id", null: false
1186
1240
  t.integer "reserves_count"
@@ -1190,7 +1244,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1190
1244
  t.index ["user_reserve_stat_id"], name: "index_reserve_stat_has_users_on_user_reserve_stat_id"
1191
1245
  end
1192
1246
 
1193
- create_table "reserve_transitions", force: :cascade do |t|
1247
+ create_table "reserve_transitions", id: :serial, force: :cascade do |t|
1194
1248
  t.string "to_state"
1195
1249
  t.text "metadata", default: "{}"
1196
1250
  t.integer "sort_key"
@@ -1203,7 +1257,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1203
1257
  t.index ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
1204
1258
  end
1205
1259
 
1206
- create_table "reserves", force: :cascade do |t|
1260
+ create_table "reserves", id: :serial, force: :cascade do |t|
1207
1261
  t.integer "user_id", null: false
1208
1262
  t.integer "manifestation_id", null: false
1209
1263
  t.integer "item_id"
@@ -1226,7 +1280,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1226
1280
  t.index ["user_id"], name: "index_reserves_on_user_id"
1227
1281
  end
1228
1282
 
1229
- create_table "resource_export_file_transitions", force: :cascade do |t|
1283
+ create_table "resource_export_file_transitions", id: :serial, force: :cascade do |t|
1230
1284
  t.string "to_state"
1231
1285
  t.text "metadata", default: "{}"
1232
1286
  t.integer "sort_key"
@@ -1239,18 +1293,18 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1239
1293
  t.index ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
1240
1294
  end
1241
1295
 
1242
- create_table "resource_export_files", force: :cascade do |t|
1296
+ create_table "resource_export_files", id: :serial, force: :cascade do |t|
1243
1297
  t.integer "user_id"
1244
1298
  t.string "resource_export_file_name"
1245
1299
  t.string "resource_export_content_type"
1246
- t.integer "resource_export_file_size"
1300
+ t.bigint "resource_export_file_size"
1247
1301
  t.datetime "resource_export_updated_at"
1248
1302
  t.datetime "executed_at"
1249
1303
  t.datetime "created_at"
1250
1304
  t.datetime "updated_at"
1251
1305
  end
1252
1306
 
1253
- create_table "resource_import_file_transitions", force: :cascade do |t|
1307
+ create_table "resource_import_file_transitions", id: :serial, force: :cascade do |t|
1254
1308
  t.string "to_state"
1255
1309
  t.text "metadata", default: "{}"
1256
1310
  t.integer "sort_key"
@@ -1263,7 +1317,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1263
1317
  t.index ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
1264
1318
  end
1265
1319
 
1266
- create_table "resource_import_files", force: :cascade do |t|
1320
+ create_table "resource_import_files", id: :serial, force: :cascade do |t|
1267
1321
  t.integer "parent_id"
1268
1322
  t.string "content_type"
1269
1323
  t.integer "size"
@@ -1285,7 +1339,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1285
1339
  t.index ["user_id"], name: "index_resource_import_files_on_user_id"
1286
1340
  end
1287
1341
 
1288
- create_table "resource_import_results", force: :cascade do |t|
1342
+ create_table "resource_import_results", id: :serial, force: :cascade do |t|
1289
1343
  t.integer "resource_import_file_id"
1290
1344
  t.integer "manifestation_id"
1291
1345
  t.integer "item_id"
@@ -1298,7 +1352,16 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1298
1352
  t.index ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
1299
1353
  end
1300
1354
 
1301
- create_table "roles", force: :cascade do |t|
1355
+ create_table "retains", force: :cascade do |t|
1356
+ t.bigint "reserve_id", null: false
1357
+ t.bigint "item_id", null: false
1358
+ t.datetime "created_at", null: false
1359
+ t.datetime "updated_at", null: false
1360
+ t.index ["item_id"], name: "index_retains_on_item_id"
1361
+ t.index ["reserve_id"], name: "index_retains_on_reserve_id"
1362
+ end
1363
+
1364
+ create_table "roles", id: :serial, force: :cascade do |t|
1302
1365
  t.string "name", null: false
1303
1366
  t.string "display_name"
1304
1367
  t.text "note"
@@ -1306,9 +1369,10 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1306
1369
  t.datetime "updated_at"
1307
1370
  t.integer "score", default: 0, null: false
1308
1371
  t.integer "position"
1372
+ t.jsonb "display_name_translations", default: {}, null: false
1309
1373
  end
1310
1374
 
1311
- create_table "search_engines", force: :cascade do |t|
1375
+ create_table "search_engines", id: :serial, force: :cascade do |t|
1312
1376
  t.string "name", null: false
1313
1377
  t.text "display_name"
1314
1378
  t.string "url", null: false
@@ -1320,15 +1384,16 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1320
1384
  t.integer "position"
1321
1385
  t.datetime "created_at"
1322
1386
  t.datetime "updated_at"
1387
+ t.jsonb "display_name_translations", default: {}, null: false
1323
1388
  end
1324
1389
 
1325
- create_table "series_statement_merge_lists", force: :cascade do |t|
1390
+ create_table "series_statement_merge_lists", id: :serial, force: :cascade do |t|
1326
1391
  t.string "title"
1327
1392
  t.datetime "created_at"
1328
1393
  t.datetime "updated_at"
1329
1394
  end
1330
1395
 
1331
- create_table "series_statement_merges", force: :cascade do |t|
1396
+ create_table "series_statement_merges", id: :serial, force: :cascade do |t|
1332
1397
  t.integer "series_statement_id", null: false
1333
1398
  t.integer "series_statement_merge_list_id", null: false
1334
1399
  t.datetime "created_at"
@@ -1337,7 +1402,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1337
1402
  t.index ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
1338
1403
  end
1339
1404
 
1340
- create_table "series_statements", force: :cascade do |t|
1405
+ create_table "series_statements", id: :serial, force: :cascade do |t|
1341
1406
  t.text "original_title"
1342
1407
  t.text "numbering"
1343
1408
  t.text "title_subseries"
@@ -1361,7 +1426,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1361
1426
  t.index ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
1362
1427
  end
1363
1428
 
1364
- create_table "shelves", force: :cascade do |t|
1429
+ create_table "shelves", id: :serial, force: :cascade do |t|
1365
1430
  t.string "name", null: false
1366
1431
  t.text "display_name"
1367
1432
  t.text "note"
@@ -1372,10 +1437,11 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1372
1437
  t.datetime "updated_at"
1373
1438
  t.datetime "deleted_at"
1374
1439
  t.boolean "closed", default: false, null: false
1440
+ t.jsonb "display_name_translations", default: {}, null: false
1375
1441
  t.index ["library_id"], name: "index_shelves_on_library_id"
1376
1442
  end
1377
1443
 
1378
- create_table "subject_heading_types", force: :cascade do |t|
1444
+ create_table "subject_heading_types", id: :serial, force: :cascade do |t|
1379
1445
  t.string "name", null: false
1380
1446
  t.text "display_name"
1381
1447
  t.text "note"
@@ -1384,7 +1450,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1384
1450
  t.datetime "updated_at"
1385
1451
  end
1386
1452
 
1387
- create_table "subject_types", force: :cascade do |t|
1453
+ create_table "subject_types", id: :serial, force: :cascade do |t|
1388
1454
  t.string "name", null: false
1389
1455
  t.text "display_name"
1390
1456
  t.text "note"
@@ -1393,7 +1459,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1393
1459
  t.datetime "updated_at"
1394
1460
  end
1395
1461
 
1396
- create_table "subjects", force: :cascade do |t|
1462
+ create_table "subjects", id: :serial, force: :cascade do |t|
1397
1463
  t.integer "parent_id"
1398
1464
  t.integer "use_term_id"
1399
1465
  t.string "term"
@@ -1417,7 +1483,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1417
1483
  t.index ["use_term_id"], name: "index_subjects_on_use_term_id"
1418
1484
  end
1419
1485
 
1420
- create_table "subscribes", force: :cascade do |t|
1486
+ create_table "subscribes", id: :serial, force: :cascade do |t|
1421
1487
  t.integer "subscription_id", null: false
1422
1488
  t.integer "work_id", null: false
1423
1489
  t.datetime "start_at", null: false
@@ -1428,7 +1494,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1428
1494
  t.index ["work_id"], name: "index_subscribes_on_work_id"
1429
1495
  end
1430
1496
 
1431
- create_table "subscriptions", force: :cascade do |t|
1497
+ create_table "subscriptions", id: :serial, force: :cascade do |t|
1432
1498
  t.text "title", null: false
1433
1499
  t.text "note"
1434
1500
  t.integer "user_id"
@@ -1441,26 +1507,34 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1441
1507
  t.index ["user_id"], name: "index_subscriptions_on_user_id"
1442
1508
  end
1443
1509
 
1444
- create_table "taggings", force: :cascade do |t|
1510
+ create_table "taggings", id: :serial, force: :cascade do |t|
1445
1511
  t.integer "tag_id"
1446
1512
  t.string "taggable_type"
1447
1513
  t.integer "taggable_id"
1448
1514
  t.string "tagger_type"
1449
1515
  t.integer "tagger_id"
1450
- t.string "context"
1516
+ t.string "context", limit: 128
1451
1517
  t.datetime "created_at"
1518
+ t.index ["context"], name: "index_taggings_on_context"
1519
+ t.index ["tag_id", "taggable_id", "taggable_type", "context", "tagger_id", "tagger_type"], name: "taggings_idx", unique: true
1452
1520
  t.index ["tag_id"], name: "index_taggings_on_tag_id"
1453
1521
  t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
1522
+ t.index ["taggable_id", "taggable_type", "tagger_id", "context"], name: "taggings_idy"
1523
+ t.index ["taggable_id"], name: "index_taggings_on_taggable_id"
1524
+ t.index ["taggable_type"], name: "index_taggings_on_taggable_type"
1525
+ t.index ["tagger_id", "tagger_type"], name: "index_taggings_on_tagger_id_and_tagger_type"
1526
+ t.index ["tagger_id"], name: "index_taggings_on_tagger_id"
1454
1527
  end
1455
1528
 
1456
- create_table "tags", force: :cascade do |t|
1529
+ create_table "tags", id: :serial, force: :cascade do |t|
1457
1530
  t.string "name"
1458
- t.string "name_transcription"
1531
+ t.integer "taggings_count", default: 0
1459
1532
  t.datetime "created_at"
1460
1533
  t.datetime "updated_at"
1534
+ t.index ["name"], name: "index_tags_on_name", unique: true
1461
1535
  end
1462
1536
 
1463
- create_table "use_restrictions", force: :cascade do |t|
1537
+ create_table "use_restrictions", id: :serial, force: :cascade do |t|
1464
1538
  t.string "name", null: false
1465
1539
  t.text "display_name"
1466
1540
  t.text "note"
@@ -1469,7 +1543,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1469
1543
  t.datetime "updated_at"
1470
1544
  end
1471
1545
 
1472
- create_table "user_checkout_stat_transitions", force: :cascade do |t|
1546
+ create_table "user_checkout_stat_transitions", id: :serial, force: :cascade do |t|
1473
1547
  t.string "to_state"
1474
1548
  t.text "metadata", default: "{}"
1475
1549
  t.integer "sort_key"
@@ -1482,7 +1556,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1482
1556
  t.index ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
1483
1557
  end
1484
1558
 
1485
- create_table "user_checkout_stats", force: :cascade do |t|
1559
+ create_table "user_checkout_stats", id: :serial, force: :cascade do |t|
1486
1560
  t.datetime "start_date"
1487
1561
  t.datetime "end_date"
1488
1562
  t.text "note"
@@ -1494,7 +1568,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1494
1568
  t.index ["user_id"], name: "index_user_checkout_stats_on_user_id"
1495
1569
  end
1496
1570
 
1497
- create_table "user_export_file_transitions", force: :cascade do |t|
1571
+ create_table "user_export_file_transitions", id: :serial, force: :cascade do |t|
1498
1572
  t.string "to_state"
1499
1573
  t.text "metadata", default: "{}"
1500
1574
  t.integer "sort_key"
@@ -1508,11 +1582,11 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1508
1582
  t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
1509
1583
  end
1510
1584
 
1511
- create_table "user_export_files", force: :cascade do |t|
1585
+ create_table "user_export_files", id: :serial, force: :cascade do |t|
1512
1586
  t.integer "user_id"
1513
1587
  t.string "user_export_file_name"
1514
1588
  t.string "user_export_content_type"
1515
- t.integer "user_export_file_size"
1589
+ t.bigint "user_export_file_size"
1516
1590
  t.datetime "user_export_updated_at"
1517
1591
  t.datetime "executed_at"
1518
1592
  t.datetime "created_at"
@@ -1520,7 +1594,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1520
1594
  t.index ["user_id"], name: "index_user_export_files_on_user_id"
1521
1595
  end
1522
1596
 
1523
- create_table "user_group_has_checkout_types", force: :cascade do |t|
1597
+ create_table "user_group_has_checkout_types", id: :serial, force: :cascade do |t|
1524
1598
  t.integer "user_group_id", null: false
1525
1599
  t.integer "checkout_type_id", null: false
1526
1600
  t.integer "checkout_limit", default: 0, null: false
@@ -1539,7 +1613,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1539
1613
  t.index ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1540
1614
  end
1541
1615
 
1542
- create_table "user_groups", force: :cascade do |t|
1616
+ create_table "user_groups", id: :serial, force: :cascade do |t|
1543
1617
  t.string "name"
1544
1618
  t.text "display_name"
1545
1619
  t.text "note"
@@ -1552,9 +1626,10 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1552
1626
  t.integer "number_of_day_to_notify_overdue", default: 7, null: false
1553
1627
  t.integer "number_of_day_to_notify_due_date", default: 3, null: false
1554
1628
  t.integer "number_of_time_to_notify_overdue", default: 3, null: false
1629
+ t.jsonb "display_name_translations", default: {}, null: false
1555
1630
  end
1556
1631
 
1557
- create_table "user_has_roles", force: :cascade do |t|
1632
+ create_table "user_has_roles", id: :serial, force: :cascade do |t|
1558
1633
  t.integer "user_id", null: false
1559
1634
  t.integer "role_id", null: false
1560
1635
  t.datetime "created_at"
@@ -1563,7 +1638,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1563
1638
  t.index ["user_id"], name: "index_user_has_roles_on_user_id"
1564
1639
  end
1565
1640
 
1566
- create_table "user_import_file_transitions", force: :cascade do |t|
1641
+ create_table "user_import_file_transitions", id: :serial, force: :cascade do |t|
1567
1642
  t.string "to_state"
1568
1643
  t.text "metadata", default: "{}"
1569
1644
  t.integer "sort_key"
@@ -1576,7 +1651,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1576
1651
  t.index ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
1577
1652
  end
1578
1653
 
1579
- create_table "user_import_files", force: :cascade do |t|
1654
+ create_table "user_import_files", id: :serial, force: :cascade do |t|
1580
1655
  t.integer "user_id"
1581
1656
  t.text "note"
1582
1657
  t.datetime "executed_at"
@@ -1595,7 +1670,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1595
1670
  t.index ["user_id"], name: "index_user_import_files_on_user_id"
1596
1671
  end
1597
1672
 
1598
- create_table "user_import_results", force: :cascade do |t|
1673
+ create_table "user_import_results", id: :serial, force: :cascade do |t|
1599
1674
  t.integer "user_import_file_id"
1600
1675
  t.integer "user_id"
1601
1676
  t.text "body"
@@ -1606,7 +1681,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1606
1681
  t.index ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
1607
1682
  end
1608
1683
 
1609
- create_table "user_reserve_stat_transitions", force: :cascade do |t|
1684
+ create_table "user_reserve_stat_transitions", id: :serial, force: :cascade do |t|
1610
1685
  t.string "to_state"
1611
1686
  t.text "metadata", default: "{}"
1612
1687
  t.integer "sort_key"
@@ -1619,7 +1694,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1619
1694
  t.index ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
1620
1695
  end
1621
1696
 
1622
- create_table "user_reserve_stats", force: :cascade do |t|
1697
+ create_table "user_reserve_stats", id: :serial, force: :cascade do |t|
1623
1698
  t.datetime "start_date"
1624
1699
  t.datetime "end_date"
1625
1700
  t.text "note"
@@ -1631,7 +1706,7 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1631
1706
  t.index ["user_id"], name: "index_user_reserve_stats_on_user_id"
1632
1707
  end
1633
1708
 
1634
- create_table "users", force: :cascade do |t|
1709
+ create_table "users", id: :serial, force: :cascade do |t|
1635
1710
  t.string "email", default: "", null: false
1636
1711
  t.string "encrypted_password", default: "", null: false
1637
1712
  t.string "reset_password_token"
@@ -1644,8 +1719,6 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1644
1719
  t.string "last_sign_in_ip"
1645
1720
  t.datetime "created_at"
1646
1721
  t.datetime "updated_at"
1647
- t.boolean "save_checkout_history", default: false, null: false
1648
- t.string "checkout_icalendar_token"
1649
1722
  t.string "username"
1650
1723
  t.datetime "deleted_at"
1651
1724
  t.datetime "expired_at"
@@ -1653,24 +1726,13 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1653
1726
  t.string "unlock_token"
1654
1727
  t.datetime "locked_at"
1655
1728
  t.datetime "confirmed_at"
1656
- t.index ["checkout_icalendar_token"], name: "index_users_on_checkout_icalendar_token", unique: true
1657
1729
  t.index ["email"], name: "index_users_on_email"
1658
1730
  t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
1659
1731
  t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
1660
1732
  t.index ["username"], name: "index_users_on_username", unique: true
1661
1733
  end
1662
1734
 
1663
- create_table "versions", force: :cascade do |t|
1664
- t.string "item_type", null: false
1665
- t.integer "item_id", null: false
1666
- t.string "event", null: false
1667
- t.string "whodunnit"
1668
- t.text "object"
1669
- t.datetime "created_at"
1670
- t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
1671
- end
1672
-
1673
- create_table "withdraws", force: :cascade do |t|
1735
+ create_table "withdraws", id: :serial, force: :cascade do |t|
1674
1736
  t.integer "basket_id"
1675
1737
  t.integer "item_id"
1676
1738
  t.integer "librarian_id"
@@ -1681,4 +1743,56 @@ ActiveRecord::Schema.define(version: 2020_04_25_074822) do
1681
1743
  t.index ["librarian_id"], name: "index_withdraws_on_librarian_id"
1682
1744
  end
1683
1745
 
1746
+ add_foreign_key "carrier_type_has_checkout_types", "carrier_types"
1747
+ add_foreign_key "carrier_type_has_checkout_types", "checkout_types"
1748
+ add_foreign_key "checked_items", "baskets"
1749
+ add_foreign_key "checked_items", "items"
1750
+ add_foreign_key "checked_items", "users"
1751
+ add_foreign_key "checkins", "items"
1752
+ add_foreign_key "checkout_stat_has_manifestations", "manifestations"
1753
+ add_foreign_key "checkout_stat_has_users", "user_checkout_stats"
1754
+ add_foreign_key "checkout_stat_has_users", "users"
1755
+ add_foreign_key "checkouts", "checkins"
1756
+ add_foreign_key "checkouts", "items"
1757
+ add_foreign_key "checkouts", "libraries"
1758
+ add_foreign_key "checkouts", "shelves"
1759
+ add_foreign_key "checkouts", "users"
1760
+ add_foreign_key "demands", "items"
1761
+ add_foreign_key "demands", "messages"
1762
+ add_foreign_key "demands", "users"
1763
+ add_foreign_key "doi_records", "manifestations"
1764
+ add_foreign_key "events", "event_categories"
1765
+ add_foreign_key "isbn_record_and_manifestations", "isbn_records"
1766
+ add_foreign_key "isbn_record_and_manifestations", "manifestations"
1767
+ add_foreign_key "issn_record_and_manifestations", "issn_records"
1768
+ add_foreign_key "issn_record_and_manifestations", "manifestations"
1769
+ add_foreign_key "item_has_use_restrictions", "items"
1770
+ add_foreign_key "item_has_use_restrictions", "use_restrictions"
1771
+ add_foreign_key "items", "manifestations"
1772
+ add_foreign_key "jpno_records", "manifestations"
1773
+ add_foreign_key "lending_policies", "items"
1774
+ add_foreign_key "lending_policies", "user_groups"
1775
+ add_foreign_key "libraries", "library_groups"
1776
+ add_foreign_key "library_groups", "users"
1777
+ add_foreign_key "manifestation_checkout_stats", "users"
1778
+ add_foreign_key "manifestation_reserve_stats", "users"
1779
+ add_foreign_key "ndl_bib_id_records", "manifestations"
1780
+ add_foreign_key "ndla_records", "agents"
1781
+ add_foreign_key "periodical_and_manifestations", "manifestations"
1782
+ add_foreign_key "periodical_and_manifestations", "periodicals"
1783
+ add_foreign_key "periodicals", "frequencies"
1784
+ add_foreign_key "profiles", "users"
1785
+ add_foreign_key "reserve_stat_has_manifestations", "manifestations"
1786
+ add_foreign_key "reserve_stat_has_users", "user_reserve_stats"
1787
+ add_foreign_key "reserve_stat_has_users", "users"
1788
+ add_foreign_key "reserves", "manifestations"
1789
+ add_foreign_key "reserves", "users"
1790
+ add_foreign_key "retains", "items"
1791
+ add_foreign_key "retains", "reserves", column: "reserve_id"
1792
+ add_foreign_key "user_checkout_stats", "users"
1793
+ add_foreign_key "user_group_has_checkout_types", "checkout_types"
1794
+ add_foreign_key "user_group_has_checkout_types", "user_groups"
1795
+ add_foreign_key "user_has_roles", "roles"
1796
+ add_foreign_key "user_has_roles", "users"
1797
+ add_foreign_key "user_reserve_stats", "users"
1684
1798
  end