enju_ndl 0.4.0.beta.1 → 0.4.0.rc.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (178) hide show
  1. checksums.yaml +4 -4
  2. data/app/models/agent.rb +57 -0
  3. data/app/models/import_request.rb +17 -0
  4. data/app/models/manifestation.rb +71 -0
  5. data/lib/enju_ndl/version.rb +1 -1
  6. data/spec/dummy/app/controllers/application_controller.rb +0 -1
  7. data/spec/dummy/app/models/user.rb +2 -4
  8. data/spec/dummy/db/migrate/001_create_agents.rb +1 -2
  9. data/spec/dummy/db/migrate/005_create_manifestations.rb +1 -2
  10. data/spec/dummy/db/migrate/006_create_items.rb +1 -2
  11. data/spec/dummy/db/migrate/012_create_owns.rb +1 -3
  12. data/spec/dummy/db/migrate/015_create_creates.rb +1 -3
  13. data/spec/dummy/db/migrate/041_create_roles.rb +1 -1
  14. data/spec/dummy/db/migrate/047_create_produces.rb +1 -3
  15. data/spec/dummy/db/migrate/059_create_libraries.rb +1 -2
  16. data/spec/dummy/db/migrate/069_create_shelves.rb +1 -2
  17. data/spec/dummy/db/migrate/073_create_carrier_types.rb +1 -1
  18. data/spec/dummy/db/migrate/077_create_user_groups.rb +1 -2
  19. data/spec/dummy/db/migrate/080_create_library_groups.rb +1 -1
  20. data/spec/dummy/db/migrate/112_create_frequencies.rb +1 -1
  21. data/spec/dummy/db/migrate/117_create_form_of_works.rb +1 -1
  22. data/spec/dummy/db/migrate/120_create_baskets.rb +1 -1
  23. data/spec/dummy/db/migrate/124_create_bookstores.rb +1 -2
  24. data/spec/dummy/db/migrate/125_create_donates.rb +1 -1
  25. data/spec/dummy/db/migrate/130_create_request_status_types.rb +1 -1
  26. data/spec/dummy/db/migrate/131_create_request_types.rb +1 -1
  27. data/spec/dummy/db/migrate/133_create_agent_merges.rb +1 -1
  28. data/spec/dummy/db/migrate/134_create_agent_merge_lists.rb +1 -1
  29. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +1 -3
  30. data/spec/dummy/db/migrate/20080905191442_create_agent_types.rb +1 -1
  31. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +1 -2
  32. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +1 -1
  33. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +1 -1
  34. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +1 -1
  35. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +1 -1
  36. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +1 -1
  37. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +1 -1
  38. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -1
  39. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +1 -1
  40. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +1 -1
  41. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +1 -1
  42. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +1 -1
  43. data/spec/dummy/db/migrate/20090812151902_create_agent_relationship_types.rb +1 -1
  44. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +1 -1
  45. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +1 -1
  46. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +1 -1
  47. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +1 -1
  48. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +1 -1
  49. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +1 -1
  50. data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
  51. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +1 -1
  52. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +1 -1
  53. data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +1 -1
  54. data/spec/dummy/db/migrate/20100606073747_create_agent_relationships.rb +1 -1
  55. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +1 -1
  56. data/spec/dummy/db/migrate/20100814091104_add_position_to_agent_relationship.rb +1 -1
  57. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +1 -1
  58. data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +1 -1
  59. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +1 -1
  60. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +1 -1
  61. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +1 -1
  62. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_agent.rb +1 -1
  63. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +1 -1
  64. data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +1 -1
  65. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +1 -1
  66. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +1 -1
  67. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +1 -1
  68. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +1 -1
  69. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +1 -1
  70. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +1 -1
  71. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +1 -1
  72. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +1 -1
  73. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +1 -1
  74. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +1 -1
  75. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +1 -1
  76. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
  77. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -1
  78. data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +1 -1
  79. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -1
  80. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +1 -1
  81. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +1 -1
  82. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +1 -1
  83. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +1 -1
  84. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +1 -1
  85. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +1 -1
  86. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_agent_import_file.rb +1 -1
  87. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +1 -1
  88. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_agent_import_file.rb +1 -1
  89. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +1 -1
  90. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +1 -1
  91. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +1 -1
  92. data/spec/dummy/db/migrate/20120511072422_add_agent_identifier_to_agent.rb +1 -1
  93. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_agent_import_file.rb +1 -1
  94. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +1 -1
  95. data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +1 -2
  96. data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
  97. data/spec/dummy/db/migrate/20130421093852_add_periodical_to_manifestation.rb +1 -1
  98. data/spec/dummy/db/migrate/20130421155019_add_creator_string_to_series_statement.rb +1 -1
  99. data/spec/dummy/db/migrate/20130421164124_add_series_master_to_series_statement.rb +1 -1
  100. data/spec/dummy/db/migrate/20130429020822_add_root_manifestation_id_to_series_statement.rb +1 -1
  101. data/spec/dummy/db/migrate/20130506175303_create_identifier_types.rb +1 -1
  102. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +1 -1
  103. data/spec/dummy/db/migrate/20130509185724_add_statement_of_responsibility_to_manifestation.rb +1 -1
  104. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
  105. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +1 -1
  106. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +1 -1
  107. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +1 -1
  108. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +1 -1
  109. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +1 -1
  110. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +2 -6
  111. data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +1 -1
  112. data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +1 -1
  113. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +1 -1
  114. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
  115. data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +1 -1
  116. data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +1 -1
  117. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +1 -1
  118. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +2 -6
  119. data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +1 -1
  120. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
  121. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
  122. data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +1 -1
  123. data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +1 -1
  124. data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +1 -1
  125. data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +1 -1
  126. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +1 -1
  127. data/spec/dummy/db/migrate/20140822114527_add_error_message_to_resource_import_result.rb +1 -1
  128. data/spec/dummy/db/migrate/20140823083524_add_extent_to_manifestation.rb +1 -1
  129. data/spec/dummy/db/migrate/20140823094847_add_dimensions_to_manifestation.rb +1 -1
  130. data/spec/dummy/db/migrate/20140823095740_rename_manifestation_periodical_to_serial.rb +1 -1
  131. data/spec/dummy/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb +1 -1
  132. data/spec/dummy/db/migrate/20141003182825_add_date_of_birth_to_profile.rb +1 -1
  133. data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +1 -1
  134. data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +1 -1
  135. data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +1 -1
  136. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +1 -1
  137. data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +1 -1
  138. data/spec/dummy/db/migrate/20160319144230_create_issn_records.rb +11 -0
  139. data/spec/dummy/db/migrate/20160506144040_create_isbn_records.rb +11 -0
  140. data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
  141. data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
  142. data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
  143. data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +1 -1
  144. data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +1 -1
  145. data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +1 -1
  146. data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +1 -1
  147. data/spec/dummy/db/migrate/20160811102604_add_picture_width_to_picture_file.rb +1 -1
  148. data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +1 -1
  149. data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +1 -1
  150. data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +1 -1
  151. data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +1 -1
  152. data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +1 -1
  153. data/spec/dummy/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
  154. data/spec/dummy/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
  155. data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +1 -1
  156. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +1 -1
  157. data/spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +1 -1
  158. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +1 -1
  159. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +1 -1
  160. data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +1 -1
  161. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
  162. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
  163. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +1 -1
  164. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +1 -1
  165. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +1 -1
  166. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +1 -1
  167. data/spec/dummy/db/migrate/20190102034126_create_doi_records.rb +13 -0
  168. data/spec/dummy/db/migrate/20190311154610_create_periodicals.rb +10 -0
  169. data/spec/dummy/db/migrate/20190312033839_create_periodical_and_manifestations.rb +11 -0
  170. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +5 -0
  171. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +5 -0
  172. data/spec/dummy/db/migrate/20191216131755_add_email_to_library_group.rb +6 -0
  173. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +12 -0
  174. data/spec/dummy/db/schema.rb +318 -234
  175. data/spec/dummy/db/test.sqlite3 +0 -0
  176. data/spec/models/import_request_spec.rb +12 -0
  177. data/spec/models/manifestation_spec.rb +66 -0
  178. metadata +45 -6
@@ -1,4 +1,4 @@
1
- class AddHeaderLogoToLibraryGroup < ActiveRecord::Migration[4.2]
1
+ class AddHeaderLogoToLibraryGroup < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_attachment :library_groups, :header_logo
4
4
  end
@@ -1,4 +1,4 @@
1
- class SetNotNullToManifestationIdOnItems < ActiveRecord::Migration[4.2]
1
+ class SetNotNullToManifestationIdOnItems < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  change_column_null :items, :manifestation_id, false
4
4
  end
@@ -1,4 +1,4 @@
1
- class RenameLoginBannerToOldLoginBanner < ActiveRecord::Migration[4.2]
1
+ class RenameLoginBannerToOldLoginBanner < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  rename_column :library_groups, :login_banner, :old_login_banner
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddForeignKeyToLibraryGroupIdOnLibrary < ActiveRecord::Migration[4.2]
1
+ class AddForeignKeyToLibraryGroupIdOnLibrary < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_foreign_key :libraries, :library_groups, null: false
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddHeaderLogoMetaToLibraryGroup < ActiveRecord::Migration[4.2]
1
+ class AddHeaderLogoMetaToLibraryGroup < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :library_groups, :header_logo_meta, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForAgentImportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForAgentImportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForResourceImportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForResourceImportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForResourceExportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForResourceExportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForImportRequestTransitions < ActiveRecord::Migration[4.2]
1
+ class AddConstraintsToMostRecentForImportRequestTransitions < ActiveRecord::Migration[5.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -0,0 +1,13 @@
1
+ class CreateDoiRecords < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :doi_records do |t|
4
+ t.string :body, index: {unique: true}, null: false
5
+ t.string :display_body, null: false
6
+ t.string :source
7
+ t.jsonb :response, default: {}, null: false
8
+ t.references :manifestation, foreign_key: true, null: false
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ class CreatePeriodicals < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :periodicals do |t|
4
+ t.text :original_title, null: false
5
+ t.references :frequency, foreign_key: true, null: false
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,11 @@
1
+ class CreatePeriodicalAndManifestations < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :periodical_and_manifestations do |t|
4
+ t.references :periodical, foreign_key: true, null: false
5
+ t.references :manifestation, foreign_key: true, null: false
6
+ t.boolean :periodical_master, default: false, null: false, index: {where: 'periodical_master IS true', unique: true}
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddMemoToManifestation < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :manifestations, :memo, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddMemoToItem < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :items, :memo, :text
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddEmailToLibraryGroup < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :library_groups, :email, :string
4
+ add_index :library_groups, :email
5
+ end
6
+ end
@@ -0,0 +1,12 @@
1
+ class CreateCustomProperties < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :custom_properties do |t|
4
+ t.integer :resource_id, null: false
5
+ t.string :resource_type, null: false
6
+ t.text :label, null: false
7
+ t.text :value
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -10,37 +10,37 @@
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: 2019_07_13_115451) do
13
+ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "pgcrypto"
17
17
  enable_extension "plpgsql"
18
18
 
19
- create_table "accepts", id: :serial, force: :cascade do |t|
20
- t.integer "basket_id"
21
- t.integer "item_id"
22
- t.integer "librarian_id"
23
- t.datetime "created_at"
24
- t.datetime "updated_at"
19
+ create_table "accepts", force: :cascade do |t|
20
+ t.bigint "basket_id"
21
+ t.bigint "item_id"
22
+ t.bigint "librarian_id"
23
+ t.datetime "created_at", null: false
24
+ t.datetime "updated_at", null: false
25
25
  t.index ["basket_id"], name: "index_accepts_on_basket_id"
26
26
  t.index ["item_id"], name: "index_accepts_on_item_id"
27
27
  t.index ["librarian_id"], name: "index_accepts_on_librarian_id"
28
28
  end
29
29
 
30
- create_table "agent_import_file_transitions", id: :serial, force: :cascade do |t|
30
+ create_table "agent_import_file_transitions", force: :cascade do |t|
31
31
  t.string "to_state"
32
32
  t.text "metadata", default: "{}"
33
33
  t.integer "sort_key"
34
34
  t.integer "agent_import_file_id"
35
- t.datetime "created_at"
36
- t.datetime "updated_at"
35
+ t.datetime "created_at", null: false
36
+ t.datetime "updated_at", null: false
37
37
  t.boolean "most_recent", null: false
38
38
  t.index ["agent_import_file_id", "most_recent"], name: "index_agent_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
39
39
  t.index ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
40
40
  t.index ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
41
41
  end
42
42
 
43
- create_table "agent_import_files", id: :serial, force: :cascade do |t|
43
+ create_table "agent_import_files", force: :cascade do |t|
44
44
  t.integer "parent_id"
45
45
  t.string "content_type"
46
46
  t.integer "size"
@@ -51,8 +51,8 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
51
51
  t.string "agent_import_content_type"
52
52
  t.integer "agent_import_file_size"
53
53
  t.datetime "agent_import_updated_at"
54
- t.datetime "created_at"
55
- t.datetime "updated_at"
54
+ t.datetime "created_at", null: false
55
+ t.datetime "updated_at", null: false
56
56
  t.string "agent_import_fingerprint"
57
57
  t.text "error_message"
58
58
  t.string "edit_mode"
@@ -61,61 +61,61 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
61
61
  t.index ["user_id"], name: "index_agent_import_files_on_user_id"
62
62
  end
63
63
 
64
- create_table "agent_import_results", id: :serial, force: :cascade do |t|
64
+ create_table "agent_import_results", force: :cascade do |t|
65
65
  t.integer "agent_import_file_id"
66
66
  t.integer "agent_id"
67
67
  t.text "body"
68
- t.datetime "created_at"
69
- t.datetime "updated_at"
68
+ t.datetime "created_at", null: false
69
+ t.datetime "updated_at", null: false
70
70
  end
71
71
 
72
- create_table "agent_merge_lists", id: :serial, force: :cascade do |t|
72
+ create_table "agent_merge_lists", force: :cascade do |t|
73
73
  t.string "title"
74
- t.datetime "created_at"
75
- t.datetime "updated_at"
74
+ t.datetime "created_at", null: false
75
+ t.datetime "updated_at", null: false
76
76
  end
77
77
 
78
- create_table "agent_merges", id: :serial, force: :cascade do |t|
78
+ create_table "agent_merges", force: :cascade do |t|
79
79
  t.integer "agent_id", null: false
80
80
  t.integer "agent_merge_list_id", null: false
81
- t.datetime "created_at"
82
- t.datetime "updated_at"
81
+ t.datetime "created_at", null: false
82
+ t.datetime "updated_at", null: false
83
83
  t.index ["agent_id"], name: "index_agent_merges_on_agent_id"
84
84
  t.index ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
85
85
  end
86
86
 
87
- create_table "agent_relationship_types", id: :serial, force: :cascade do |t|
87
+ create_table "agent_relationship_types", force: :cascade do |t|
88
88
  t.string "name", null: false
89
89
  t.text "display_name"
90
90
  t.text "note"
91
91
  t.integer "position"
92
- t.datetime "created_at"
93
- t.datetime "updated_at"
92
+ t.datetime "created_at", null: false
93
+ t.datetime "updated_at", null: false
94
94
  t.jsonb "display_name_translations", default: {}, null: false
95
95
  end
96
96
 
97
- create_table "agent_relationships", id: :serial, force: :cascade do |t|
97
+ create_table "agent_relationships", force: :cascade do |t|
98
98
  t.integer "parent_id"
99
99
  t.integer "child_id"
100
100
  t.integer "agent_relationship_type_id"
101
- t.datetime "created_at"
102
- t.datetime "updated_at"
101
+ t.datetime "created_at", null: false
102
+ t.datetime "updated_at", null: false
103
103
  t.integer "position"
104
104
  t.index ["child_id"], name: "index_agent_relationships_on_child_id"
105
105
  t.index ["parent_id"], name: "index_agent_relationships_on_parent_id"
106
106
  end
107
107
 
108
- create_table "agent_types", id: :serial, force: :cascade do |t|
108
+ create_table "agent_types", force: :cascade do |t|
109
109
  t.string "name", null: false
110
110
  t.text "display_name"
111
111
  t.text "note"
112
112
  t.integer "position"
113
- t.datetime "created_at"
114
- t.datetime "updated_at"
113
+ t.datetime "created_at", null: false
114
+ t.datetime "updated_at", null: false
115
115
  t.jsonb "display_name_translations", default: {}, null: false
116
116
  end
117
117
 
118
- create_table "agents", id: :serial, force: :cascade do |t|
118
+ create_table "agents", force: :cascade do |t|
119
119
  t.string "last_name"
120
120
  t.string "middle_name"
121
121
  t.string "first_name"
@@ -127,9 +127,8 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
127
127
  t.string "full_name"
128
128
  t.text "full_name_transcription"
129
129
  t.text "full_name_alternative"
130
- t.datetime "created_at"
131
- t.datetime "updated_at"
132
- t.datetime "deleted_at"
130
+ t.datetime "created_at", null: false
131
+ t.datetime "updated_at", null: false
133
132
  t.string "zip_code_1"
134
133
  t.string "zip_code_2"
135
134
  t.text "address_1"
@@ -170,12 +169,12 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
170
169
  t.index ["required_role_id"], name: "index_agents_on_required_role_id"
171
170
  end
172
171
 
173
- create_table "baskets", id: :serial, force: :cascade do |t|
174
- t.integer "user_id"
172
+ create_table "baskets", force: :cascade do |t|
173
+ t.bigint "user_id"
175
174
  t.text "note"
176
175
  t.integer "lock_version", default: 0, null: false
177
- t.datetime "created_at"
178
- t.datetime "updated_at"
176
+ t.datetime "created_at", null: false
177
+ t.datetime "updated_at", null: false
179
178
  t.index ["user_id"], name: "index_baskets_on_user_id"
180
179
  end
181
180
 
@@ -224,7 +223,7 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
224
223
  t.index ["user_id"], name: "index_bookmarks_on_user_id"
225
224
  end
226
225
 
227
- create_table "bookstores", id: :serial, force: :cascade do |t|
226
+ create_table "bookstores", force: :cascade do |t|
228
227
  t.text "name", null: false
229
228
  t.string "zip_code"
230
229
  t.text "address"
@@ -233,18 +232,17 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
233
232
  t.string "fax_number"
234
233
  t.string "url"
235
234
  t.integer "position"
236
- t.datetime "deleted_at"
237
- t.datetime "created_at"
238
- t.datetime "updated_at"
235
+ t.datetime "created_at", null: false
236
+ t.datetime "updated_at", null: false
239
237
  end
240
238
 
241
- create_table "budget_types", id: :serial, force: :cascade do |t|
239
+ create_table "budget_types", force: :cascade do |t|
242
240
  t.string "name"
243
241
  t.text "display_name"
244
242
  t.text "note"
245
243
  t.integer "position"
246
- t.datetime "created_at"
247
- t.datetime "updated_at"
244
+ t.datetime "created_at", null: false
245
+ t.datetime "updated_at", null: false
248
246
  t.jsonb "display_name_translations", default: {}, null: false
249
247
  end
250
248
 
@@ -259,13 +257,13 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
259
257
  t.index ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
260
258
  end
261
259
 
262
- create_table "carrier_types", id: :serial, force: :cascade do |t|
260
+ create_table "carrier_types", force: :cascade do |t|
263
261
  t.string "name", null: false
264
262
  t.text "display_name"
265
263
  t.text "note"
266
264
  t.integer "position"
267
- t.datetime "created_at"
268
- t.datetime "updated_at"
265
+ t.datetime "created_at", null: false
266
+ t.datetime "updated_at", null: false
269
267
  t.string "attachment_file_name"
270
268
  t.string "attachment_content_type"
271
269
  t.bigint "attachment_file_size"
@@ -381,27 +379,27 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
381
379
  t.index ["parent_id"], name: "index_classifications_on_parent_id"
382
380
  end
383
381
 
384
- create_table "colors", id: :serial, force: :cascade do |t|
385
- t.integer "library_group_id"
382
+ create_table "colors", force: :cascade do |t|
383
+ t.bigint "library_group_id"
386
384
  t.string "property"
387
385
  t.string "code"
388
386
  t.integer "position"
389
- t.datetime "created_at"
390
- t.datetime "updated_at"
387
+ t.datetime "created_at", null: false
388
+ t.datetime "updated_at", null: false
391
389
  t.index ["library_group_id"], name: "index_colors_on_library_group_id"
392
390
  end
393
391
 
394
- create_table "content_types", id: :serial, force: :cascade do |t|
392
+ create_table "content_types", force: :cascade do |t|
395
393
  t.string "name", null: false
396
394
  t.text "display_name"
397
395
  t.text "note"
398
396
  t.integer "position"
399
- t.datetime "created_at"
400
- t.datetime "updated_at"
397
+ t.datetime "created_at", null: false
398
+ t.datetime "updated_at", null: false
401
399
  t.jsonb "display_name_translations", default: {}, null: false
402
400
  end
403
401
 
404
- create_table "countries", id: :serial, force: :cascade do |t|
402
+ create_table "countries", force: :cascade do |t|
405
403
  t.string "name", null: false
406
404
  t.text "display_name"
407
405
  t.string "alpha_2"
@@ -415,32 +413,53 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
415
413
  t.index ["numeric_3"], name: "index_countries_on_numeric_3"
416
414
  end
417
415
 
418
- create_table "create_types", id: :serial, force: :cascade do |t|
416
+ create_table "create_types", force: :cascade do |t|
419
417
  t.string "name"
420
418
  t.text "display_name"
421
419
  t.text "note"
422
420
  t.integer "position"
423
- t.datetime "created_at"
424
- t.datetime "updated_at"
421
+ t.datetime "created_at", null: false
422
+ t.datetime "updated_at", null: false
425
423
  t.jsonb "display_name_translations", default: {}, null: false
426
424
  end
427
425
 
428
- create_table "creates", id: :serial, force: :cascade do |t|
429
- t.integer "agent_id", null: false
430
- t.integer "work_id", null: false
426
+ create_table "creates", force: :cascade do |t|
427
+ t.bigint "agent_id", null: false
428
+ t.bigint "work_id", null: false
431
429
  t.integer "position"
432
- t.datetime "created_at"
433
- t.datetime "updated_at"
430
+ t.datetime "created_at", null: false
431
+ t.datetime "updated_at", null: false
434
432
  t.integer "create_type_id"
435
433
  t.index ["agent_id"], name: "index_creates_on_agent_id"
436
434
  t.index ["work_id"], name: "index_creates_on_work_id"
437
435
  end
438
436
 
439
- create_table "donates", id: :serial, force: :cascade do |t|
437
+ create_table "custom_properties", force: :cascade do |t|
438
+ t.integer "resource_id", null: false
439
+ t.string "resource_type", null: false
440
+ t.text "label", null: false
441
+ t.text "value"
442
+ t.datetime "created_at", null: false
443
+ t.datetime "updated_at", null: false
444
+ end
445
+
446
+ create_table "doi_records", force: :cascade do |t|
447
+ t.string "body", null: false
448
+ t.string "display_body", null: false
449
+ t.string "source"
450
+ t.jsonb "response", default: {}, null: false
451
+ t.bigint "manifestation_id", null: false
452
+ t.datetime "created_at", null: false
453
+ t.datetime "updated_at", null: false
454
+ t.index ["body"], name: "index_doi_records_on_body", unique: true
455
+ t.index ["manifestation_id"], name: "index_doi_records_on_manifestation_id"
456
+ end
457
+
458
+ create_table "donates", force: :cascade do |t|
440
459
  t.integer "agent_id", null: false
441
460
  t.integer "item_id", null: false
442
- t.datetime "created_at"
443
- t.datetime "updated_at"
461
+ t.datetime "created_at", null: false
462
+ t.datetime "updated_at", null: false
444
463
  t.index ["agent_id"], name: "index_donates_on_agent_id"
445
464
  t.index ["item_id"], name: "index_donates_on_item_id"
446
465
  end
@@ -553,71 +572,109 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
553
572
  t.datetime "updated_at"
554
573
  end
555
574
 
556
- create_table "form_of_works", id: :serial, force: :cascade do |t|
575
+ create_table "form_of_works", force: :cascade do |t|
557
576
  t.string "name", null: false
558
577
  t.text "display_name"
559
578
  t.text "note"
560
579
  t.integer "position"
561
- t.datetime "created_at"
562
- t.datetime "updated_at"
580
+ t.datetime "created_at", null: false
581
+ t.datetime "updated_at", null: false
563
582
  t.jsonb "display_name_translations", default: {}, null: false
564
583
  end
565
584
 
566
- create_table "frequencies", id: :serial, force: :cascade do |t|
585
+ create_table "frequencies", force: :cascade do |t|
567
586
  t.string "name", null: false
568
587
  t.text "display_name"
569
588
  t.text "note"
570
589
  t.integer "position"
571
- t.datetime "created_at"
572
- t.datetime "updated_at"
590
+ t.datetime "created_at", null: false
591
+ t.datetime "updated_at", null: false
573
592
  t.jsonb "display_name_translations", default: {}, null: false
574
593
  end
575
594
 
576
- create_table "identifier_types", id: :serial, force: :cascade do |t|
595
+ create_table "identifier_types", force: :cascade do |t|
577
596
  t.string "name"
578
597
  t.text "display_name"
579
598
  t.text "note"
580
599
  t.integer "position"
581
- t.datetime "created_at"
582
- t.datetime "updated_at"
600
+ t.datetime "created_at", null: false
601
+ t.datetime "updated_at", null: false
583
602
  end
584
603
 
585
- create_table "identifiers", id: :serial, force: :cascade do |t|
604
+ create_table "identifiers", force: :cascade do |t|
586
605
  t.string "body", null: false
587
606
  t.integer "identifier_type_id", null: false
588
607
  t.integer "manifestation_id"
589
608
  t.boolean "primary"
590
609
  t.integer "position"
591
- t.datetime "created_at"
592
- t.datetime "updated_at"
610
+ t.datetime "created_at", null: false
611
+ t.datetime "updated_at", null: false
593
612
  t.index ["body", "identifier_type_id"], name: "index_identifiers_on_body_and_identifier_type_id"
594
613
  t.index ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
595
614
  end
596
615
 
597
- create_table "import_request_transitions", id: :serial, force: :cascade do |t|
616
+ create_table "import_request_transitions", force: :cascade do |t|
598
617
  t.string "to_state"
599
618
  t.text "metadata", default: "{}"
600
619
  t.integer "sort_key"
601
620
  t.integer "import_request_id"
602
- t.datetime "created_at"
603
- t.datetime "updated_at"
621
+ t.datetime "created_at", null: false
622
+ t.datetime "updated_at", null: false
604
623
  t.boolean "most_recent", null: false
605
624
  t.index ["import_request_id", "most_recent"], name: "index_import_request_transitions_parent_most_recent", unique: true, where: "most_recent"
606
625
  t.index ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
607
626
  t.index ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
608
627
  end
609
628
 
610
- create_table "import_requests", id: :serial, force: :cascade do |t|
629
+ create_table "import_requests", force: :cascade do |t|
611
630
  t.string "isbn"
612
631
  t.integer "manifestation_id"
613
632
  t.integer "user_id"
614
- t.datetime "created_at"
615
- t.datetime "updated_at"
633
+ t.datetime "created_at", null: false
634
+ t.datetime "updated_at", null: false
616
635
  t.index ["isbn"], name: "index_import_requests_on_isbn"
617
636
  t.index ["manifestation_id"], name: "index_import_requests_on_manifestation_id"
618
637
  t.index ["user_id"], name: "index_import_requests_on_user_id"
619
638
  end
620
639
 
640
+ create_table "isbn_record_and_manifestations", force: :cascade do |t|
641
+ t.bigint "isbn_record_id", null: false
642
+ t.bigint "manifestation_id", null: false
643
+ t.integer "position"
644
+ t.datetime "created_at", null: false
645
+ t.datetime "updated_at", null: false
646
+ t.index ["isbn_record_id"], name: "index_isbn_record_and_manifestations_on_isbn_record_id"
647
+ t.index ["manifestation_id"], name: "index_isbn_record_and_manifestations_on_manifestation_id"
648
+ end
649
+
650
+ create_table "isbn_records", force: :cascade do |t|
651
+ t.string "body", null: false
652
+ t.string "isbn_type"
653
+ t.string "source"
654
+ t.datetime "created_at", null: false
655
+ t.datetime "updated_at", null: false
656
+ t.index ["body"], name: "index_isbn_records_on_body", unique: true
657
+ end
658
+
659
+ create_table "issn_record_and_manifestations", force: :cascade do |t|
660
+ t.bigint "issn_record_id", null: false
661
+ t.bigint "manifestation_id", null: false
662
+ t.integer "position"
663
+ t.datetime "created_at", null: false
664
+ t.datetime "updated_at", null: false
665
+ t.index ["issn_record_id"], name: "index_issn_record_and_manifestations_on_issn_record_id"
666
+ t.index ["manifestation_id"], name: "index_issn_record_and_manifestations_on_manifestation_id"
667
+ end
668
+
669
+ create_table "issn_records", force: :cascade do |t|
670
+ t.string "body", null: false
671
+ t.string "issn_type"
672
+ t.string "source"
673
+ t.datetime "created_at", null: false
674
+ t.datetime "updated_at", null: false
675
+ t.index ["body"], name: "index_issn_records_on_body", unique: true
676
+ end
677
+
621
678
  create_table "item_has_use_restrictions", id: :serial, force: :cascade do |t|
622
679
  t.integer "item_id", null: false
623
680
  t.integer "use_restriction_id", null: false
@@ -627,12 +684,11 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
627
684
  t.index ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
628
685
  end
629
686
 
630
- create_table "items", id: :serial, force: :cascade do |t|
687
+ create_table "items", force: :cascade do |t|
631
688
  t.string "call_number"
632
689
  t.string "item_identifier"
633
- t.datetime "created_at"
634
- t.datetime "updated_at"
635
- t.datetime "deleted_at"
690
+ t.datetime "created_at", null: false
691
+ t.datetime "updated_at", null: false
636
692
  t.integer "shelf_id", default: 1, null: false
637
693
  t.boolean "include_supplements", default: false, null: false
638
694
  t.text "note"
@@ -650,6 +706,7 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
650
706
  t.string "binding_call_number"
651
707
  t.datetime "binded_at"
652
708
  t.integer "manifestation_id", null: false
709
+ t.text "memo"
653
710
  t.index ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
654
711
  t.index ["bookstore_id"], name: "index_items_on_bookstore_id"
655
712
  t.index ["checkout_type_id"], name: "index_items_on_checkout_type_id"
@@ -669,7 +726,7 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
669
726
  t.index ["manifestation_id"], name: "index_jpno_records_on_manifestation_id"
670
727
  end
671
728
 
672
- create_table "languages", id: :serial, force: :cascade do |t|
729
+ create_table "languages", force: :cascade do |t|
673
730
  t.string "name", null: false
674
731
  t.string "native_name"
675
732
  t.text "display_name"
@@ -699,7 +756,7 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
699
756
  t.index ["item_id", "user_group_id"], name: "index_lending_policies_on_item_id_and_user_group_id", unique: true
700
757
  end
701
758
 
702
- create_table "libraries", id: :serial, force: :cascade do |t|
759
+ create_table "libraries", force: :cascade do |t|
703
760
  t.string "name", null: false
704
761
  t.text "display_name"
705
762
  t.string "short_display_name", null: false
@@ -713,23 +770,23 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
713
770
  t.text "note"
714
771
  t.integer "call_number_rows", default: 1, null: false
715
772
  t.string "call_number_delimiter", default: "|", null: false
716
- t.integer "library_group_id", null: false
773
+ t.bigint "library_group_id", null: false
717
774
  t.integer "users_count", default: 0, null: false
718
775
  t.integer "position"
719
- t.integer "country_id"
720
- t.datetime "created_at"
721
- t.datetime "updated_at"
722
- t.datetime "deleted_at"
776
+ t.bigint "country_id"
777
+ t.datetime "created_at", null: false
778
+ t.datetime "updated_at", null: false
723
779
  t.text "opening_hour"
724
780
  t.string "isil"
725
781
  t.float "latitude"
726
782
  t.float "longitude"
727
783
  t.jsonb "display_name_translations", default: {}, null: false
784
+ t.index ["country_id"], name: "index_libraries_on_country_id"
728
785
  t.index ["library_group_id"], name: "index_libraries_on_library_group_id"
729
786
  t.index ["name"], name: "index_libraries_on_name"
730
787
  end
731
788
 
732
- create_table "library_groups", id: :serial, force: :cascade do |t|
789
+ create_table "library_groups", force: :cascade do |t|
733
790
  t.string "name", null: false
734
791
  t.text "display_name"
735
792
  t.string "short_name", null: false
@@ -738,8 +795,8 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
738
795
  t.text "note"
739
796
  t.integer "country_id"
740
797
  t.integer "position"
741
- t.datetime "created_at"
742
- t.datetime "updated_at"
798
+ t.datetime "created_at", null: false
799
+ t.datetime "updated_at", null: false
743
800
  t.text "admin_networks"
744
801
  t.boolean "allow_bookmark_external_url", default: false, null: false
745
802
  t.string "url", default: "http://localhost:3000/"
@@ -748,7 +805,7 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
748
805
  t.integer "max_number_of_results", default: 500
749
806
  t.boolean "family_name_first", default: true
750
807
  t.integer "pub_year_facet_range_interval", default: 10
751
- t.integer "user_id"
808
+ t.bigint "user_id"
752
809
  t.boolean "csv_charset_conversion", default: false, null: false
753
810
  t.string "header_logo_file_name"
754
811
  t.string "header_logo_content_type"
@@ -758,17 +815,19 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
758
815
  t.jsonb "display_name_translations", default: {}, null: false
759
816
  t.jsonb "login_banner_translations", default: {}, null: false
760
817
  t.jsonb "footer_banner_translations", default: {}, null: false
818
+ t.string "email"
819
+ t.index ["email"], name: "index_library_groups_on_email"
761
820
  t.index ["short_name"], name: "index_library_groups_on_short_name"
762
821
  t.index ["user_id"], name: "index_library_groups_on_user_id"
763
822
  end
764
823
 
765
- create_table "licenses", id: :serial, force: :cascade do |t|
824
+ create_table "licenses", force: :cascade do |t|
766
825
  t.string "name", null: false
767
826
  t.string "display_name"
768
827
  t.text "note"
769
828
  t.integer "position"
770
- t.datetime "created_at"
771
- t.datetime "updated_at"
829
+ t.datetime "created_at", null: false
830
+ t.datetime "updated_at", null: false
772
831
  t.jsonb "display_name_translations", default: {}, null: false
773
832
  end
774
833
 
@@ -795,22 +854,22 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
795
854
  t.index ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
796
855
  end
797
856
 
798
- create_table "manifestation_relationship_types", id: :serial, force: :cascade do |t|
857
+ create_table "manifestation_relationship_types", force: :cascade do |t|
799
858
  t.string "name", null: false
800
859
  t.text "display_name"
801
860
  t.text "note"
802
861
  t.integer "position"
803
- t.datetime "created_at"
804
- t.datetime "updated_at"
862
+ t.datetime "created_at", null: false
863
+ t.datetime "updated_at", null: false
805
864
  t.jsonb "display_name_translations", default: {}, null: false
806
865
  end
807
866
 
808
- create_table "manifestation_relationships", id: :serial, force: :cascade do |t|
867
+ create_table "manifestation_relationships", force: :cascade do |t|
809
868
  t.integer "parent_id"
810
869
  t.integer "child_id"
811
870
  t.integer "manifestation_relationship_type_id"
812
- t.datetime "created_at"
813
- t.datetime "updated_at"
871
+ t.datetime "created_at", null: false
872
+ t.datetime "updated_at", null: false
814
873
  t.integer "position"
815
874
  t.index ["child_id"], name: "index_manifestation_relationships_on_child_id"
816
875
  t.index ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
@@ -839,7 +898,7 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
839
898
  t.index ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
840
899
  end
841
900
 
842
- create_table "manifestations", id: :serial, force: :cascade do |t|
901
+ create_table "manifestations", force: :cascade do |t|
843
902
  t.text "original_title", null: false
844
903
  t.text "title_alternative"
845
904
  t.text "title_transcription"
@@ -847,9 +906,8 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
847
906
  t.string "manifestation_identifier"
848
907
  t.datetime "date_of_publication"
849
908
  t.datetime "date_copyrighted"
850
- t.datetime "created_at"
851
- t.datetime "updated_at"
852
- t.datetime "deleted_at"
909
+ t.datetime "created_at", null: false
910
+ t.datetime "updated_at", null: false
853
911
  t.string "access_address"
854
912
  t.integer "language_id", default: 1, null: false
855
913
  t.integer "carrier_type_id", default: 1, null: false
@@ -899,6 +957,7 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
899
957
  t.text "publication_place"
900
958
  t.text "extent"
901
959
  t.text "dimensions"
960
+ t.text "memo"
902
961
  t.index ["access_address"], name: "index_manifestations_on_access_address"
903
962
  t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
904
963
  t.index ["doi"], name: "index_manifestations_on_doi"
@@ -906,13 +965,13 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
906
965
  t.index ["updated_at"], name: "index_manifestations_on_updated_at"
907
966
  end
908
967
 
909
- create_table "medium_of_performances", id: :serial, force: :cascade do |t|
968
+ create_table "medium_of_performances", force: :cascade do |t|
910
969
  t.string "name", null: false
911
970
  t.text "display_name"
912
971
  t.text "note"
913
972
  t.integer "position"
914
- t.datetime "created_at"
915
- t.datetime "updated_at"
973
+ t.datetime "created_at", null: false
974
+ t.datetime "updated_at", null: false
916
975
  t.jsonb "display_name_translations", default: {}, null: false
917
976
  end
918
977
 
@@ -999,12 +1058,12 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
999
1058
  t.index ["body"], name: "index_ndla_records_on_body", unique: true
1000
1059
  end
1001
1060
 
1002
- create_table "owns", id: :serial, force: :cascade do |t|
1003
- t.integer "agent_id", null: false
1004
- t.integer "item_id", null: false
1061
+ create_table "owns", force: :cascade do |t|
1062
+ t.bigint "agent_id", null: false
1063
+ t.bigint "item_id", null: false
1005
1064
  t.integer "position"
1006
- t.datetime "created_at"
1007
- t.datetime "updated_at"
1065
+ t.datetime "created_at", null: false
1066
+ t.datetime "updated_at", null: false
1008
1067
  t.index ["agent_id"], name: "index_owns_on_agent_id"
1009
1068
  t.index ["item_id"], name: "index_owns_on_item_id"
1010
1069
  end
@@ -1019,15 +1078,34 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1019
1078
  t.index ["event_id"], name: "index_participates_on_event_id"
1020
1079
  end
1021
1080
 
1022
- create_table "picture_files", id: :serial, force: :cascade do |t|
1081
+ create_table "periodical_and_manifestations", force: :cascade do |t|
1082
+ t.bigint "periodical_id", null: false
1083
+ t.bigint "manifestation_id", null: false
1084
+ t.boolean "periodical_master", default: false, null: false
1085
+ t.datetime "created_at", null: false
1086
+ t.datetime "updated_at", null: false
1087
+ t.index ["manifestation_id"], name: "index_periodical_and_manifestations_on_manifestation_id"
1088
+ t.index ["periodical_id"], name: "index_periodical_and_manifestations_on_periodical_id"
1089
+ t.index ["periodical_master"], name: "index_periodical_and_manifestations_on_periodical_master", unique: true, where: "(periodical_master IS TRUE)"
1090
+ end
1091
+
1092
+ create_table "periodicals", force: :cascade do |t|
1093
+ t.text "original_title", null: false
1094
+ t.bigint "frequency_id", null: false
1095
+ t.datetime "created_at", null: false
1096
+ t.datetime "updated_at", null: false
1097
+ t.index ["frequency_id"], name: "index_periodicals_on_frequency_id"
1098
+ end
1099
+
1100
+ create_table "picture_files", force: :cascade do |t|
1023
1101
  t.integer "picture_attachable_id"
1024
1102
  t.string "picture_attachable_type"
1025
1103
  t.string "content_type"
1026
1104
  t.text "title"
1027
1105
  t.string "thumbnail"
1028
1106
  t.integer "position"
1029
- t.datetime "created_at"
1030
- t.datetime "updated_at"
1107
+ t.datetime "created_at", null: false
1108
+ t.datetime "updated_at", null: false
1031
1109
  t.string "picture_file_name"
1032
1110
  t.string "picture_content_type"
1033
1111
  t.integer "picture_file_size"
@@ -1039,39 +1117,39 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1039
1117
  t.index ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
1040
1118
  end
1041
1119
 
1042
- create_table "produce_types", id: :serial, force: :cascade do |t|
1120
+ create_table "produce_types", force: :cascade do |t|
1043
1121
  t.string "name"
1044
1122
  t.text "display_name"
1045
1123
  t.text "note"
1046
1124
  t.integer "position"
1047
- t.datetime "created_at"
1048
- t.datetime "updated_at"
1125
+ t.datetime "created_at", null: false
1126
+ t.datetime "updated_at", null: false
1049
1127
  t.jsonb "display_name_translations", default: {}, null: false
1050
1128
  end
1051
1129
 
1052
- create_table "produces", id: :serial, force: :cascade do |t|
1053
- t.integer "agent_id", null: false
1054
- t.integer "manifestation_id", null: false
1130
+ create_table "produces", force: :cascade do |t|
1131
+ t.bigint "agent_id", null: false
1132
+ t.bigint "manifestation_id", null: false
1055
1133
  t.integer "position"
1056
- t.datetime "created_at"
1057
- t.datetime "updated_at"
1134
+ t.datetime "created_at", null: false
1135
+ t.datetime "updated_at", null: false
1058
1136
  t.integer "produce_type_id"
1059
1137
  t.index ["agent_id"], name: "index_produces_on_agent_id"
1060
1138
  t.index ["manifestation_id"], name: "index_produces_on_manifestation_id"
1061
1139
  end
1062
1140
 
1063
- create_table "profiles", id: :serial, force: :cascade do |t|
1064
- t.integer "user_id"
1065
- t.integer "user_group_id"
1066
- t.integer "library_id"
1141
+ create_table "profiles", force: :cascade do |t|
1142
+ t.bigint "user_id"
1143
+ t.bigint "user_group_id"
1144
+ t.bigint "library_id"
1067
1145
  t.string "locale"
1068
1146
  t.string "user_number"
1069
1147
  t.text "full_name"
1070
1148
  t.text "note"
1071
1149
  t.text "keyword_list"
1072
- t.integer "required_role_id"
1073
- t.datetime "created_at"
1074
- t.datetime "updated_at"
1150
+ t.bigint "required_role_id"
1151
+ t.datetime "created_at", null: false
1152
+ t.datetime "updated_at", null: false
1075
1153
  t.string "checkout_icalendar_token"
1076
1154
  t.boolean "save_checkout_history", default: false, null: false
1077
1155
  t.datetime "expired_at"
@@ -1086,44 +1164,44 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1086
1164
  t.index ["user_number"], name: "index_profiles_on_user_number", unique: true
1087
1165
  end
1088
1166
 
1089
- create_table "realize_types", id: :serial, force: :cascade do |t|
1167
+ create_table "realize_types", force: :cascade do |t|
1090
1168
  t.string "name"
1091
1169
  t.text "display_name"
1092
1170
  t.text "note"
1093
1171
  t.integer "position"
1094
- t.datetime "created_at"
1095
- t.datetime "updated_at"
1172
+ t.datetime "created_at", null: false
1173
+ t.datetime "updated_at", null: false
1096
1174
  t.jsonb "display_name_translations", default: {}, null: false
1097
1175
  end
1098
1176
 
1099
- create_table "realizes", id: :serial, force: :cascade do |t|
1100
- t.integer "agent_id", null: false
1101
- t.integer "expression_id", null: false
1177
+ create_table "realizes", force: :cascade do |t|
1178
+ t.bigint "agent_id", null: false
1179
+ t.bigint "expression_id", null: false
1102
1180
  t.integer "position"
1103
- t.datetime "created_at"
1104
- t.datetime "updated_at"
1181
+ t.datetime "created_at", null: false
1182
+ t.datetime "updated_at", null: false
1105
1183
  t.integer "realize_type_id"
1106
1184
  t.index ["agent_id"], name: "index_realizes_on_agent_id"
1107
1185
  t.index ["expression_id"], name: "index_realizes_on_expression_id"
1108
1186
  end
1109
1187
 
1110
- create_table "request_status_types", id: :serial, force: :cascade do |t|
1188
+ create_table "request_status_types", force: :cascade do |t|
1111
1189
  t.string "name", null: false
1112
1190
  t.text "display_name"
1113
1191
  t.text "note"
1114
1192
  t.integer "position"
1115
- t.datetime "created_at"
1116
- t.datetime "updated_at"
1193
+ t.datetime "created_at", null: false
1194
+ t.datetime "updated_at", null: false
1117
1195
  t.jsonb "display_name_translations", default: {}, null: false
1118
1196
  end
1119
1197
 
1120
- create_table "request_types", id: :serial, force: :cascade do |t|
1198
+ create_table "request_types", force: :cascade do |t|
1121
1199
  t.string "name", null: false
1122
1200
  t.text "display_name"
1123
1201
  t.text "note"
1124
1202
  t.integer "position"
1125
- t.datetime "created_at"
1126
- t.datetime "updated_at"
1203
+ t.datetime "created_at", null: false
1204
+ t.datetime "updated_at", null: false
1127
1205
  t.jsonb "display_name_translations", default: {}, null: false
1128
1206
  end
1129
1207
 
@@ -1180,44 +1258,44 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1180
1258
  t.index ["user_id"], name: "index_reserves_on_user_id"
1181
1259
  end
1182
1260
 
1183
- create_table "resource_export_file_transitions", id: :serial, force: :cascade do |t|
1261
+ create_table "resource_export_file_transitions", force: :cascade do |t|
1184
1262
  t.string "to_state"
1185
1263
  t.text "metadata", default: "{}"
1186
1264
  t.integer "sort_key"
1187
1265
  t.integer "resource_export_file_id"
1188
- t.datetime "created_at"
1189
- t.datetime "updated_at"
1266
+ t.datetime "created_at", null: false
1267
+ t.datetime "updated_at", null: false
1190
1268
  t.boolean "most_recent", null: false
1191
1269
  t.index ["resource_export_file_id", "most_recent"], name: "index_resource_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1192
1270
  t.index ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
1193
1271
  t.index ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
1194
1272
  end
1195
1273
 
1196
- create_table "resource_export_files", id: :serial, force: :cascade do |t|
1274
+ create_table "resource_export_files", force: :cascade do |t|
1197
1275
  t.integer "user_id"
1198
1276
  t.string "resource_export_file_name"
1199
1277
  t.string "resource_export_content_type"
1200
1278
  t.bigint "resource_export_file_size"
1201
1279
  t.datetime "resource_export_updated_at"
1202
1280
  t.datetime "executed_at"
1203
- t.datetime "created_at"
1204
- t.datetime "updated_at"
1281
+ t.datetime "created_at", null: false
1282
+ t.datetime "updated_at", null: false
1205
1283
  end
1206
1284
 
1207
- create_table "resource_import_file_transitions", id: :serial, force: :cascade do |t|
1285
+ create_table "resource_import_file_transitions", force: :cascade do |t|
1208
1286
  t.string "to_state"
1209
1287
  t.text "metadata", default: "{}"
1210
1288
  t.integer "sort_key"
1211
1289
  t.integer "resource_import_file_id"
1212
- t.datetime "created_at"
1213
- t.datetime "updated_at"
1290
+ t.datetime "created_at", null: false
1291
+ t.datetime "updated_at", null: false
1214
1292
  t.boolean "most_recent", null: false
1215
1293
  t.index ["resource_import_file_id", "most_recent"], name: "index_resource_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1216
1294
  t.index ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
1217
1295
  t.index ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
1218
1296
  end
1219
1297
 
1220
- create_table "resource_import_files", id: :serial, force: :cascade do |t|
1298
+ create_table "resource_import_files", force: :cascade do |t|
1221
1299
  t.integer "parent_id"
1222
1300
  t.string "content_type"
1223
1301
  t.integer "size"
@@ -1228,8 +1306,8 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1228
1306
  t.string "resource_import_content_type"
1229
1307
  t.integer "resource_import_file_size"
1230
1308
  t.datetime "resource_import_updated_at"
1231
- t.datetime "created_at"
1232
- t.datetime "updated_at"
1309
+ t.datetime "created_at", null: false
1310
+ t.datetime "updated_at", null: false
1233
1311
  t.string "edit_mode"
1234
1312
  t.string "resource_import_fingerprint"
1235
1313
  t.text "error_message"
@@ -1239,20 +1317,20 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1239
1317
  t.index ["user_id"], name: "index_resource_import_files_on_user_id"
1240
1318
  end
1241
1319
 
1242
- create_table "resource_import_results", id: :serial, force: :cascade do |t|
1320
+ create_table "resource_import_results", force: :cascade do |t|
1243
1321
  t.integer "resource_import_file_id"
1244
1322
  t.integer "manifestation_id"
1245
1323
  t.integer "item_id"
1246
1324
  t.text "body"
1247
- t.datetime "created_at"
1248
- t.datetime "updated_at"
1325
+ t.datetime "created_at", null: false
1326
+ t.datetime "updated_at", null: false
1249
1327
  t.text "error_message"
1250
1328
  t.index ["item_id"], name: "index_resource_import_results_on_item_id"
1251
1329
  t.index ["manifestation_id"], name: "index_resource_import_results_on_manifestation_id"
1252
1330
  t.index ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
1253
1331
  end
1254
1332
 
1255
- create_table "roles", id: :serial, force: :cascade do |t|
1333
+ create_table "roles", force: :cascade do |t|
1256
1334
  t.string "name", null: false
1257
1335
  t.string "display_name"
1258
1336
  t.text "note"
@@ -1263,7 +1341,7 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1263
1341
  t.jsonb "display_name_translations", default: {}, null: false
1264
1342
  end
1265
1343
 
1266
- create_table "search_engines", id: :serial, force: :cascade do |t|
1344
+ create_table "search_engines", force: :cascade do |t|
1267
1345
  t.string "name", null: false
1268
1346
  t.text "display_name"
1269
1347
  t.string "url", null: false
@@ -1273,34 +1351,34 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1273
1351
  t.text "additional_param"
1274
1352
  t.text "note"
1275
1353
  t.integer "position"
1276
- t.datetime "created_at"
1277
- t.datetime "updated_at"
1354
+ t.datetime "created_at", null: false
1355
+ t.datetime "updated_at", null: false
1278
1356
  t.jsonb "display_name_translations", default: {}, null: false
1279
1357
  end
1280
1358
 
1281
- create_table "series_statement_merge_lists", id: :serial, force: :cascade do |t|
1359
+ create_table "series_statement_merge_lists", force: :cascade do |t|
1282
1360
  t.string "title"
1283
- t.datetime "created_at"
1284
- t.datetime "updated_at"
1361
+ t.datetime "created_at", null: false
1362
+ t.datetime "updated_at", null: false
1285
1363
  end
1286
1364
 
1287
- create_table "series_statement_merges", id: :serial, force: :cascade do |t|
1365
+ create_table "series_statement_merges", force: :cascade do |t|
1288
1366
  t.integer "series_statement_id", null: false
1289
1367
  t.integer "series_statement_merge_list_id", null: false
1290
- t.datetime "created_at"
1291
- t.datetime "updated_at"
1368
+ t.datetime "created_at", null: false
1369
+ t.datetime "updated_at", null: false
1292
1370
  t.index ["series_statement_id"], name: "index_series_statement_merges_on_series_statement_id"
1293
1371
  t.index ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
1294
1372
  end
1295
1373
 
1296
- create_table "series_statements", id: :serial, force: :cascade do |t|
1374
+ create_table "series_statements", force: :cascade do |t|
1297
1375
  t.text "original_title"
1298
1376
  t.text "numbering"
1299
1377
  t.text "title_subseries"
1300
1378
  t.text "numbering_subseries"
1301
1379
  t.integer "position"
1302
- t.datetime "created_at"
1303
- t.datetime "updated_at"
1380
+ t.datetime "created_at", null: false
1381
+ t.datetime "updated_at", null: false
1304
1382
  t.text "title_transcription"
1305
1383
  t.text "title_alternative"
1306
1384
  t.string "series_statement_identifier"
@@ -1317,16 +1395,15 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1317
1395
  t.index ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
1318
1396
  end
1319
1397
 
1320
- create_table "shelves", id: :serial, force: :cascade do |t|
1398
+ create_table "shelves", force: :cascade do |t|
1321
1399
  t.string "name", null: false
1322
1400
  t.text "display_name"
1323
1401
  t.text "note"
1324
- t.integer "library_id", null: false
1402
+ t.bigint "library_id", null: false
1325
1403
  t.integer "items_count", default: 0, null: false
1326
1404
  t.integer "position"
1327
- t.datetime "created_at"
1328
- t.datetime "updated_at"
1329
- t.datetime "deleted_at"
1405
+ t.datetime "created_at", null: false
1406
+ t.datetime "updated_at", null: false
1330
1407
  t.boolean "closed", default: false, null: false
1331
1408
  t.jsonb "display_name_translations", default: {}, null: false
1332
1409
  t.index ["library_id"], name: "index_shelves_on_library_id"
@@ -1374,26 +1451,25 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1374
1451
  t.index ["use_term_id"], name: "index_subjects_on_use_term_id"
1375
1452
  end
1376
1453
 
1377
- create_table "subscribes", id: :serial, force: :cascade do |t|
1378
- t.integer "subscription_id", null: false
1454
+ create_table "subscribes", force: :cascade do |t|
1455
+ t.bigint "subscription_id", null: false
1379
1456
  t.integer "work_id", null: false
1380
1457
  t.datetime "start_at", null: false
1381
1458
  t.datetime "end_at", null: false
1382
- t.datetime "created_at"
1383
- t.datetime "updated_at"
1459
+ t.datetime "created_at", null: false
1460
+ t.datetime "updated_at", null: false
1384
1461
  t.index ["subscription_id"], name: "index_subscribes_on_subscription_id"
1385
1462
  t.index ["work_id"], name: "index_subscribes_on_work_id"
1386
1463
  end
1387
1464
 
1388
- create_table "subscriptions", id: :serial, force: :cascade do |t|
1465
+ create_table "subscriptions", force: :cascade do |t|
1389
1466
  t.text "title", null: false
1390
1467
  t.text "note"
1391
- t.integer "user_id"
1392
- t.integer "order_list_id"
1393
- t.datetime "deleted_at"
1468
+ t.bigint "user_id"
1469
+ t.bigint "order_list_id"
1394
1470
  t.integer "subscribes_count", default: 0, null: false
1395
- t.datetime "created_at"
1396
- t.datetime "updated_at"
1471
+ t.datetime "created_at", null: false
1472
+ t.datetime "updated_at", null: false
1397
1473
  t.index ["order_list_id"], name: "index_subscriptions_on_order_list_id"
1398
1474
  t.index ["user_id"], name: "index_subscriptions_on_user_id"
1399
1475
  end
@@ -1449,13 +1525,13 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1449
1525
  t.index ["user_id"], name: "index_user_checkout_stats_on_user_id"
1450
1526
  end
1451
1527
 
1452
- create_table "user_export_file_transitions", id: :serial, force: :cascade do |t|
1528
+ create_table "user_export_file_transitions", force: :cascade do |t|
1453
1529
  t.string "to_state"
1454
1530
  t.text "metadata", default: "{}"
1455
1531
  t.integer "sort_key"
1456
- t.integer "user_export_file_id"
1457
- t.datetime "created_at"
1458
- t.datetime "updated_at"
1532
+ t.bigint "user_export_file_id"
1533
+ t.datetime "created_at", null: false
1534
+ t.datetime "updated_at", null: false
1459
1535
  t.boolean "most_recent", null: false
1460
1536
  t.index ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
1461
1537
  t.index ["user_export_file_id", "most_recent"], name: "index_user_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
@@ -1463,15 +1539,15 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1463
1539
  t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
1464
1540
  end
1465
1541
 
1466
- create_table "user_export_files", id: :serial, force: :cascade do |t|
1467
- t.integer "user_id"
1542
+ create_table "user_export_files", force: :cascade do |t|
1543
+ t.bigint "user_id"
1468
1544
  t.string "user_export_file_name"
1469
1545
  t.string "user_export_content_type"
1470
1546
  t.bigint "user_export_file_size"
1471
1547
  t.datetime "user_export_updated_at"
1472
1548
  t.datetime "executed_at"
1473
- t.datetime "created_at"
1474
- t.datetime "updated_at"
1549
+ t.datetime "created_at", null: false
1550
+ t.datetime "updated_at", null: false
1475
1551
  t.index ["user_id"], name: "index_user_export_files_on_user_id"
1476
1552
  end
1477
1553
 
@@ -1494,14 +1570,13 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1494
1570
  t.index ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1495
1571
  end
1496
1572
 
1497
- create_table "user_groups", id: :serial, force: :cascade do |t|
1573
+ create_table "user_groups", force: :cascade do |t|
1498
1574
  t.string "name"
1499
1575
  t.text "display_name"
1500
1576
  t.text "note"
1501
1577
  t.integer "position"
1502
- t.datetime "created_at"
1503
- t.datetime "updated_at"
1504
- t.datetime "deleted_at"
1578
+ t.datetime "created_at", null: false
1579
+ t.datetime "updated_at", null: false
1505
1580
  t.integer "valid_period_for_new_user", default: 0, null: false
1506
1581
  t.datetime "expired_at"
1507
1582
  t.integer "number_of_day_to_notify_overdue", default: 1, null: false
@@ -1510,30 +1585,30 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1510
1585
  t.jsonb "display_name_translations", default: {}, null: false
1511
1586
  end
1512
1587
 
1513
- create_table "user_has_roles", id: :serial, force: :cascade do |t|
1514
- t.integer "user_id", null: false
1515
- t.integer "role_id", null: false
1516
- t.datetime "created_at"
1517
- t.datetime "updated_at"
1588
+ create_table "user_has_roles", force: :cascade do |t|
1589
+ t.bigint "user_id", null: false
1590
+ t.bigint "role_id", null: false
1591
+ t.datetime "created_at", null: false
1592
+ t.datetime "updated_at", null: false
1518
1593
  t.index ["role_id"], name: "index_user_has_roles_on_role_id"
1519
1594
  t.index ["user_id"], name: "index_user_has_roles_on_user_id"
1520
1595
  end
1521
1596
 
1522
- create_table "user_import_file_transitions", id: :serial, force: :cascade do |t|
1597
+ create_table "user_import_file_transitions", force: :cascade do |t|
1523
1598
  t.string "to_state"
1524
1599
  t.text "metadata", default: "{}"
1525
1600
  t.integer "sort_key"
1526
- t.integer "user_import_file_id"
1527
- t.datetime "created_at"
1528
- t.datetime "updated_at"
1601
+ t.bigint "user_import_file_id"
1602
+ t.datetime "created_at", null: false
1603
+ t.datetime "updated_at", null: false
1529
1604
  t.boolean "most_recent", null: false
1530
1605
  t.index ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
1531
1606
  t.index ["user_import_file_id", "most_recent"], name: "index_user_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1532
1607
  t.index ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
1533
1608
  end
1534
1609
 
1535
- create_table "user_import_files", id: :serial, force: :cascade do |t|
1536
- t.integer "user_id"
1610
+ create_table "user_import_files", force: :cascade do |t|
1611
+ t.bigint "user_id"
1537
1612
  t.text "note"
1538
1613
  t.datetime "executed_at"
1539
1614
  t.string "user_import_file_name"
@@ -1543,20 +1618,22 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1543
1618
  t.string "user_import_fingerprint"
1544
1619
  t.string "edit_mode"
1545
1620
  t.text "error_message"
1546
- t.datetime "created_at"
1547
- t.datetime "updated_at"
1621
+ t.datetime "created_at", null: false
1622
+ t.datetime "updated_at", null: false
1548
1623
  t.string "user_encoding"
1549
- t.integer "default_library_id"
1550
- t.integer "default_user_group_id"
1624
+ t.bigint "default_library_id"
1625
+ t.bigint "default_user_group_id"
1626
+ t.index ["default_library_id"], name: "index_user_import_files_on_default_library_id"
1627
+ t.index ["default_user_group_id"], name: "index_user_import_files_on_default_user_group_id"
1551
1628
  t.index ["user_id"], name: "index_user_import_files_on_user_id"
1552
1629
  end
1553
1630
 
1554
- create_table "user_import_results", id: :serial, force: :cascade do |t|
1555
- t.integer "user_import_file_id"
1556
- t.integer "user_id"
1631
+ create_table "user_import_results", force: :cascade do |t|
1632
+ t.bigint "user_import_file_id"
1633
+ t.bigint "user_id"
1557
1634
  t.text "body"
1558
- t.datetime "created_at"
1559
- t.datetime "updated_at"
1635
+ t.datetime "created_at", null: false
1636
+ t.datetime "updated_at", null: false
1560
1637
  t.text "error_message"
1561
1638
  t.index ["user_id"], name: "index_user_import_results_on_user_id"
1562
1639
  t.index ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
@@ -1601,7 +1678,6 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1601
1678
  t.boolean "save_checkout_history", default: false, null: false
1602
1679
  t.string "checkout_icalendar_token"
1603
1680
  t.string "username"
1604
- t.datetime "deleted_at"
1605
1681
  t.datetime "expired_at"
1606
1682
  t.integer "failed_attempts", default: 0
1607
1683
  t.string "unlock_token"
@@ -1626,10 +1702,10 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1626
1702
  t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
1627
1703
  end
1628
1704
 
1629
- create_table "withdraws", id: :serial, force: :cascade do |t|
1630
- t.integer "basket_id"
1631
- t.integer "item_id"
1632
- t.integer "librarian_id"
1705
+ create_table "withdraws", force: :cascade do |t|
1706
+ t.bigint "basket_id"
1707
+ t.bigint "item_id"
1708
+ t.bigint "librarian_id"
1633
1709
  t.datetime "created_at", null: false
1634
1710
  t.datetime "updated_at", null: false
1635
1711
  t.index ["basket_id"], name: "index_withdraws_on_basket_id"
@@ -1637,12 +1713,20 @@ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
1637
1713
  t.index ["librarian_id"], name: "index_withdraws_on_librarian_id"
1638
1714
  end
1639
1715
 
1716
+ add_foreign_key "doi_records", "manifestations"
1717
+ add_foreign_key "isbn_record_and_manifestations", "isbn_records"
1718
+ add_foreign_key "isbn_record_and_manifestations", "manifestations"
1719
+ add_foreign_key "issn_record_and_manifestations", "issn_records"
1720
+ add_foreign_key "issn_record_and_manifestations", "manifestations"
1640
1721
  add_foreign_key "items", "manifestations"
1641
1722
  add_foreign_key "jpno_records", "manifestations"
1642
1723
  add_foreign_key "libraries", "library_groups"
1643
1724
  add_foreign_key "library_groups", "users"
1644
1725
  add_foreign_key "ndl_bib_id_records", "manifestations"
1645
1726
  add_foreign_key "ndla_records", "agents"
1727
+ add_foreign_key "periodical_and_manifestations", "manifestations"
1728
+ add_foreign_key "periodical_and_manifestations", "periodicals"
1729
+ add_foreign_key "periodicals", "frequencies"
1646
1730
  add_foreign_key "profiles", "users"
1647
1731
  add_foreign_key "user_has_roles", "roles"
1648
1732
  add_foreign_key "user_has_roles", "users"