enju_seed 0.2.3 → 0.3.0.beta.1

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