enju_ndl 0.3.0 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +14 -0
  3. data/Rakefile +1 -1
  4. data/app/models/ndl_book.rb +11 -3
  5. data/app/views/ndl_books/index.html.erb +1 -1
  6. data/lib/enju_ndl/crd.rb +1 -1
  7. data/lib/enju_ndl/engine.rb +1 -1
  8. data/lib/enju_ndl/ndl_search.rb +9 -9
  9. data/lib/enju_ndl/version.rb +1 -1
  10. data/lib/enju_ndl.rb +0 -2
  11. data/spec/cassette_library/ImportRequest/should_import_a_foreign_book.yml +121 -0
  12. data/spec/cassette_library/ImportRequest/should_import_isbn.yml +49 -492
  13. data/spec/cassette_library/Manifestation/should_import_a_bibliographic_record.yml +121 -0
  14. data/spec/cassette_library/Manifestation/should_import_dcterms_issued.yml +121 -0
  15. data/spec/cassette_library/Manifestation/should_import_isbn.yml +52 -495
  16. data/spec/cassette_library/Manifestation/should_import_series_statement.yml +48 -1121
  17. data/spec/cassette_library/Manifestation/should_import_with_ndl_bib_id.yml +20 -23
  18. data/spec/cassette_library/NdlBook/import/should_get_author_IDs_from_NDLA.yml +62 -0
  19. data/spec/cassette_library/NdlBook/import/should_get_series_title.yml +24 -111
  20. data/spec/cassette_library/NdlBook/import/should_get_subject_IDs_from_NDLA.yml +62 -0
  21. data/spec/cassette_library/NdlBook/import/should_get_volume_number.yml +28 -92
  22. data/spec/cassette_library/NdlBook/import/should_import_audio_cd.yml +26 -126
  23. data/spec/cassette_library/NdlBook/import/should_import_bibliographic_record.yml +28 -166
  24. data/spec/cassette_library/NdlBook/import/should_import_bibliographic_record_that_does_not_have_any_classifications.yml +25 -155
  25. data/spec/cassette_library/NdlBook/import/should_import_edition.yml +25 -154
  26. data/spec/cassette_library/NdlBook/import/should_import_even_with_invalid_url.yml +25 -137
  27. data/spec/cassette_library/NdlBook/import/should_import_map.yml +25 -140
  28. data/spec/cassette_library/NdlBook/import/should_import_ndc8_classification.yml +26 -214
  29. data/spec/cassette_library/NdlBook/import/should_import_notated_music.yml +27 -125
  30. data/spec/cassette_library/NdlBook/import/should_import_painting.yml +26 -114
  31. data/spec/cassette_library/NdlBook/import/should_import_photograph.yml +26 -116
  32. data/spec/cassette_library/NdlBook/import/should_import_picture_postcard.yml +26 -136
  33. data/spec/cassette_library/NdlBook/import/should_import_publication_place.yml +28 -192
  34. data/spec/cassette_library/NdlBook/import/should_import_pud_date_is_nil.yml +25 -107
  35. data/spec/cassette_library/NdlBook/import/should_import_series_statement.yml +27 -194
  36. data/spec/cassette_library/NdlBook/import/should_import_series_statement_if_the_resource_is_serial.yml +24 -216
  37. data/spec/cassette_library/NdlBook/import/should_import_series_statement_s_creator.yml +27 -241
  38. data/spec/cassette_library/NdlBook/import/should_import_series_statement_transctiption.yml +27 -207
  39. data/spec/cassette_library/NdlBook/import/should_import_still_image.yml +26 -133
  40. data/spec/cassette_library/NdlBook/import/should_import_tactile_text.yml +28 -121
  41. data/spec/cassette_library/NdlBook/import/should_import_title_alternative.yml +27 -200
  42. data/spec/cassette_library/NdlBook/import/should_import_url_contain_whitespace.yml +24 -177
  43. data/spec/cassette_library/NdlBook/import/should_import_video_dvd.yml +25 -111
  44. data/spec/cassette_library/NdlBook/import/should_import_volume_number_string.yml +24 -193
  45. data/spec/cassette_library/NdlBook/import/should_import_volume_title.yml +25 -145
  46. data/spec/cassette_library/NdlBook/import/should_import_with_DDC_Fic_.yml +21 -24
  47. data/spec/cassette_library/NdlBook/import/should_not_get_series_title_if_book_has_not_series_title.yml +26 -124
  48. data/spec/cassette_library/NdlBook/import/should_not_get_volume_number_if_book_has_not_volume.yml +24 -105
  49. data/spec/cassette_library/NdlBook/search/should_not_distinguish_double_byte_space_from_one-byte_space_in_a_query.yml +53 -785
  50. data/spec/cassette_library/NdlBook/search/should_search_bibliographic_record.yml +26 -386
  51. data/spec/cassette_library/NdlBooksController/GET_index/should_get_index.yml +24 -463
  52. data/spec/cassette_library/NdlBooksController/POST_create/should_create_a_bibliographic_record_if_jpno_is_set.yml +24 -213
  53. data/spec/cassette_library/NdlBooksController/POST_create/should_create_a_serial_record.yml +28 -143
  54. data/spec/cassette_library/NdlBooksController/POST_create/should_not_create_a_bibliographic_record_if_jpno_is_not_set.yml +27 -22
  55. data/spec/cassette_library/Question/should_respond_to_search_crd.yml +12 -220
  56. data/spec/cassette_library/ndl_books/index/ndl_search_menu/should_reflect_query_params_for_views.yml +24 -384
  57. data/spec/dummy/app/models/application_record.rb +3 -0
  58. data/spec/dummy/app/models/user.rb +1 -1
  59. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +5 -0
  60. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +5 -0
  61. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +12 -0
  62. data/spec/dummy/db/schema.rb +930 -1003
  63. data/spec/models/import_request_spec.rb +4 -0
  64. data/spec/models/manifestation_spec.rb +9 -1
  65. data/spec/models/ndl_book_spec.rb +20 -5
  66. data/spec/views/ndl_books/index.html.erb_spec.rb +1 -1
  67. metadata +454 -329
  68. data/README.rdoc +0 -10
  69. data/spec/cassette_library/Manifestation/should_imporrt_a_bibliographic_record.yml +0 -1211
  70. data/spec/dummy/config/initializers/session_store.rb +0 -8
@@ -1,5 +1,3 @@
1
- # encoding: UTF-8
2
-
3
1
  # This file is auto-generated from the current state of the database. Instead
4
2
  # of editing this file, please use the migrations feature of Active Record to
5
3
  # incrementally modify your database, and then regenerate this schema definition.
@@ -12,479 +10,465 @@
12
10
  #
13
11
  # It's strongly recommended that you check this file into your version control system.
14
12
 
15
- ActiveRecord::Schema.define(version: 20180107161410) do
13
+ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
16
14
 
17
15
  create_table "accepts", force: :cascade do |t|
18
- t.integer "basket_id"
19
- t.integer "item_id"
20
- t.integer "librarian_id"
16
+ t.integer "basket_id"
17
+ t.integer "item_id"
18
+ t.integer "librarian_id"
21
19
  t.datetime "created_at"
22
20
  t.datetime "updated_at"
21
+ t.index ["basket_id"], name: "index_accepts_on_basket_id"
22
+ t.index ["item_id"], name: "index_accepts_on_item_id"
23
+ t.index ["librarian_id"], name: "index_accepts_on_librarian_id"
23
24
  end
24
25
 
25
- add_index "accepts", ["basket_id"], name: "index_accepts_on_basket_id"
26
- add_index "accepts", ["item_id"], name: "index_accepts_on_item_id"
27
- add_index "accepts", ["librarian_id"], name: "index_accepts_on_librarian_id"
28
-
29
26
  create_table "agent_import_file_transitions", force: :cascade do |t|
30
- t.string "to_state"
31
- t.text "metadata", default: "{}"
32
- t.integer "sort_key"
33
- t.integer "agent_import_file_id"
27
+ t.string "to_state"
28
+ t.text "metadata", default: "{}"
29
+ t.integer "sort_key"
30
+ t.integer "agent_import_file_id"
34
31
  t.datetime "created_at"
35
32
  t.datetime "updated_at"
36
- t.boolean "most_recent", null: false
33
+ t.boolean "most_recent", null: false
34
+ t.index ["agent_import_file_id", "most_recent"], name: "index_agent_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
35
+ t.index ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
36
+ t.index ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
37
37
  end
38
38
 
39
- add_index "agent_import_file_transitions", ["agent_import_file_id", "most_recent"], name: "index_agent_import_file_transitions_parent_most_recent", unique: true
40
- add_index "agent_import_file_transitions", ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
41
- 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
42
-
43
39
  create_table "agent_import_files", force: :cascade do |t|
44
- t.integer "parent_id"
45
- t.string "content_type"
46
- t.integer "size"
47
- t.integer "user_id"
48
- t.text "note"
40
+ t.integer "parent_id"
41
+ t.string "content_type"
42
+ t.integer "size"
43
+ t.integer "user_id"
44
+ t.text "note"
49
45
  t.datetime "executed_at"
50
- t.string "agent_import_file_name"
51
- t.string "agent_import_content_type"
52
- t.integer "agent_import_file_size"
46
+ t.string "agent_import_file_name"
47
+ t.string "agent_import_content_type"
48
+ t.integer "agent_import_file_size"
53
49
  t.datetime "agent_import_updated_at"
54
50
  t.datetime "created_at"
55
51
  t.datetime "updated_at"
56
- t.string "agent_import_fingerprint"
57
- t.text "error_message"
58
- t.string "edit_mode"
59
- t.string "user_encoding"
52
+ t.string "agent_import_fingerprint"
53
+ t.text "error_message"
54
+ t.string "edit_mode"
55
+ t.string "user_encoding"
56
+ t.index ["parent_id"], name: "index_agent_import_files_on_parent_id"
57
+ t.index ["user_id"], name: "index_agent_import_files_on_user_id"
60
58
  end
61
59
 
62
- add_index "agent_import_files", ["parent_id"], name: "index_agent_import_files_on_parent_id"
63
- add_index "agent_import_files", ["user_id"], name: "index_agent_import_files_on_user_id"
64
-
65
60
  create_table "agent_import_results", force: :cascade do |t|
66
- t.integer "agent_import_file_id"
67
- t.integer "agent_id"
68
- t.text "body"
61
+ t.integer "agent_import_file_id"
62
+ t.integer "agent_id"
63
+ t.text "body"
69
64
  t.datetime "created_at"
70
65
  t.datetime "updated_at"
71
66
  end
72
67
 
73
68
  create_table "agent_merge_lists", force: :cascade do |t|
74
- t.string "title"
69
+ t.string "title"
75
70
  t.datetime "created_at"
76
71
  t.datetime "updated_at"
77
72
  end
78
73
 
79
74
  create_table "agent_merges", force: :cascade do |t|
80
- t.integer "agent_id", null: false
81
- t.integer "agent_merge_list_id", null: false
75
+ t.integer "agent_id", null: false
76
+ t.integer "agent_merge_list_id", null: false
82
77
  t.datetime "created_at"
83
78
  t.datetime "updated_at"
79
+ t.index ["agent_id"], name: "index_agent_merges_on_agent_id"
80
+ t.index ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
84
81
  end
85
82
 
86
- add_index "agent_merges", ["agent_id"], name: "index_agent_merges_on_agent_id"
87
- add_index "agent_merges", ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
88
-
89
83
  create_table "agent_relationship_types", force: :cascade do |t|
90
- t.string "name", null: false
91
- t.text "display_name"
92
- t.text "note"
93
- t.integer "position"
84
+ t.string "name", null: false
85
+ t.text "display_name"
86
+ t.text "note"
87
+ t.integer "position"
94
88
  t.datetime "created_at"
95
89
  t.datetime "updated_at"
96
90
  end
97
91
 
98
92
  create_table "agent_relationships", force: :cascade do |t|
99
- t.integer "parent_id"
100
- t.integer "child_id"
101
- t.integer "agent_relationship_type_id"
93
+ t.integer "parent_id"
94
+ t.integer "child_id"
95
+ t.integer "agent_relationship_type_id"
102
96
  t.datetime "created_at"
103
97
  t.datetime "updated_at"
104
- t.integer "position"
98
+ t.integer "position"
99
+ t.index ["child_id"], name: "index_agent_relationships_on_child_id"
100
+ t.index ["parent_id"], name: "index_agent_relationships_on_parent_id"
105
101
  end
106
102
 
107
- add_index "agent_relationships", ["child_id"], name: "index_agent_relationships_on_child_id"
108
- add_index "agent_relationships", ["parent_id"], name: "index_agent_relationships_on_parent_id"
109
-
110
103
  create_table "agent_types", force: :cascade do |t|
111
- t.string "name", null: false
112
- t.text "display_name"
113
- t.text "note"
114
- t.integer "position"
104
+ t.string "name", null: false
105
+ t.text "display_name"
106
+ t.text "note"
107
+ t.integer "position"
115
108
  t.datetime "created_at"
116
109
  t.datetime "updated_at"
117
110
  end
118
111
 
119
112
  create_table "agents", force: :cascade do |t|
120
- t.string "last_name"
121
- t.string "middle_name"
122
- t.string "first_name"
123
- t.string "last_name_transcription"
124
- t.string "middle_name_transcription"
125
- t.string "first_name_transcription"
126
- t.string "corporate_name"
127
- t.string "corporate_name_transcription"
128
- t.string "full_name"
129
- t.text "full_name_transcription"
130
- t.text "full_name_alternative"
113
+ t.string "last_name"
114
+ t.string "middle_name"
115
+ t.string "first_name"
116
+ t.string "last_name_transcription"
117
+ t.string "middle_name_transcription"
118
+ t.string "first_name_transcription"
119
+ t.string "corporate_name"
120
+ t.string "corporate_name_transcription"
121
+ t.string "full_name"
122
+ t.text "full_name_transcription"
123
+ t.text "full_name_alternative"
131
124
  t.datetime "created_at"
132
125
  t.datetime "updated_at"
133
126
  t.datetime "deleted_at"
134
- t.string "zip_code_1"
135
- t.string "zip_code_2"
136
- t.text "address_1"
137
- t.text "address_2"
138
- t.text "address_1_note"
139
- t.text "address_2_note"
140
- t.string "telephone_number_1"
141
- t.string "telephone_number_2"
142
- t.string "fax_number_1"
143
- t.string "fax_number_2"
144
- t.text "other_designation"
145
- t.text "place"
146
- t.string "postal_code"
147
- t.text "street"
148
- t.text "locality"
149
- t.text "region"
127
+ t.string "zip_code_1"
128
+ t.string "zip_code_2"
129
+ t.text "address_1"
130
+ t.text "address_2"
131
+ t.text "address_1_note"
132
+ t.text "address_2_note"
133
+ t.string "telephone_number_1"
134
+ t.string "telephone_number_2"
135
+ t.string "fax_number_1"
136
+ t.string "fax_number_2"
137
+ t.text "other_designation"
138
+ t.text "place"
139
+ t.string "postal_code"
140
+ t.text "street"
141
+ t.text "locality"
142
+ t.text "region"
150
143
  t.datetime "date_of_birth"
151
144
  t.datetime "date_of_death"
152
- t.integer "language_id", default: 1, null: false
153
- t.integer "country_id", default: 1, null: false
154
- t.integer "agent_type_id", default: 1, null: false
155
- t.integer "lock_version", default: 0, null: false
156
- t.text "note"
157
- t.integer "required_role_id", default: 1, null: false
158
- t.integer "required_score", default: 0, null: false
159
- t.text "email"
160
- t.text "url"
161
- t.text "full_name_alternative_transcription"
162
- t.string "birth_date"
163
- t.string "death_date"
164
- t.string "agent_identifier"
165
- t.integer "profile_id"
166
- end
167
-
168
- add_index "agents", ["agent_identifier"], name: "index_agents_on_agent_identifier"
169
- add_index "agents", ["country_id"], name: "index_agents_on_country_id"
170
- add_index "agents", ["full_name"], name: "index_agents_on_full_name"
171
- add_index "agents", ["language_id"], name: "index_agents_on_language_id"
172
- add_index "agents", ["profile_id"], name: "index_agents_on_profile_id"
173
- add_index "agents", ["required_role_id"], name: "index_agents_on_required_role_id"
145
+ t.integer "language_id", default: 1, null: false
146
+ t.integer "country_id", default: 1, null: false
147
+ t.integer "agent_type_id", default: 1, null: false
148
+ t.integer "lock_version", default: 0, null: false
149
+ t.text "note"
150
+ t.integer "required_role_id", default: 1, null: false
151
+ t.integer "required_score", default: 0, null: false
152
+ t.text "email"
153
+ t.text "url"
154
+ t.text "full_name_alternative_transcription"
155
+ t.string "birth_date"
156
+ t.string "death_date"
157
+ t.string "agent_identifier"
158
+ t.integer "profile_id"
159
+ t.index ["agent_identifier"], name: "index_agents_on_agent_identifier"
160
+ t.index ["country_id"], name: "index_agents_on_country_id"
161
+ t.index ["full_name"], name: "index_agents_on_full_name"
162
+ t.index ["language_id"], name: "index_agents_on_language_id"
163
+ t.index ["profile_id"], name: "index_agents_on_profile_id"
164
+ t.index ["required_role_id"], name: "index_agents_on_required_role_id"
165
+ end
174
166
 
175
167
  create_table "baskets", force: :cascade do |t|
176
- t.integer "user_id"
177
- t.text "note"
178
- t.integer "lock_version", default: 0, null: false
168
+ t.integer "user_id"
169
+ t.text "note"
170
+ t.integer "lock_version", default: 0, null: false
179
171
  t.datetime "created_at"
180
172
  t.datetime "updated_at"
173
+ t.index ["user_id"], name: "index_baskets_on_user_id"
181
174
  end
182
175
 
183
- add_index "baskets", ["user_id"], name: "index_baskets_on_user_id"
184
-
185
176
  create_table "bookmark_stat_has_manifestations", force: :cascade do |t|
186
- t.integer "bookmark_stat_id", null: false
187
- t.integer "manifestation_id", null: false
188
- t.integer "bookmarks_count"
177
+ t.integer "bookmark_stat_id", null: false
178
+ t.integer "manifestation_id", null: false
179
+ t.integer "bookmarks_count"
189
180
  t.datetime "created_at"
190
181
  t.datetime "updated_at"
182
+ t.index ["bookmark_stat_id"], name: "index_bookmark_stat_has_manifestations_on_bookmark_stat_id"
183
+ t.index ["manifestation_id"], name: "index_bookmark_stat_has_manifestations_on_manifestation_id"
191
184
  end
192
185
 
193
- add_index "bookmark_stat_has_manifestations", ["bookmark_stat_id"], name: "index_bookmark_stat_has_manifestations_on_bookmark_stat_id"
194
- add_index "bookmark_stat_has_manifestations", ["manifestation_id"], name: "index_bookmark_stat_has_manifestations_on_manifestation_id"
195
-
196
186
  create_table "bookmark_stat_transitions", force: :cascade do |t|
197
- t.string "to_state"
198
- t.text "metadata", default: "{}"
199
- t.integer "sort_key"
200
- t.integer "bookmark_stat_id"
187
+ t.string "to_state"
188
+ t.text "metadata", default: "{}"
189
+ t.integer "sort_key"
190
+ t.integer "bookmark_stat_id"
201
191
  t.datetime "created_at"
202
192
  t.datetime "updated_at"
193
+ t.index ["bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_bookmark_stat_id"
194
+ t.index ["sort_key", "bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_sort_key_and_stat_id", unique: true
203
195
  end
204
196
 
205
- add_index "bookmark_stat_transitions", ["bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_bookmark_stat_id"
206
- add_index "bookmark_stat_transitions", ["sort_key", "bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_sort_key_and_stat_id", unique: true
207
-
208
197
  create_table "bookmark_stats", force: :cascade do |t|
209
198
  t.datetime "start_date"
210
199
  t.datetime "end_date"
211
200
  t.datetime "started_at"
212
201
  t.datetime "completed_at"
213
- t.text "note"
202
+ t.text "note"
214
203
  t.datetime "created_at"
215
204
  t.datetime "updated_at"
216
205
  end
217
206
 
218
207
  create_table "bookmarks", force: :cascade do |t|
219
- t.integer "user_id", null: false
220
- t.integer "manifestation_id"
221
- t.text "title"
222
- t.string "url"
223
- t.text "note"
224
- t.boolean "shared"
208
+ t.integer "user_id", null: false
209
+ t.integer "manifestation_id"
210
+ t.text "title"
211
+ t.string "url"
212
+ t.text "note"
213
+ t.boolean "shared"
225
214
  t.datetime "created_at"
226
215
  t.datetime "updated_at"
216
+ t.index ["manifestation_id"], name: "index_bookmarks_on_manifestation_id"
217
+ t.index ["url"], name: "index_bookmarks_on_url"
218
+ t.index ["user_id"], name: "index_bookmarks_on_user_id"
227
219
  end
228
220
 
229
- add_index "bookmarks", ["manifestation_id"], name: "index_bookmarks_on_manifestation_id"
230
- add_index "bookmarks", ["url"], name: "index_bookmarks_on_url"
231
- add_index "bookmarks", ["user_id"], name: "index_bookmarks_on_user_id"
232
-
233
221
  create_table "bookstores", force: :cascade do |t|
234
- t.text "name", null: false
235
- t.string "zip_code"
236
- t.text "address"
237
- t.text "note"
238
- t.string "telephone_number"
239
- t.string "fax_number"
240
- t.string "url"
241
- t.integer "position"
222
+ t.text "name", null: false
223
+ t.string "zip_code"
224
+ t.text "address"
225
+ t.text "note"
226
+ t.string "telephone_number"
227
+ t.string "fax_number"
228
+ t.string "url"
229
+ t.integer "position"
242
230
  t.datetime "deleted_at"
243
231
  t.datetime "created_at"
244
232
  t.datetime "updated_at"
245
233
  end
246
234
 
247
235
  create_table "budget_types", force: :cascade do |t|
248
- t.string "name"
249
- t.text "display_name"
250
- t.text "note"
251
- t.integer "position"
236
+ t.string "name"
237
+ t.text "display_name"
238
+ t.text "note"
239
+ t.integer "position"
252
240
  t.datetime "created_at"
253
241
  t.datetime "updated_at"
254
242
  end
255
243
 
256
244
  create_table "carrier_type_has_checkout_types", force: :cascade do |t|
257
- t.integer "carrier_type_id", null: false
258
- t.integer "checkout_type_id", null: false
259
- t.text "note"
260
- t.integer "position"
245
+ t.integer "carrier_type_id", null: false
246
+ t.integer "checkout_type_id", null: false
247
+ t.text "note"
248
+ t.integer "position"
261
249
  t.datetime "created_at"
262
250
  t.datetime "updated_at"
251
+ t.index ["carrier_type_id"], name: "index_carrier_type_has_checkout_types_on_m_form_id"
252
+ t.index ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
263
253
  end
264
254
 
265
- add_index "carrier_type_has_checkout_types", ["carrier_type_id"], name: "index_carrier_type_has_checkout_types_on_m_form_id"
266
- add_index "carrier_type_has_checkout_types", ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
267
-
268
255
  create_table "carrier_types", force: :cascade do |t|
269
- t.string "name", null: false
270
- t.text "display_name"
271
- t.text "note"
272
- t.integer "position"
256
+ t.string "name", null: false
257
+ t.text "display_name"
258
+ t.text "note"
259
+ t.integer "position"
273
260
  t.datetime "created_at"
274
261
  t.datetime "updated_at"
275
- t.string "attachment_file_name"
276
- t.string "attachment_content_type"
277
- t.integer "attachment_file_size"
262
+ t.string "attachment_file_name"
263
+ t.string "attachment_content_type"
264
+ t.integer "attachment_file_size"
278
265
  t.datetime "attachment_updated_at"
279
266
  end
280
267
 
281
268
  create_table "checked_items", force: :cascade do |t|
282
- t.integer "item_id", null: false
283
- t.integer "basket_id", null: false
284
- t.datetime "due_date", null: false
269
+ t.integer "item_id", null: false
270
+ t.integer "basket_id", null: false
271
+ t.datetime "due_date", null: false
285
272
  t.datetime "created_at"
286
273
  t.datetime "updated_at"
287
- t.integer "librarian_id"
274
+ t.integer "librarian_id"
275
+ t.index ["basket_id"], name: "index_checked_items_on_basket_id"
276
+ t.index ["item_id"], name: "index_checked_items_on_item_id"
288
277
  end
289
278
 
290
- add_index "checked_items", ["basket_id"], name: "index_checked_items_on_basket_id"
291
- add_index "checked_items", ["item_id"], name: "index_checked_items_on_item_id"
292
-
293
279
  create_table "checkins", force: :cascade do |t|
294
- t.integer "item_id", null: false
295
- t.integer "librarian_id"
296
- t.integer "basket_id"
280
+ t.integer "item_id", null: false
281
+ t.integer "librarian_id"
282
+ t.integer "basket_id"
297
283
  t.datetime "created_at"
298
284
  t.datetime "updated_at"
299
- t.integer "lock_version", default: 0, null: false
285
+ t.integer "lock_version", default: 0, null: false
286
+ t.index ["basket_id"], name: "index_checkins_on_basket_id"
287
+ t.index ["item_id"], name: "index_checkins_on_item_id"
288
+ t.index ["librarian_id"], name: "index_checkins_on_librarian_id"
300
289
  end
301
290
 
302
- add_index "checkins", ["basket_id"], name: "index_checkins_on_basket_id"
303
- add_index "checkins", ["item_id"], name: "index_checkins_on_item_id"
304
- add_index "checkins", ["librarian_id"], name: "index_checkins_on_librarian_id"
305
-
306
291
  create_table "checkout_stat_has_manifestations", force: :cascade do |t|
307
- t.integer "manifestation_checkout_stat_id", null: false
308
- t.integer "manifestation_id", null: false
309
- t.integer "checkouts_count"
292
+ t.integer "manifestation_checkout_stat_id", null: false
293
+ t.integer "manifestation_id", null: false
294
+ t.integer "checkouts_count"
310
295
  t.datetime "created_at"
311
296
  t.datetime "updated_at"
297
+ t.index ["manifestation_checkout_stat_id"], name: "index_checkout_stat_has_manifestations_on_checkout_stat_id"
298
+ t.index ["manifestation_id"], name: "index_checkout_stat_has_manifestations_on_manifestation_id"
312
299
  end
313
300
 
314
- add_index "checkout_stat_has_manifestations", ["manifestation_checkout_stat_id"], name: "index_checkout_stat_has_manifestations_on_checkout_stat_id"
315
- add_index "checkout_stat_has_manifestations", ["manifestation_id"], name: "index_checkout_stat_has_manifestations_on_manifestation_id"
316
-
317
301
  create_table "checkout_stat_has_users", force: :cascade do |t|
318
- t.integer "user_checkout_stat_id", null: false
319
- t.integer "user_id", null: false
320
- t.integer "checkouts_count", default: 0, null: false
302
+ t.integer "user_checkout_stat_id", null: false
303
+ t.integer "user_id", null: false
304
+ t.integer "checkouts_count", default: 0, null: false
321
305
  t.datetime "created_at"
322
306
  t.datetime "updated_at"
307
+ t.index ["user_checkout_stat_id"], name: "index_checkout_stat_has_users_on_user_checkout_stat_id"
308
+ t.index ["user_id"], name: "index_checkout_stat_has_users_on_user_id"
323
309
  end
324
310
 
325
- add_index "checkout_stat_has_users", ["user_checkout_stat_id"], name: "index_checkout_stat_has_users_on_user_checkout_stat_id"
326
- add_index "checkout_stat_has_users", ["user_id"], name: "index_checkout_stat_has_users_on_user_id"
327
-
328
311
  create_table "checkout_types", force: :cascade do |t|
329
- t.string "name", null: false
330
- t.text "display_name"
331
- t.text "note"
332
- t.integer "position"
312
+ t.string "name", null: false
313
+ t.text "display_name"
314
+ t.text "note"
315
+ t.integer "position"
333
316
  t.datetime "created_at"
334
317
  t.datetime "updated_at"
318
+ t.index ["name"], name: "index_checkout_types_on_name"
335
319
  end
336
320
 
337
- add_index "checkout_types", ["name"], name: "index_checkout_types_on_name"
338
-
339
321
  create_table "checkouts", force: :cascade do |t|
340
- t.integer "user_id"
341
- t.integer "item_id", null: false
342
- t.integer "checkin_id"
343
- t.integer "librarian_id"
344
- t.integer "basket_id"
322
+ t.integer "user_id"
323
+ t.integer "item_id", null: false
324
+ t.integer "checkin_id"
325
+ t.integer "librarian_id"
326
+ t.integer "basket_id"
345
327
  t.datetime "due_date"
346
- t.integer "checkout_renewal_count", default: 0, null: false
347
- t.integer "lock_version", default: 0, null: false
328
+ t.integer "checkout_renewal_count", default: 0, null: false
329
+ t.integer "lock_version", default: 0, null: false
348
330
  t.datetime "created_at"
349
331
  t.datetime "updated_at"
350
- t.integer "shelf_id"
332
+ t.integer "shelf_id"
333
+ t.index ["basket_id"], name: "index_checkouts_on_basket_id"
334
+ t.index ["checkin_id"], name: "index_checkouts_on_checkin_id"
335
+ t.index ["item_id", "basket_id"], name: "index_checkouts_on_item_id_and_basket_id", unique: true
336
+ t.index ["item_id"], name: "index_checkouts_on_item_id"
337
+ t.index ["librarian_id"], name: "index_checkouts_on_librarian_id"
338
+ t.index ["shelf_id"], name: "index_checkouts_on_shelf_id"
339
+ t.index ["user_id"], name: "index_checkouts_on_user_id"
351
340
  end
352
341
 
353
- add_index "checkouts", ["basket_id"], name: "index_checkouts_on_basket_id"
354
- add_index "checkouts", ["checkin_id"], name: "index_checkouts_on_checkin_id"
355
- add_index "checkouts", ["item_id", "basket_id"], name: "index_checkouts_on_item_id_and_basket_id", unique: true
356
- add_index "checkouts", ["item_id"], name: "index_checkouts_on_item_id"
357
- add_index "checkouts", ["librarian_id"], name: "index_checkouts_on_librarian_id"
358
- add_index "checkouts", ["shelf_id"], name: "index_checkouts_on_shelf_id"
359
- add_index "checkouts", ["user_id"], name: "index_checkouts_on_user_id"
360
-
361
342
  create_table "circulation_statuses", force: :cascade do |t|
362
- t.string "name", null: false
363
- t.text "display_name"
364
- t.text "note"
365
- t.integer "position"
343
+ t.string "name", null: false
344
+ t.text "display_name"
345
+ t.text "note"
346
+ t.integer "position"
366
347
  t.datetime "created_at"
367
348
  t.datetime "updated_at"
368
349
  end
369
350
 
370
351
  create_table "classification_types", force: :cascade do |t|
371
- t.string "name", null: false
372
- t.text "display_name"
373
- t.text "note"
374
- t.integer "position"
352
+ t.string "name", null: false
353
+ t.text "display_name"
354
+ t.text "note"
355
+ t.integer "position"
375
356
  t.datetime "created_at"
376
357
  t.datetime "updated_at"
377
358
  end
378
359
 
379
360
  create_table "classifications", force: :cascade do |t|
380
- t.integer "parent_id"
381
- t.string "category", null: false
382
- t.text "note"
383
- t.integer "classification_type_id", null: false
361
+ t.integer "parent_id"
362
+ t.string "category", null: false
363
+ t.text "note"
364
+ t.integer "classification_type_id", null: false
384
365
  t.datetime "created_at"
385
366
  t.datetime "updated_at"
386
- t.integer "lft"
387
- t.integer "rgt"
388
- t.integer "manifestation_id"
367
+ t.integer "lft"
368
+ t.integer "rgt"
369
+ t.integer "manifestation_id"
370
+ t.index ["category"], name: "index_classifications_on_category"
371
+ t.index ["classification_type_id"], name: "index_classifications_on_classification_type_id"
372
+ t.index ["manifestation_id"], name: "index_classifications_on_manifestation_id"
373
+ t.index ["parent_id"], name: "index_classifications_on_parent_id"
389
374
  end
390
375
 
391
- add_index "classifications", ["category"], name: "index_classifications_on_category"
392
- add_index "classifications", ["classification_type_id"], name: "index_classifications_on_classification_type_id"
393
- add_index "classifications", ["manifestation_id"], name: "index_classifications_on_manifestation_id"
394
- add_index "classifications", ["parent_id"], name: "index_classifications_on_parent_id"
395
-
396
376
  create_table "colors", force: :cascade do |t|
397
- t.integer "library_group_id"
398
- t.string "property"
399
- t.string "code"
400
- t.integer "position"
377
+ t.integer "library_group_id"
378
+ t.string "property"
379
+ t.string "code"
380
+ t.integer "position"
401
381
  t.datetime "created_at"
402
382
  t.datetime "updated_at"
383
+ t.index ["library_group_id"], name: "index_colors_on_library_group_id"
403
384
  end
404
385
 
405
- add_index "colors", ["library_group_id"], name: "index_colors_on_library_group_id"
406
-
407
386
  create_table "content_types", force: :cascade do |t|
408
- t.string "name", null: false
409
- t.text "display_name"
410
- t.text "note"
411
- t.integer "position"
387
+ t.string "name", null: false
388
+ t.text "display_name"
389
+ t.text "note"
390
+ t.integer "position"
412
391
  t.datetime "created_at"
413
392
  t.datetime "updated_at"
414
393
  end
415
394
 
416
395
  create_table "countries", force: :cascade do |t|
417
- t.string "name", null: false
418
- t.text "display_name"
419
- t.string "alpha_2"
420
- t.string "alpha_3"
421
- t.string "numeric_3"
422
- t.text "note"
396
+ t.string "name", null: false
397
+ t.text "display_name"
398
+ t.string "alpha_2"
399
+ t.string "alpha_3"
400
+ t.string "numeric_3"
401
+ t.text "note"
423
402
  t.integer "position"
403
+ t.index ["alpha_2"], name: "index_countries_on_alpha_2"
404
+ t.index ["alpha_3"], name: "index_countries_on_alpha_3"
405
+ t.index ["name"], name: "index_countries_on_name"
406
+ t.index ["numeric_3"], name: "index_countries_on_numeric_3"
424
407
  end
425
408
 
426
- add_index "countries", ["alpha_2"], name: "index_countries_on_alpha_2"
427
- add_index "countries", ["alpha_3"], name: "index_countries_on_alpha_3"
428
- add_index "countries", ["name"], name: "index_countries_on_name"
429
- add_index "countries", ["numeric_3"], name: "index_countries_on_numeric_3"
430
-
431
409
  create_table "create_types", force: :cascade do |t|
432
- t.string "name"
433
- t.text "display_name"
434
- t.text "note"
435
- t.integer "position"
410
+ t.string "name"
411
+ t.text "display_name"
412
+ t.text "note"
413
+ t.integer "position"
436
414
  t.datetime "created_at"
437
415
  t.datetime "updated_at"
438
416
  end
439
417
 
440
418
  create_table "creates", force: :cascade do |t|
441
- t.integer "agent_id", null: false
442
- t.integer "work_id", null: false
443
- t.integer "position"
419
+ t.integer "agent_id", null: false
420
+ t.integer "work_id", null: false
421
+ t.integer "position"
444
422
  t.datetime "created_at"
445
423
  t.datetime "updated_at"
446
- t.integer "create_type_id"
424
+ t.integer "create_type_id"
425
+ t.index ["agent_id"], name: "index_creates_on_agent_id"
426
+ t.index ["work_id"], name: "index_creates_on_work_id"
447
427
  end
448
428
 
449
- add_index "creates", ["agent_id"], name: "index_creates_on_agent_id"
450
- add_index "creates", ["work_id"], name: "index_creates_on_work_id"
429
+ create_table "custom_properties", force: :cascade do |t|
430
+ t.integer "resource_id", null: false
431
+ t.string "resource_type", null: false
432
+ t.text "label", null: false
433
+ t.text "value"
434
+ t.datetime "created_at", null: false
435
+ t.datetime "updated_at", null: false
436
+ end
451
437
 
452
438
  create_table "donates", force: :cascade do |t|
453
- t.integer "agent_id", null: false
454
- t.integer "item_id", null: false
439
+ t.integer "agent_id", null: false
440
+ t.integer "item_id", null: false
455
441
  t.datetime "created_at"
456
442
  t.datetime "updated_at"
443
+ t.index ["agent_id"], name: "index_donates_on_agent_id"
444
+ t.index ["item_id"], name: "index_donates_on_item_id"
457
445
  end
458
446
 
459
- add_index "donates", ["agent_id"], name: "index_donates_on_agent_id"
460
- add_index "donates", ["item_id"], name: "index_donates_on_item_id"
461
-
462
447
  create_table "event_categories", force: :cascade do |t|
463
- t.string "name", null: false
464
- t.text "display_name"
465
- t.text "note"
466
- t.integer "position"
448
+ t.string "name", null: false
449
+ t.text "display_name"
450
+ t.text "note"
451
+ t.integer "position"
467
452
  t.datetime "created_at"
468
453
  t.datetime "updated_at"
469
454
  end
470
455
 
471
456
  create_table "event_export_file_transitions", force: :cascade do |t|
472
- t.string "to_state"
473
- t.text "metadata", default: "{}"
474
- t.integer "sort_key"
475
- t.integer "event_export_file_id"
457
+ t.string "to_state"
458
+ t.text "metadata", default: "{}"
459
+ t.integer "sort_key"
460
+ t.integer "event_export_file_id"
476
461
  t.datetime "created_at"
477
462
  t.datetime "updated_at"
463
+ t.index ["event_export_file_id"], name: "index_event_export_file_transitions_on_file_id"
464
+ t.index ["sort_key", "event_export_file_id"], name: "index_event_export_file_transitions_on_sort_key_and_file_id", unique: true
478
465
  end
479
466
 
480
- add_index "event_export_file_transitions", ["event_export_file_id"], name: "index_event_export_file_transitions_on_file_id"
481
- add_index "event_export_file_transitions", ["sort_key", "event_export_file_id"], name: "index_event_export_file_transitions_on_sort_key_and_file_id", unique: true
482
-
483
467
  create_table "event_export_files", force: :cascade do |t|
484
- t.integer "user_id"
485
- t.string "event_export_file_name"
486
- t.string "event_export_content_type"
487
- t.integer "event_export_file_size"
468
+ t.integer "user_id"
469
+ t.string "event_export_file_name"
470
+ t.string "event_export_content_type"
471
+ t.integer "event_export_file_size"
488
472
  t.datetime "event_export_updated_at"
489
473
  t.datetime "executed_at"
490
474
  t.datetime "created_at"
@@ -492,729 +476,696 @@ ActiveRecord::Schema.define(version: 20180107161410) do
492
476
  end
493
477
 
494
478
  create_table "event_import_file_transitions", force: :cascade do |t|
495
- t.string "to_state"
496
- t.text "metadata", default: "{}"
497
- t.integer "sort_key"
498
- t.integer "event_import_file_id"
479
+ t.string "to_state"
480
+ t.text "metadata", default: "{}"
481
+ t.integer "sort_key"
482
+ t.integer "event_import_file_id"
499
483
  t.datetime "created_at"
500
484
  t.datetime "updated_at"
485
+ t.index ["event_import_file_id"], name: "index_event_import_file_transitions_on_event_import_file_id"
486
+ t.index ["sort_key", "event_import_file_id"], name: "index_event_import_file_transitions_on_sort_key_and_file_id", unique: true
501
487
  end
502
488
 
503
- add_index "event_import_file_transitions", ["event_import_file_id"], name: "index_event_import_file_transitions_on_event_import_file_id"
504
- add_index "event_import_file_transitions", ["sort_key", "event_import_file_id"], name: "index_event_import_file_transitions_on_sort_key_and_file_id", unique: true
505
-
506
489
  create_table "event_import_files", force: :cascade do |t|
507
- t.integer "parent_id"
508
- t.string "content_type"
509
- t.integer "size"
510
- t.integer "user_id"
511
- t.text "note"
490
+ t.integer "parent_id"
491
+ t.string "content_type"
492
+ t.integer "size"
493
+ t.integer "user_id"
494
+ t.text "note"
512
495
  t.datetime "executed_at"
513
- t.string "event_import_file_name"
514
- t.string "event_import_content_type"
515
- t.integer "event_import_file_size"
496
+ t.string "event_import_file_name"
497
+ t.string "event_import_content_type"
498
+ t.integer "event_import_file_size"
516
499
  t.datetime "event_import_updated_at"
517
- t.string "edit_mode"
500
+ t.string "edit_mode"
518
501
  t.datetime "created_at"
519
502
  t.datetime "updated_at"
520
- t.string "event_import_fingerprint"
521
- t.text "error_message"
522
- t.string "user_encoding"
523
- t.integer "default_library_id"
524
- t.integer "default_event_category_id"
503
+ t.string "event_import_fingerprint"
504
+ t.text "error_message"
505
+ t.string "user_encoding"
506
+ t.integer "default_library_id"
507
+ t.integer "default_event_category_id"
508
+ t.index ["parent_id"], name: "index_event_import_files_on_parent_id"
509
+ t.index ["user_id"], name: "index_event_import_files_on_user_id"
525
510
  end
526
511
 
527
- add_index "event_import_files", ["parent_id"], name: "index_event_import_files_on_parent_id"
528
- add_index "event_import_files", ["user_id"], name: "index_event_import_files_on_user_id"
529
-
530
512
  create_table "event_import_results", force: :cascade do |t|
531
- t.integer "event_import_file_id"
532
- t.integer "event_id"
533
- t.text "body"
513
+ t.integer "event_import_file_id"
514
+ t.integer "event_id"
515
+ t.text "body"
534
516
  t.datetime "created_at"
535
517
  t.datetime "updated_at"
536
518
  end
537
519
 
538
520
  create_table "events", force: :cascade do |t|
539
- t.integer "library_id", null: false
540
- t.integer "event_category_id", null: false
541
- t.string "name"
542
- t.text "note"
521
+ t.integer "library_id", null: false
522
+ t.integer "event_category_id", null: false
523
+ t.string "name"
524
+ t.text "note"
543
525
  t.datetime "start_at"
544
526
  t.datetime "end_at"
545
- t.boolean "all_day", default: false, null: false
527
+ t.boolean "all_day", default: false, null: false
546
528
  t.datetime "deleted_at"
547
- t.text "display_name"
529
+ t.text "display_name"
548
530
  t.datetime "created_at"
549
531
  t.datetime "updated_at"
532
+ t.index ["event_category_id"], name: "index_events_on_event_category_id"
533
+ t.index ["library_id"], name: "index_events_on_library_id"
550
534
  end
551
535
 
552
- add_index "events", ["event_category_id"], name: "index_events_on_event_category_id"
553
- add_index "events", ["library_id"], name: "index_events_on_library_id"
554
-
555
536
  create_table "exemplifies", force: :cascade do |t|
556
- t.integer "manifestation_id", null: false
557
- t.integer "item_id", null: false
558
- t.integer "position"
537
+ t.integer "manifestation_id", null: false
538
+ t.integer "item_id", null: false
539
+ t.integer "position"
559
540
  t.datetime "created_at"
560
541
  t.datetime "updated_at"
542
+ t.index ["item_id"], name: "index_exemplifies_on_item_id", unique: true
543
+ t.index ["manifestation_id"], name: "index_exemplifies_on_manifestation_id"
561
544
  end
562
545
 
563
- add_index "exemplifies", ["item_id"], name: "index_exemplifies_on_item_id", unique: true
564
- add_index "exemplifies", ["manifestation_id"], name: "index_exemplifies_on_manifestation_id"
565
-
566
546
  create_table "extents", force: :cascade do |t|
567
- t.string "name", null: false
568
- t.text "display_name"
569
- t.text "note"
570
- t.integer "position"
547
+ t.string "name", null: false
548
+ t.text "display_name"
549
+ t.text "note"
550
+ t.integer "position"
571
551
  t.datetime "created_at"
572
552
  t.datetime "updated_at"
573
553
  end
574
554
 
575
555
  create_table "form_of_works", force: :cascade do |t|
576
- t.string "name", null: false
577
- t.text "display_name"
578
- t.text "note"
579
- t.integer "position"
556
+ t.string "name", null: false
557
+ t.text "display_name"
558
+ t.text "note"
559
+ t.integer "position"
580
560
  t.datetime "created_at"
581
561
  t.datetime "updated_at"
582
562
  end
583
563
 
584
564
  create_table "frequencies", force: :cascade do |t|
585
- t.string "name", null: false
586
- t.text "display_name"
587
- t.text "note"
588
- t.integer "position"
565
+ t.string "name", null: false
566
+ t.text "display_name"
567
+ t.text "note"
568
+ t.integer "position"
589
569
  t.datetime "created_at"
590
570
  t.datetime "updated_at"
591
571
  end
592
572
 
593
573
  create_table "identifier_types", force: :cascade do |t|
594
- t.string "name"
595
- t.text "display_name"
596
- t.text "note"
597
- t.integer "position"
574
+ t.string "name"
575
+ t.text "display_name"
576
+ t.text "note"
577
+ t.integer "position"
598
578
  t.datetime "created_at"
599
579
  t.datetime "updated_at"
600
580
  end
601
581
 
602
582
  create_table "identifiers", force: :cascade do |t|
603
- t.string "body", null: false
604
- t.integer "identifier_type_id", null: false
605
- t.integer "manifestation_id"
606
- t.boolean "primary"
607
- t.integer "position"
583
+ t.string "body", null: false
584
+ t.integer "identifier_type_id", null: false
585
+ t.integer "manifestation_id"
586
+ t.boolean "primary"
587
+ t.integer "position"
608
588
  t.datetime "created_at"
609
589
  t.datetime "updated_at"
590
+ t.index ["body", "identifier_type_id"], name: "index_identifiers_on_body_and_identifier_type_id"
591
+ t.index ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
610
592
  end
611
593
 
612
- add_index "identifiers", ["body", "identifier_type_id"], name: "index_identifiers_on_body_and_identifier_type_id"
613
- add_index "identifiers", ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
614
-
615
594
  create_table "import_request_transitions", force: :cascade do |t|
616
- t.string "to_state"
617
- t.text "metadata", default: "{}"
618
- t.integer "sort_key"
619
- t.integer "import_request_id"
595
+ t.string "to_state"
596
+ t.text "metadata", default: "{}"
597
+ t.integer "sort_key"
598
+ t.integer "import_request_id"
620
599
  t.datetime "created_at"
621
600
  t.datetime "updated_at"
622
- t.boolean "most_recent", null: false
601
+ t.boolean "most_recent", null: false
602
+ t.index ["import_request_id", "most_recent"], name: "index_import_request_transitions_parent_most_recent", unique: true, where: "most_recent"
603
+ t.index ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
604
+ t.index ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
623
605
  end
624
606
 
625
- add_index "import_request_transitions", ["import_request_id", "most_recent"], name: "index_import_request_transitions_parent_most_recent", unique: true
626
- add_index "import_request_transitions", ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
627
- add_index "import_request_transitions", ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
628
-
629
607
  create_table "import_requests", force: :cascade do |t|
630
- t.string "isbn"
631
- t.integer "manifestation_id"
632
- t.integer "user_id"
608
+ t.string "isbn"
609
+ t.integer "manifestation_id"
610
+ t.integer "user_id"
633
611
  t.datetime "created_at"
634
612
  t.datetime "updated_at"
613
+ t.index ["isbn"], name: "index_import_requests_on_isbn"
614
+ t.index ["manifestation_id"], name: "index_import_requests_on_manifestation_id"
615
+ t.index ["user_id"], name: "index_import_requests_on_user_id"
635
616
  end
636
617
 
637
- add_index "import_requests", ["isbn"], name: "index_import_requests_on_isbn"
638
- add_index "import_requests", ["manifestation_id"], name: "index_import_requests_on_manifestation_id"
639
- add_index "import_requests", ["user_id"], name: "index_import_requests_on_user_id"
640
-
641
618
  create_table "item_has_use_restrictions", force: :cascade do |t|
642
- t.integer "item_id", null: false
643
- t.integer "use_restriction_id", null: false
619
+ t.integer "item_id", null: false
620
+ t.integer "use_restriction_id", null: false
644
621
  t.datetime "created_at"
645
622
  t.datetime "updated_at"
623
+ t.index ["item_id"], name: "index_item_has_use_restrictions_on_item_id"
624
+ t.index ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
646
625
  end
647
626
 
648
- add_index "item_has_use_restrictions", ["item_id"], name: "index_item_has_use_restrictions_on_item_id"
649
- add_index "item_has_use_restrictions", ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
650
-
651
627
  create_table "items", force: :cascade do |t|
652
- t.string "call_number"
653
- t.string "item_identifier"
628
+ t.string "call_number"
629
+ t.string "item_identifier"
654
630
  t.datetime "created_at"
655
631
  t.datetime "updated_at"
656
632
  t.datetime "deleted_at"
657
- t.integer "shelf_id", default: 1, null: false
658
- t.boolean "include_supplements", default: false, null: false
659
- t.text "note"
660
- t.string "url"
661
- t.integer "price"
662
- t.integer "lock_version", default: 0, null: false
663
- t.integer "required_role_id", default: 1, null: false
664
- t.integer "required_score", default: 0, null: false
633
+ t.integer "shelf_id", default: 1, null: false
634
+ t.boolean "include_supplements", default: false, null: false
635
+ t.text "note"
636
+ t.string "url"
637
+ t.integer "price"
638
+ t.integer "lock_version", default: 0, null: false
639
+ t.integer "required_role_id", default: 1, null: false
640
+ t.integer "required_score", default: 0, null: false
665
641
  t.datetime "acquired_at"
666
- t.integer "bookstore_id"
667
- t.integer "budget_type_id"
668
- t.integer "circulation_status_id", default: 5, null: false
669
- t.integer "checkout_type_id", default: 1, null: false
670
- t.string "binding_item_identifier"
671
- t.string "binding_call_number"
642
+ t.integer "bookstore_id"
643
+ t.integer "budget_type_id"
644
+ t.integer "circulation_status_id", default: 5, null: false
645
+ t.integer "checkout_type_id", default: 1, null: false
646
+ t.string "binding_item_identifier"
647
+ t.string "binding_call_number"
672
648
  t.datetime "binded_at"
673
- t.integer "manifestation_id", null: false
649
+ t.integer "manifestation_id", null: false
650
+ t.text "memo"
651
+ t.index ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
652
+ t.index ["bookstore_id"], name: "index_items_on_bookstore_id"
653
+ t.index ["checkout_type_id"], name: "index_items_on_checkout_type_id"
654
+ t.index ["circulation_status_id"], name: "index_items_on_circulation_status_id"
655
+ t.index ["item_identifier"], name: "index_items_on_item_identifier"
656
+ t.index ["manifestation_id"], name: "index_items_on_manifestation_id"
657
+ t.index ["required_role_id"], name: "index_items_on_required_role_id"
658
+ t.index ["shelf_id"], name: "index_items_on_shelf_id"
674
659
  end
675
660
 
676
- add_index "items", ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
677
- add_index "items", ["bookstore_id"], name: "index_items_on_bookstore_id"
678
- add_index "items", ["checkout_type_id"], name: "index_items_on_checkout_type_id"
679
- add_index "items", ["circulation_status_id"], name: "index_items_on_circulation_status_id"
680
- add_index "items", ["item_identifier"], name: "index_items_on_item_identifier"
681
- add_index "items", ["manifestation_id"], name: "index_items_on_manifestation_id"
682
- add_index "items", ["required_role_id"], name: "index_items_on_required_role_id"
683
- add_index "items", ["shelf_id"], name: "index_items_on_shelf_id"
684
-
685
661
  create_table "languages", force: :cascade do |t|
686
- t.string "name", null: false
687
- t.string "native_name"
688
- t.text "display_name"
689
- t.string "iso_639_1"
690
- t.string "iso_639_2"
691
- t.string "iso_639_3"
692
- t.text "note"
662
+ t.string "name", null: false
663
+ t.string "native_name"
664
+ t.text "display_name"
665
+ t.string "iso_639_1"
666
+ t.string "iso_639_2"
667
+ t.string "iso_639_3"
668
+ t.text "note"
693
669
  t.integer "position"
670
+ t.index ["iso_639_1"], name: "index_languages_on_iso_639_1"
671
+ t.index ["iso_639_2"], name: "index_languages_on_iso_639_2"
672
+ t.index ["iso_639_3"], name: "index_languages_on_iso_639_3"
673
+ t.index ["name"], name: "index_languages_on_name", unique: true
694
674
  end
695
675
 
696
- add_index "languages", ["iso_639_1"], name: "index_languages_on_iso_639_1"
697
- add_index "languages", ["iso_639_2"], name: "index_languages_on_iso_639_2"
698
- add_index "languages", ["iso_639_3"], name: "index_languages_on_iso_639_3"
699
- add_index "languages", ["name"], name: "index_languages_on_name", unique: true
700
-
701
676
  create_table "lending_policies", force: :cascade do |t|
702
- t.integer "item_id", null: false
703
- t.integer "user_group_id", null: false
704
- t.integer "loan_period", default: 0, null: false
677
+ t.integer "item_id", null: false
678
+ t.integer "user_group_id", null: false
679
+ t.integer "loan_period", default: 0, null: false
705
680
  t.datetime "fixed_due_date"
706
- t.integer "renewal", default: 0, null: false
707
- t.integer "fine", default: 0, null: false
708
- t.text "note"
709
- t.integer "position"
681
+ t.integer "renewal", default: 0, null: false
682
+ t.integer "fine", default: 0, null: false
683
+ t.text "note"
684
+ t.integer "position"
710
685
  t.datetime "created_at"
711
686
  t.datetime "updated_at"
687
+ t.index ["item_id", "user_group_id"], name: "index_lending_policies_on_item_id_and_user_group_id", unique: true
712
688
  end
713
689
 
714
- add_index "lending_policies", ["item_id", "user_group_id"], name: "index_lending_policies_on_item_id_and_user_group_id", unique: true
715
-
716
690
  create_table "libraries", force: :cascade do |t|
717
- t.string "name", null: false
718
- t.text "display_name"
719
- t.string "short_display_name", null: false
720
- t.string "zip_code"
721
- t.text "street"
722
- t.text "locality"
723
- t.text "region"
724
- t.string "telephone_number_1"
725
- t.string "telephone_number_2"
726
- t.string "fax_number"
727
- t.text "note"
728
- t.integer "call_number_rows", default: 1, null: false
729
- t.string "call_number_delimiter", default: "|", null: false
730
- t.integer "library_group_id", null: false
731
- t.integer "users_count", default: 0, null: false
732
- t.integer "position"
733
- t.integer "country_id"
691
+ t.string "name", null: false
692
+ t.text "display_name"
693
+ t.string "short_display_name", null: false
694
+ t.string "zip_code"
695
+ t.text "street"
696
+ t.text "locality"
697
+ t.text "region"
698
+ t.string "telephone_number_1"
699
+ t.string "telephone_number_2"
700
+ t.string "fax_number"
701
+ t.text "note"
702
+ t.integer "call_number_rows", default: 1, null: false
703
+ t.string "call_number_delimiter", default: "|", null: false
704
+ t.integer "library_group_id", null: false
705
+ t.integer "users_count", default: 0, null: false
706
+ t.integer "position"
707
+ t.integer "country_id"
734
708
  t.datetime "created_at"
735
709
  t.datetime "updated_at"
736
710
  t.datetime "deleted_at"
737
- t.text "opening_hour"
738
- t.string "isil"
739
- t.float "latitude"
740
- t.float "longitude"
711
+ t.text "opening_hour"
712
+ t.string "isil"
713
+ t.float "latitude"
714
+ t.float "longitude"
715
+ t.index ["library_group_id"], name: "index_libraries_on_library_group_id"
716
+ t.index ["name"], name: "index_libraries_on_name"
741
717
  end
742
718
 
743
- add_index "libraries", ["library_group_id"], name: "index_libraries_on_library_group_id"
744
- add_index "libraries", ["name"], name: "index_libraries_on_name"
745
-
746
719
  create_table "library_group_translations", force: :cascade do |t|
747
- t.integer "library_group_id", null: false
748
- t.string "locale", null: false
749
- t.datetime "created_at", null: false
750
- t.datetime "updated_at", null: false
751
- t.text "login_banner"
752
- t.text "footer_banner"
720
+ t.integer "library_group_id", null: false
721
+ t.string "locale", null: false
722
+ t.datetime "created_at", null: false
723
+ t.datetime "updated_at", null: false
724
+ t.text "login_banner"
725
+ t.text "footer_banner"
726
+ t.index ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
727
+ t.index ["locale"], name: "index_library_group_translations_on_locale"
753
728
  end
754
729
 
755
- add_index "library_group_translations", ["library_group_id"], name: "index_library_group_translations_on_library_group_id"
756
- add_index "library_group_translations", ["locale"], name: "index_library_group_translations_on_locale"
757
-
758
730
  create_table "library_groups", force: :cascade do |t|
759
- t.string "name", null: false
760
- t.text "display_name"
761
- t.string "short_name", null: false
762
- t.text "my_networks"
763
- t.text "old_login_banner"
764
- t.text "note"
765
- t.integer "country_id"
766
- t.integer "position"
767
- t.datetime "created_at"
768
- t.datetime "updated_at"
769
- t.text "admin_networks"
770
- t.boolean "allow_bookmark_external_url", default: false, null: false
771
- t.string "url", default: "http://localhost:3000/"
772
- t.text "settings"
773
- t.text "html_snippet"
774
- t.integer "max_number_of_results", default: 500
775
- t.boolean "family_name_first", default: true
776
- t.integer "pub_year_facet_range_interval", default: 10
777
- t.integer "user_id"
778
- t.boolean "csv_charset_conversion", default: false, null: false
779
- t.string "header_logo_file_name"
780
- t.string "header_logo_content_type"
781
- t.integer "header_logo_file_size"
731
+ t.string "name", null: false
732
+ t.text "display_name"
733
+ t.string "short_name", null: false
734
+ t.text "my_networks"
735
+ t.text "old_login_banner"
736
+ t.text "note"
737
+ t.integer "country_id"
738
+ t.integer "position"
739
+ t.datetime "created_at"
740
+ t.datetime "updated_at"
741
+ t.text "admin_networks"
742
+ t.boolean "allow_bookmark_external_url", default: false, null: false
743
+ t.string "url", default: "http://localhost:3000/"
744
+ t.text "settings"
745
+ t.text "html_snippet"
746
+ t.integer "max_number_of_results", default: 500
747
+ t.boolean "family_name_first", default: true
748
+ t.integer "pub_year_facet_range_interval", default: 10
749
+ t.integer "user_id"
750
+ t.boolean "csv_charset_conversion", default: false, null: false
751
+ t.string "header_logo_file_name"
752
+ t.string "header_logo_content_type"
753
+ t.integer "header_logo_file_size"
782
754
  t.datetime "header_logo_updated_at"
783
- t.text "header_logo_meta"
755
+ t.text "header_logo_meta"
756
+ t.index ["short_name"], name: "index_library_groups_on_short_name"
757
+ t.index ["user_id"], name: "index_library_groups_on_user_id"
784
758
  end
785
759
 
786
- add_index "library_groups", ["short_name"], name: "index_library_groups_on_short_name"
787
- add_index "library_groups", ["user_id"], name: "index_library_groups_on_user_id"
788
-
789
760
  create_table "licenses", force: :cascade do |t|
790
- t.string "name", null: false
791
- t.string "display_name"
792
- t.text "note"
793
- t.integer "position"
761
+ t.string "name", null: false
762
+ t.string "display_name"
763
+ t.text "note"
764
+ t.integer "position"
794
765
  t.datetime "created_at"
795
766
  t.datetime "updated_at"
796
767
  end
797
768
 
798
769
  create_table "manifestation_checkout_stat_transitions", force: :cascade do |t|
799
- t.string "to_state"
800
- t.text "metadata", default: "{}"
801
- t.integer "sort_key"
802
- t.integer "manifestation_checkout_stat_id"
770
+ t.string "to_state"
771
+ t.text "metadata", default: "{}"
772
+ t.integer "sort_key"
773
+ t.integer "manifestation_checkout_stat_id"
803
774
  t.datetime "created_at"
804
775
  t.datetime "updated_at"
776
+ t.index ["manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_stat_id"
777
+ t.index ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
805
778
  end
806
779
 
807
- add_index "manifestation_checkout_stat_transitions", ["manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_stat_id"
808
- add_index "manifestation_checkout_stat_transitions", ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
809
-
810
780
  create_table "manifestation_checkout_stats", force: :cascade do |t|
811
781
  t.datetime "start_date"
812
782
  t.datetime "end_date"
813
- t.text "note"
783
+ t.text "note"
814
784
  t.datetime "created_at"
815
785
  t.datetime "updated_at"
816
786
  t.datetime "started_at"
817
787
  t.datetime "completed_at"
818
- t.integer "user_id"
788
+ t.integer "user_id"
789
+ t.index ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
819
790
  end
820
791
 
821
- add_index "manifestation_checkout_stats", ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
822
-
823
792
  create_table "manifestation_relationship_types", force: :cascade do |t|
824
- t.string "name", null: false
825
- t.text "display_name"
826
- t.text "note"
827
- t.integer "position"
793
+ t.string "name", null: false
794
+ t.text "display_name"
795
+ t.text "note"
796
+ t.integer "position"
828
797
  t.datetime "created_at"
829
798
  t.datetime "updated_at"
830
799
  end
831
800
 
832
801
  create_table "manifestation_relationships", force: :cascade do |t|
833
- t.integer "parent_id"
834
- t.integer "child_id"
835
- t.integer "manifestation_relationship_type_id"
802
+ t.integer "parent_id"
803
+ t.integer "child_id"
804
+ t.integer "manifestation_relationship_type_id"
836
805
  t.datetime "created_at"
837
806
  t.datetime "updated_at"
838
- t.integer "position"
807
+ t.integer "position"
808
+ t.index ["child_id"], name: "index_manifestation_relationships_on_child_id"
809
+ t.index ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
839
810
  end
840
811
 
841
- add_index "manifestation_relationships", ["child_id"], name: "index_manifestation_relationships_on_child_id"
842
- add_index "manifestation_relationships", ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
843
-
844
812
  create_table "manifestation_reserve_stat_transitions", force: :cascade do |t|
845
- t.string "to_state"
846
- t.text "metadata", default: "{}"
847
- t.integer "sort_key"
848
- t.integer "manifestation_reserve_stat_id"
813
+ t.string "to_state"
814
+ t.text "metadata", default: "{}"
815
+ t.integer "sort_key"
816
+ t.integer "manifestation_reserve_stat_id"
849
817
  t.datetime "created_at"
850
818
  t.datetime "updated_at"
819
+ t.index ["manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_stat_id"
820
+ t.index ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
851
821
  end
852
822
 
853
- add_index "manifestation_reserve_stat_transitions", ["manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_stat_id"
854
- add_index "manifestation_reserve_stat_transitions", ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
855
-
856
823
  create_table "manifestation_reserve_stats", force: :cascade do |t|
857
824
  t.datetime "start_date"
858
825
  t.datetime "end_date"
859
- t.text "note"
826
+ t.text "note"
860
827
  t.datetime "created_at"
861
828
  t.datetime "updated_at"
862
829
  t.datetime "started_at"
863
830
  t.datetime "completed_at"
864
- t.integer "user_id"
831
+ t.integer "user_id"
832
+ t.index ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
865
833
  end
866
834
 
867
- add_index "manifestation_reserve_stats", ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
868
-
869
835
  create_table "manifestations", force: :cascade do |t|
870
- t.text "original_title", null: false
871
- t.text "title_alternative"
872
- t.text "title_transcription"
873
- t.string "classification_number"
874
- t.string "manifestation_identifier"
836
+ t.text "original_title", null: false
837
+ t.text "title_alternative"
838
+ t.text "title_transcription"
839
+ t.string "classification_number"
840
+ t.string "manifestation_identifier"
875
841
  t.datetime "date_of_publication"
876
842
  t.datetime "date_copyrighted"
877
843
  t.datetime "created_at"
878
844
  t.datetime "updated_at"
879
845
  t.datetime "deleted_at"
880
- t.string "access_address"
881
- t.integer "language_id", default: 1, null: false
882
- t.integer "carrier_type_id", default: 1, null: false
883
- t.integer "start_page"
884
- t.integer "end_page"
885
- t.integer "height"
886
- t.integer "width"
887
- t.integer "depth"
888
- t.integer "price"
889
- t.text "fulltext"
890
- t.string "volume_number_string"
891
- t.string "issue_number_string"
892
- t.string "serial_number_string"
893
- t.integer "edition"
894
- t.text "note"
895
- t.boolean "repository_content", default: false, null: false
896
- t.integer "lock_version", default: 0, null: false
897
- t.integer "required_role_id", default: 1, null: false
898
- t.integer "required_score", default: 0, null: false
899
- t.integer "frequency_id", default: 1, null: false
900
- t.boolean "subscription_master", default: false, null: false
901
- t.string "attachment_file_name"
902
- t.string "attachment_content_type"
903
- t.integer "attachment_file_size"
846
+ t.string "access_address"
847
+ t.integer "language_id", default: 1, null: false
848
+ t.integer "carrier_type_id", default: 1, null: false
849
+ t.integer "start_page"
850
+ t.integer "end_page"
851
+ t.integer "height"
852
+ t.integer "width"
853
+ t.integer "depth"
854
+ t.integer "price"
855
+ t.text "fulltext"
856
+ t.string "volume_number_string"
857
+ t.string "issue_number_string"
858
+ t.string "serial_number_string"
859
+ t.integer "edition"
860
+ t.text "note"
861
+ t.boolean "repository_content", default: false, null: false
862
+ t.integer "lock_version", default: 0, null: false
863
+ t.integer "required_role_id", default: 1, null: false
864
+ t.integer "required_score", default: 0, null: false
865
+ t.integer "frequency_id", default: 1, null: false
866
+ t.boolean "subscription_master", default: false, null: false
867
+ t.string "attachment_file_name"
868
+ t.string "attachment_content_type"
869
+ t.integer "attachment_file_size"
904
870
  t.datetime "attachment_updated_at"
905
- t.text "title_alternative_transcription"
906
- t.text "description"
907
- t.text "abstract"
871
+ t.text "title_alternative_transcription"
872
+ t.text "description"
873
+ t.text "abstract"
908
874
  t.datetime "available_at"
909
875
  t.datetime "valid_until"
910
876
  t.datetime "date_submitted"
911
877
  t.datetime "date_accepted"
912
878
  t.datetime "date_captured"
913
- t.string "pub_date"
914
- t.string "edition_string"
915
- t.integer "volume_number"
916
- t.integer "issue_number"
917
- t.integer "serial_number"
918
- t.integer "content_type_id", default: 1
919
- t.integer "year_of_publication"
920
- t.text "attachment_meta"
921
- t.integer "month_of_publication"
922
- t.boolean "fulltext_content"
923
- t.string "doi"
924
- t.boolean "serial"
925
- t.text "statement_of_responsibility"
926
- t.text "publication_place"
927
- t.text "extent"
928
- t.text "dimensions"
929
- end
930
-
931
- add_index "manifestations", ["access_address"], name: "index_manifestations_on_access_address"
932
- add_index "manifestations", ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
933
- add_index "manifestations", ["doi"], name: "index_manifestations_on_doi"
934
- add_index "manifestations", ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier"
935
- add_index "manifestations", ["updated_at"], name: "index_manifestations_on_updated_at"
879
+ t.string "pub_date"
880
+ t.string "edition_string"
881
+ t.integer "volume_number"
882
+ t.integer "issue_number"
883
+ t.integer "serial_number"
884
+ t.integer "content_type_id", default: 1
885
+ t.integer "year_of_publication"
886
+ t.text "attachment_meta"
887
+ t.integer "month_of_publication"
888
+ t.boolean "fulltext_content"
889
+ t.string "doi"
890
+ t.boolean "serial"
891
+ t.text "statement_of_responsibility"
892
+ t.text "publication_place"
893
+ t.text "extent"
894
+ t.text "dimensions"
895
+ t.text "memo"
896
+ t.index ["access_address"], name: "index_manifestations_on_access_address"
897
+ t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
898
+ t.index ["doi"], name: "index_manifestations_on_doi"
899
+ t.index ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier"
900
+ t.index ["updated_at"], name: "index_manifestations_on_updated_at"
901
+ end
936
902
 
937
903
  create_table "medium_of_performances", force: :cascade do |t|
938
- t.string "name", null: false
939
- t.text "display_name"
940
- t.text "note"
941
- t.integer "position"
904
+ t.string "name", null: false
905
+ t.text "display_name"
906
+ t.text "note"
907
+ t.integer "position"
942
908
  t.datetime "created_at"
943
909
  t.datetime "updated_at"
944
910
  end
945
911
 
946
912
  create_table "message_request_transitions", force: :cascade do |t|
947
- t.string "to_state"
948
- t.text "metadata", default: "{}"
949
- t.integer "sort_key"
950
- t.integer "message_request_id"
913
+ t.string "to_state"
914
+ t.text "metadata", default: "{}"
915
+ t.integer "sort_key"
916
+ t.integer "message_request_id"
951
917
  t.datetime "created_at"
952
918
  t.datetime "updated_at"
953
- t.boolean "most_recent"
919
+ t.boolean "most_recent"
920
+ t.index ["message_request_id"], name: "index_message_request_transitions_on_message_request_id"
921
+ t.index ["sort_key", "message_request_id"], name: "index_message_request_transitions_on_sort_key_and_request_id", unique: true
954
922
  end
955
923
 
956
- add_index "message_request_transitions", ["message_request_id"], name: "index_message_request_transitions_on_message_request_id"
957
- add_index "message_request_transitions", ["sort_key", "message_request_id"], name: "index_message_request_transitions_on_sort_key_and_request_id", unique: true
958
-
959
924
  create_table "message_requests", force: :cascade do |t|
960
- t.integer "sender_id"
961
- t.integer "receiver_id"
962
- t.integer "message_template_id"
925
+ t.integer "sender_id"
926
+ t.integer "receiver_id"
927
+ t.integer "message_template_id"
963
928
  t.datetime "sent_at"
964
929
  t.datetime "deleted_at"
965
- t.text "body"
930
+ t.text "body"
966
931
  t.datetime "created_at"
967
932
  t.datetime "updated_at"
968
933
  end
969
934
 
970
935
  create_table "message_templates", force: :cascade do |t|
971
- t.string "status", null: false
972
- t.text "title", null: false
973
- t.text "body", null: false
974
- t.integer "position"
975
- t.string "locale", default: "en"
936
+ t.string "status", null: false
937
+ t.text "title", null: false
938
+ t.text "body", null: false
939
+ t.integer "position"
940
+ t.string "locale", default: "en"
976
941
  t.datetime "created_at"
977
942
  t.datetime "updated_at"
943
+ t.index ["status"], name: "index_message_templates_on_status", unique: true
978
944
  end
979
945
 
980
- add_index "message_templates", ["status"], name: "index_message_templates_on_status", unique: true
981
-
982
946
  create_table "message_transitions", force: :cascade do |t|
983
- t.string "to_state"
984
- t.text "metadata", default: "{}"
985
- t.integer "sort_key"
986
- t.integer "message_id"
947
+ t.string "to_state"
948
+ t.text "metadata", default: "{}"
949
+ t.integer "sort_key"
950
+ t.integer "message_id"
987
951
  t.datetime "created_at"
988
952
  t.datetime "updated_at"
989
- t.boolean "most_recent"
953
+ t.boolean "most_recent"
954
+ t.index ["message_id"], name: "index_message_transitions_on_message_id"
955
+ t.index ["sort_key", "message_id"], name: "index_message_transitions_on_sort_key_and_message_id", unique: true
990
956
  end
991
957
 
992
- add_index "message_transitions", ["message_id"], name: "index_message_transitions_on_message_id"
993
- add_index "message_transitions", ["sort_key", "message_id"], name: "index_message_transitions_on_sort_key_and_message_id", unique: true
994
-
995
958
  create_table "messages", force: :cascade do |t|
996
959
  t.datetime "read_at"
997
- t.integer "receiver_id"
998
- t.integer "sender_id"
999
- t.string "subject", null: false
1000
- t.text "body"
1001
- t.integer "message_request_id"
1002
- t.integer "parent_id"
960
+ t.integer "receiver_id"
961
+ t.integer "sender_id"
962
+ t.string "subject", null: false
963
+ t.text "body"
964
+ t.integer "message_request_id"
965
+ t.integer "parent_id"
1003
966
  t.datetime "created_at"
1004
967
  t.datetime "updated_at"
1005
- t.integer "lft"
1006
- t.integer "rgt"
1007
- t.integer "depth"
968
+ t.integer "lft"
969
+ t.integer "rgt"
970
+ t.integer "depth"
971
+ t.index ["message_request_id"], name: "index_messages_on_message_request_id"
972
+ t.index ["parent_id"], name: "index_messages_on_parent_id"
973
+ t.index ["receiver_id"], name: "index_messages_on_receiver_id"
974
+ t.index ["sender_id"], name: "index_messages_on_sender_id"
1008
975
  end
1009
976
 
1010
- add_index "messages", ["message_request_id"], name: "index_messages_on_message_request_id"
1011
- add_index "messages", ["parent_id"], name: "index_messages_on_parent_id"
1012
- add_index "messages", ["receiver_id"], name: "index_messages_on_receiver_id"
1013
- add_index "messages", ["sender_id"], name: "index_messages_on_sender_id"
1014
-
1015
977
  create_table "owns", force: :cascade do |t|
1016
- t.integer "agent_id", null: false
1017
- t.integer "item_id", null: false
1018
- t.integer "position"
978
+ t.integer "agent_id", null: false
979
+ t.integer "item_id", null: false
980
+ t.integer "position"
1019
981
  t.datetime "created_at"
1020
982
  t.datetime "updated_at"
983
+ t.index ["agent_id"], name: "index_owns_on_agent_id"
984
+ t.index ["item_id"], name: "index_owns_on_item_id"
1021
985
  end
1022
986
 
1023
- add_index "owns", ["agent_id"], name: "index_owns_on_agent_id"
1024
- add_index "owns", ["item_id"], name: "index_owns_on_item_id"
1025
-
1026
987
  create_table "participates", force: :cascade do |t|
1027
- t.integer "agent_id", null: false
1028
- t.integer "event_id", null: false
1029
- t.integer "position"
988
+ t.integer "agent_id", null: false
989
+ t.integer "event_id", null: false
990
+ t.integer "position"
1030
991
  t.datetime "created_at"
1031
992
  t.datetime "updated_at"
993
+ t.index ["agent_id"], name: "index_participates_on_agent_id"
994
+ t.index ["event_id"], name: "index_participates_on_event_id"
1032
995
  end
1033
996
 
1034
- add_index "participates", ["agent_id"], name: "index_participates_on_agent_id"
1035
- add_index "participates", ["event_id"], name: "index_participates_on_event_id"
1036
-
1037
997
  create_table "picture_files", force: :cascade do |t|
1038
- t.integer "picture_attachable_id"
1039
- t.string "picture_attachable_type"
1040
- t.string "content_type"
1041
- t.text "title"
1042
- t.string "thumbnail"
1043
- t.integer "position"
998
+ t.integer "picture_attachable_id"
999
+ t.string "picture_attachable_type"
1000
+ t.string "content_type"
1001
+ t.text "title"
1002
+ t.string "thumbnail"
1003
+ t.integer "position"
1044
1004
  t.datetime "created_at"
1045
1005
  t.datetime "updated_at"
1046
- t.string "picture_file_name"
1047
- t.string "picture_content_type"
1048
- t.integer "picture_file_size"
1006
+ t.string "picture_file_name"
1007
+ t.string "picture_content_type"
1008
+ t.integer "picture_file_size"
1049
1009
  t.datetime "picture_updated_at"
1050
- t.text "picture_meta"
1051
- t.string "picture_fingerprint"
1052
- t.integer "picture_width"
1053
- t.integer "picture_height"
1010
+ t.text "picture_meta"
1011
+ t.string "picture_fingerprint"
1012
+ t.integer "picture_width"
1013
+ t.integer "picture_height"
1014
+ t.index ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
1054
1015
  end
1055
1016
 
1056
- add_index "picture_files", ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
1057
-
1058
1017
  create_table "produce_types", force: :cascade do |t|
1059
- t.string "name"
1060
- t.text "display_name"
1061
- t.text "note"
1062
- t.integer "position"
1018
+ t.string "name"
1019
+ t.text "display_name"
1020
+ t.text "note"
1021
+ t.integer "position"
1063
1022
  t.datetime "created_at"
1064
1023
  t.datetime "updated_at"
1065
1024
  end
1066
1025
 
1067
1026
  create_table "produces", force: :cascade do |t|
1068
- t.integer "agent_id", null: false
1069
- t.integer "manifestation_id", null: false
1070
- t.integer "position"
1027
+ t.integer "agent_id", null: false
1028
+ t.integer "manifestation_id", null: false
1029
+ t.integer "position"
1071
1030
  t.datetime "created_at"
1072
1031
  t.datetime "updated_at"
1073
- t.integer "produce_type_id"
1032
+ t.integer "produce_type_id"
1033
+ t.index ["agent_id"], name: "index_produces_on_agent_id"
1034
+ t.index ["manifestation_id"], name: "index_produces_on_manifestation_id"
1074
1035
  end
1075
1036
 
1076
- add_index "produces", ["agent_id"], name: "index_produces_on_agent_id"
1077
- add_index "produces", ["manifestation_id"], name: "index_produces_on_manifestation_id"
1078
-
1079
1037
  create_table "profiles", force: :cascade do |t|
1080
- t.integer "user_id"
1081
- t.integer "user_group_id"
1082
- t.integer "library_id"
1083
- t.string "locale"
1084
- t.string "user_number"
1085
- t.text "full_name"
1086
- t.text "note"
1087
- t.text "keyword_list"
1088
- t.integer "required_role_id"
1089
- t.datetime "created_at"
1090
- t.datetime "updated_at"
1091
- t.string "checkout_icalendar_token"
1092
- t.boolean "save_checkout_history", default: false, null: false
1038
+ t.integer "user_id"
1039
+ t.integer "user_group_id"
1040
+ t.integer "library_id"
1041
+ t.string "locale"
1042
+ t.string "user_number"
1043
+ t.text "full_name"
1044
+ t.text "note"
1045
+ t.text "keyword_list"
1046
+ t.integer "required_role_id"
1047
+ t.datetime "created_at"
1048
+ t.datetime "updated_at"
1049
+ t.string "checkout_icalendar_token"
1050
+ t.boolean "save_checkout_history", default: false, null: false
1093
1051
  t.datetime "expired_at"
1094
- t.boolean "share_bookmarks"
1095
- t.text "full_name_transcription"
1052
+ t.boolean "share_bookmarks"
1053
+ t.text "full_name_transcription"
1096
1054
  t.datetime "date_of_birth"
1055
+ t.index ["checkout_icalendar_token"], name: "index_profiles_on_checkout_icalendar_token", unique: true
1056
+ t.index ["user_id"], name: "index_profiles_on_user_id"
1057
+ t.index ["user_number"], name: "index_profiles_on_user_number", unique: true
1097
1058
  end
1098
1059
 
1099
- add_index "profiles", ["checkout_icalendar_token"], name: "index_profiles_on_checkout_icalendar_token", unique: true
1100
- add_index "profiles", ["user_id"], name: "index_profiles_on_user_id"
1101
- add_index "profiles", ["user_number"], name: "index_profiles_on_user_number", unique: true
1102
-
1103
1060
  create_table "realize_types", force: :cascade do |t|
1104
- t.string "name"
1105
- t.text "display_name"
1106
- t.text "note"
1107
- t.integer "position"
1061
+ t.string "name"
1062
+ t.text "display_name"
1063
+ t.text "note"
1064
+ t.integer "position"
1108
1065
  t.datetime "created_at"
1109
1066
  t.datetime "updated_at"
1110
1067
  end
1111
1068
 
1112
1069
  create_table "realizes", force: :cascade do |t|
1113
- t.integer "agent_id", null: false
1114
- t.integer "expression_id", null: false
1115
- t.integer "position"
1070
+ t.integer "agent_id", null: false
1071
+ t.integer "expression_id", null: false
1072
+ t.integer "position"
1116
1073
  t.datetime "created_at"
1117
1074
  t.datetime "updated_at"
1118
- t.integer "realize_type_id"
1075
+ t.integer "realize_type_id"
1076
+ t.index ["agent_id"], name: "index_realizes_on_agent_id"
1077
+ t.index ["expression_id"], name: "index_realizes_on_expression_id"
1119
1078
  end
1120
1079
 
1121
- add_index "realizes", ["agent_id"], name: "index_realizes_on_agent_id"
1122
- add_index "realizes", ["expression_id"], name: "index_realizes_on_expression_id"
1123
-
1124
1080
  create_table "request_status_types", force: :cascade do |t|
1125
- t.string "name", null: false
1126
- t.text "display_name"
1127
- t.text "note"
1128
- t.integer "position"
1081
+ t.string "name", null: false
1082
+ t.text "display_name"
1083
+ t.text "note"
1084
+ t.integer "position"
1129
1085
  t.datetime "created_at"
1130
1086
  t.datetime "updated_at"
1131
1087
  end
1132
1088
 
1133
1089
  create_table "request_types", force: :cascade do |t|
1134
- t.string "name", null: false
1135
- t.text "display_name"
1136
- t.text "note"
1137
- t.integer "position"
1090
+ t.string "name", null: false
1091
+ t.text "display_name"
1092
+ t.text "note"
1093
+ t.integer "position"
1138
1094
  t.datetime "created_at"
1139
1095
  t.datetime "updated_at"
1140
1096
  end
1141
1097
 
1142
1098
  create_table "reserve_stat_has_manifestations", force: :cascade do |t|
1143
- t.integer "manifestation_reserve_stat_id", null: false
1144
- t.integer "manifestation_id", null: false
1145
- t.integer "reserves_count"
1099
+ t.integer "manifestation_reserve_stat_id", null: false
1100
+ t.integer "manifestation_id", null: false
1101
+ t.integer "reserves_count"
1146
1102
  t.datetime "created_at"
1147
1103
  t.datetime "updated_at"
1104
+ t.index ["manifestation_id"], name: "index_reserve_stat_has_manifestations_on_manifestation_id"
1105
+ t.index ["manifestation_reserve_stat_id"], name: "index_reserve_stat_has_manifestations_on_m_reserve_stat_id"
1148
1106
  end
1149
1107
 
1150
- add_index "reserve_stat_has_manifestations", ["manifestation_id"], name: "index_reserve_stat_has_manifestations_on_manifestation_id"
1151
- add_index "reserve_stat_has_manifestations", ["manifestation_reserve_stat_id"], name: "index_reserve_stat_has_manifestations_on_m_reserve_stat_id"
1152
-
1153
1108
  create_table "reserve_stat_has_users", force: :cascade do |t|
1154
- t.integer "user_reserve_stat_id", null: false
1155
- t.integer "user_id", null: false
1156
- t.integer "reserves_count"
1109
+ t.integer "user_reserve_stat_id", null: false
1110
+ t.integer "user_id", null: false
1111
+ t.integer "reserves_count"
1157
1112
  t.datetime "created_at"
1158
1113
  t.datetime "updated_at"
1114
+ t.index ["user_id"], name: "index_reserve_stat_has_users_on_user_id"
1115
+ t.index ["user_reserve_stat_id"], name: "index_reserve_stat_has_users_on_user_reserve_stat_id"
1159
1116
  end
1160
1117
 
1161
- add_index "reserve_stat_has_users", ["user_id"], name: "index_reserve_stat_has_users_on_user_id"
1162
- add_index "reserve_stat_has_users", ["user_reserve_stat_id"], name: "index_reserve_stat_has_users_on_user_reserve_stat_id"
1163
-
1164
1118
  create_table "reserve_transitions", force: :cascade do |t|
1165
- t.string "to_state"
1166
- t.text "metadata", default: "{}"
1167
- t.integer "sort_key"
1168
- t.integer "reserve_id"
1119
+ t.string "to_state"
1120
+ t.text "metadata", default: "{}"
1121
+ t.integer "sort_key"
1122
+ t.integer "reserve_id"
1169
1123
  t.datetime "created_at"
1170
1124
  t.datetime "updated_at"
1125
+ t.index ["reserve_id"], name: "index_reserve_transitions_on_reserve_id"
1126
+ t.index ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
1171
1127
  end
1172
1128
 
1173
- add_index "reserve_transitions", ["reserve_id"], name: "index_reserve_transitions_on_reserve_id"
1174
- add_index "reserve_transitions", ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
1175
-
1176
1129
  create_table "reserves", force: :cascade do |t|
1177
- t.integer "user_id", null: false
1178
- t.integer "manifestation_id", null: false
1179
- t.integer "item_id"
1180
- t.integer "request_status_type_id", null: false
1130
+ t.integer "user_id", null: false
1131
+ t.integer "manifestation_id", null: false
1132
+ t.integer "item_id"
1133
+ t.integer "request_status_type_id", null: false
1181
1134
  t.datetime "checked_out_at"
1182
1135
  t.datetime "created_at"
1183
1136
  t.datetime "updated_at"
1184
1137
  t.datetime "canceled_at"
1185
1138
  t.datetime "expired_at"
1186
1139
  t.datetime "deleted_at"
1187
- t.boolean "expiration_notice_to_patron", default: false
1188
- t.boolean "expiration_notice_to_library", default: false
1140
+ t.boolean "expiration_notice_to_patron", default: false
1141
+ t.boolean "expiration_notice_to_library", default: false
1189
1142
  t.datetime "retained_at"
1190
1143
  t.datetime "postponed_at"
1191
- t.integer "lock_version", default: 0, null: false
1144
+ t.integer "lock_version", default: 0, null: false
1145
+ t.index ["item_id"], name: "index_reserves_on_item_id"
1146
+ t.index ["manifestation_id"], name: "index_reserves_on_manifestation_id"
1147
+ t.index ["request_status_type_id"], name: "index_reserves_on_request_status_type_id"
1148
+ t.index ["user_id"], name: "index_reserves_on_user_id"
1192
1149
  end
1193
1150
 
1194
- add_index "reserves", ["item_id"], name: "index_reserves_on_item_id"
1195
- add_index "reserves", ["manifestation_id"], name: "index_reserves_on_manifestation_id"
1196
- add_index "reserves", ["request_status_type_id"], name: "index_reserves_on_request_status_type_id"
1197
- add_index "reserves", ["user_id"], name: "index_reserves_on_user_id"
1198
-
1199
1151
  create_table "resource_export_file_transitions", force: :cascade do |t|
1200
- t.string "to_state"
1201
- t.text "metadata", default: "{}"
1202
- t.integer "sort_key"
1203
- t.integer "resource_export_file_id"
1152
+ t.string "to_state"
1153
+ t.text "metadata", default: "{}"
1154
+ t.integer "sort_key"
1155
+ t.integer "resource_export_file_id"
1204
1156
  t.datetime "created_at"
1205
1157
  t.datetime "updated_at"
1206
- t.boolean "most_recent", null: false
1158
+ t.boolean "most_recent", null: false
1159
+ t.index ["resource_export_file_id", "most_recent"], name: "index_resource_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1160
+ t.index ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
1161
+ t.index ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
1207
1162
  end
1208
1163
 
1209
- add_index "resource_export_file_transitions", ["resource_export_file_id", "most_recent"], name: "index_resource_export_file_transitions_parent_most_recent", unique: true
1210
- add_index "resource_export_file_transitions", ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
1211
- 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
1212
-
1213
1164
  create_table "resource_export_files", force: :cascade do |t|
1214
- t.integer "user_id"
1215
- t.string "resource_export_file_name"
1216
- t.string "resource_export_content_type"
1217
- t.integer "resource_export_file_size"
1165
+ t.integer "user_id"
1166
+ t.string "resource_export_file_name"
1167
+ t.string "resource_export_content_type"
1168
+ t.integer "resource_export_file_size"
1218
1169
  t.datetime "resource_export_updated_at"
1219
1170
  t.datetime "executed_at"
1220
1171
  t.datetime "created_at"
@@ -1222,454 +1173,430 @@ ActiveRecord::Schema.define(version: 20180107161410) do
1222
1173
  end
1223
1174
 
1224
1175
  create_table "resource_import_file_transitions", force: :cascade do |t|
1225
- t.string "to_state"
1226
- t.text "metadata", default: "{}"
1227
- t.integer "sort_key"
1228
- t.integer "resource_import_file_id"
1176
+ t.string "to_state"
1177
+ t.text "metadata", default: "{}"
1178
+ t.integer "sort_key"
1179
+ t.integer "resource_import_file_id"
1229
1180
  t.datetime "created_at"
1230
1181
  t.datetime "updated_at"
1231
- t.boolean "most_recent", null: false
1182
+ t.boolean "most_recent", null: false
1183
+ t.index ["resource_import_file_id", "most_recent"], name: "index_resource_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1184
+ t.index ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
1185
+ t.index ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
1232
1186
  end
1233
1187
 
1234
- add_index "resource_import_file_transitions", ["resource_import_file_id", "most_recent"], name: "index_resource_import_file_transitions_parent_most_recent", unique: true
1235
- add_index "resource_import_file_transitions", ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
1236
- 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
1237
-
1238
1188
  create_table "resource_import_files", force: :cascade do |t|
1239
- t.integer "parent_id"
1240
- t.string "content_type"
1241
- t.integer "size"
1242
- t.integer "user_id"
1243
- t.text "note"
1189
+ t.integer "parent_id"
1190
+ t.string "content_type"
1191
+ t.integer "size"
1192
+ t.integer "user_id"
1193
+ t.text "note"
1244
1194
  t.datetime "executed_at"
1245
- t.string "resource_import_file_name"
1246
- t.string "resource_import_content_type"
1247
- t.integer "resource_import_file_size"
1195
+ t.string "resource_import_file_name"
1196
+ t.string "resource_import_content_type"
1197
+ t.integer "resource_import_file_size"
1248
1198
  t.datetime "resource_import_updated_at"
1249
1199
  t.datetime "created_at"
1250
1200
  t.datetime "updated_at"
1251
- t.string "edit_mode"
1252
- t.string "resource_import_fingerprint"
1253
- t.text "error_message"
1254
- t.string "user_encoding"
1255
- t.integer "default_shelf_id"
1201
+ t.string "edit_mode"
1202
+ t.string "resource_import_fingerprint"
1203
+ t.text "error_message"
1204
+ t.string "user_encoding"
1205
+ t.integer "default_shelf_id"
1206
+ t.index ["parent_id"], name: "index_resource_import_files_on_parent_id"
1207
+ t.index ["user_id"], name: "index_resource_import_files_on_user_id"
1256
1208
  end
1257
1209
 
1258
- add_index "resource_import_files", ["parent_id"], name: "index_resource_import_files_on_parent_id"
1259
- add_index "resource_import_files", ["user_id"], name: "index_resource_import_files_on_user_id"
1260
-
1261
1210
  create_table "resource_import_results", force: :cascade do |t|
1262
- t.integer "resource_import_file_id"
1263
- t.integer "manifestation_id"
1264
- t.integer "item_id"
1265
- t.text "body"
1211
+ t.integer "resource_import_file_id"
1212
+ t.integer "manifestation_id"
1213
+ t.integer "item_id"
1214
+ t.text "body"
1266
1215
  t.datetime "created_at"
1267
1216
  t.datetime "updated_at"
1268
- t.text "error_message"
1217
+ t.text "error_message"
1218
+ t.index ["item_id"], name: "index_resource_import_results_on_item_id"
1219
+ t.index ["manifestation_id"], name: "index_resource_import_results_on_manifestation_id"
1220
+ t.index ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
1269
1221
  end
1270
1222
 
1271
- add_index "resource_import_results", ["item_id"], name: "index_resource_import_results_on_item_id"
1272
- add_index "resource_import_results", ["manifestation_id"], name: "index_resource_import_results_on_manifestation_id"
1273
- add_index "resource_import_results", ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
1274
-
1275
1223
  create_table "roles", force: :cascade do |t|
1276
- t.string "name", null: false
1277
- t.string "display_name"
1278
- t.text "note"
1224
+ t.string "name", null: false
1225
+ t.string "display_name"
1226
+ t.text "note"
1279
1227
  t.datetime "created_at"
1280
1228
  t.datetime "updated_at"
1281
- t.integer "score", default: 0, null: false
1282
- t.integer "position"
1229
+ t.integer "score", default: 0, null: false
1230
+ t.integer "position"
1283
1231
  end
1284
1232
 
1285
1233
  create_table "search_engines", force: :cascade do |t|
1286
- t.string "name", null: false
1287
- t.text "display_name"
1288
- t.string "url", null: false
1289
- t.text "base_url", null: false
1290
- t.text "http_method", null: false
1291
- t.text "query_param", null: false
1292
- t.text "additional_param"
1293
- t.text "note"
1294
- t.integer "position"
1234
+ t.string "name", null: false
1235
+ t.text "display_name"
1236
+ t.string "url", null: false
1237
+ t.text "base_url", null: false
1238
+ t.text "http_method", null: false
1239
+ t.text "query_param", null: false
1240
+ t.text "additional_param"
1241
+ t.text "note"
1242
+ t.integer "position"
1295
1243
  t.datetime "created_at"
1296
1244
  t.datetime "updated_at"
1297
1245
  end
1298
1246
 
1299
1247
  create_table "series_statement_merge_lists", force: :cascade do |t|
1300
- t.string "title"
1248
+ t.string "title"
1301
1249
  t.datetime "created_at"
1302
1250
  t.datetime "updated_at"
1303
1251
  end
1304
1252
 
1305
1253
  create_table "series_statement_merges", force: :cascade do |t|
1306
- t.integer "series_statement_id", null: false
1307
- t.integer "series_statement_merge_list_id", null: false
1254
+ t.integer "series_statement_id", null: false
1255
+ t.integer "series_statement_merge_list_id", null: false
1308
1256
  t.datetime "created_at"
1309
1257
  t.datetime "updated_at"
1258
+ t.index ["series_statement_id"], name: "index_series_statement_merges_on_series_statement_id"
1259
+ t.index ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
1310
1260
  end
1311
1261
 
1312
- add_index "series_statement_merges", ["series_statement_id"], name: "index_series_statement_merges_on_series_statement_id"
1313
- add_index "series_statement_merges", ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
1314
-
1315
1262
  create_table "series_statements", force: :cascade do |t|
1316
- t.text "original_title"
1317
- t.text "numbering"
1318
- t.text "title_subseries"
1319
- t.text "numbering_subseries"
1320
- t.integer "position"
1321
- t.datetime "created_at"
1322
- t.datetime "updated_at"
1323
- t.text "title_transcription"
1324
- t.text "title_alternative"
1325
- t.string "series_statement_identifier"
1326
- t.integer "manifestation_id"
1327
- t.text "note"
1328
- t.text "title_subseries_transcription"
1329
- t.text "creator_string"
1330
- t.text "volume_number_string"
1331
- t.text "volume_number_transcription_string"
1332
- t.boolean "series_master"
1333
- t.integer "root_manifestation_id"
1334
- end
1335
-
1336
- add_index "series_statements", ["manifestation_id"], name: "index_series_statements_on_manifestation_id"
1337
- add_index "series_statements", ["root_manifestation_id"], name: "index_series_statements_on_root_manifestation_id"
1338
- add_index "series_statements", ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
1263
+ t.text "original_title"
1264
+ t.text "numbering"
1265
+ t.text "title_subseries"
1266
+ t.text "numbering_subseries"
1267
+ t.integer "position"
1268
+ t.datetime "created_at"
1269
+ t.datetime "updated_at"
1270
+ t.text "title_transcription"
1271
+ t.text "title_alternative"
1272
+ t.string "series_statement_identifier"
1273
+ t.integer "manifestation_id"
1274
+ t.text "note"
1275
+ t.text "title_subseries_transcription"
1276
+ t.text "creator_string"
1277
+ t.text "volume_number_string"
1278
+ t.text "volume_number_transcription_string"
1279
+ t.boolean "series_master"
1280
+ t.integer "root_manifestation_id"
1281
+ t.index ["manifestation_id"], name: "index_series_statements_on_manifestation_id"
1282
+ t.index ["root_manifestation_id"], name: "index_series_statements_on_root_manifestation_id"
1283
+ t.index ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
1284
+ end
1339
1285
 
1340
1286
  create_table "shelves", force: :cascade do |t|
1341
- t.string "name", null: false
1342
- t.text "display_name"
1343
- t.text "note"
1344
- t.integer "library_id", null: false
1345
- t.integer "items_count", default: 0, null: false
1346
- t.integer "position"
1287
+ t.string "name", null: false
1288
+ t.text "display_name"
1289
+ t.text "note"
1290
+ t.integer "library_id", null: false
1291
+ t.integer "items_count", default: 0, null: false
1292
+ t.integer "position"
1347
1293
  t.datetime "created_at"
1348
1294
  t.datetime "updated_at"
1349
1295
  t.datetime "deleted_at"
1350
- t.boolean "closed", default: false, null: false
1296
+ t.boolean "closed", default: false, null: false
1297
+ t.index ["library_id"], name: "index_shelves_on_library_id"
1351
1298
  end
1352
1299
 
1353
- add_index "shelves", ["library_id"], name: "index_shelves_on_library_id"
1354
-
1355
1300
  create_table "subject_heading_types", force: :cascade do |t|
1356
- t.string "name", null: false
1357
- t.text "display_name"
1358
- t.text "note"
1359
- t.integer "position"
1301
+ t.string "name", null: false
1302
+ t.text "display_name"
1303
+ t.text "note"
1304
+ t.integer "position"
1360
1305
  t.datetime "created_at"
1361
1306
  t.datetime "updated_at"
1362
1307
  end
1363
1308
 
1364
1309
  create_table "subject_types", force: :cascade do |t|
1365
- t.string "name", null: false
1366
- t.text "display_name"
1367
- t.text "note"
1368
- t.integer "position"
1310
+ t.string "name", null: false
1311
+ t.text "display_name"
1312
+ t.text "note"
1313
+ t.integer "position"
1369
1314
  t.datetime "created_at"
1370
1315
  t.datetime "updated_at"
1371
1316
  end
1372
1317
 
1373
1318
  create_table "subjects", force: :cascade do |t|
1374
- t.integer "parent_id"
1375
- t.integer "use_term_id"
1376
- t.string "term"
1377
- t.text "term_transcription"
1378
- t.integer "subject_type_id", null: false
1379
- t.text "scope_note"
1380
- t.text "note"
1381
- t.integer "required_role_id", default: 1, null: false
1382
- t.integer "lock_version", default: 0, null: false
1319
+ t.integer "parent_id"
1320
+ t.integer "use_term_id"
1321
+ t.string "term"
1322
+ t.text "term_transcription"
1323
+ t.integer "subject_type_id", null: false
1324
+ t.text "scope_note"
1325
+ t.text "note"
1326
+ t.integer "required_role_id", default: 1, null: false
1327
+ t.integer "lock_version", default: 0, null: false
1383
1328
  t.datetime "created_at"
1384
1329
  t.datetime "updated_at"
1385
1330
  t.datetime "deleted_at"
1386
- t.string "url"
1387
- t.integer "manifestation_id"
1388
- t.integer "subject_heading_type_id"
1331
+ t.string "url"
1332
+ t.integer "manifestation_id"
1333
+ t.integer "subject_heading_type_id"
1334
+ t.index ["manifestation_id"], name: "index_subjects_on_manifestation_id"
1335
+ t.index ["parent_id"], name: "index_subjects_on_parent_id"
1336
+ t.index ["required_role_id"], name: "index_subjects_on_required_role_id"
1337
+ t.index ["subject_type_id"], name: "index_subjects_on_subject_type_id"
1338
+ t.index ["term"], name: "index_subjects_on_term"
1339
+ t.index ["use_term_id"], name: "index_subjects_on_use_term_id"
1389
1340
  end
1390
1341
 
1391
- add_index "subjects", ["manifestation_id"], name: "index_subjects_on_manifestation_id"
1392
- add_index "subjects", ["parent_id"], name: "index_subjects_on_parent_id"
1393
- add_index "subjects", ["required_role_id"], name: "index_subjects_on_required_role_id"
1394
- add_index "subjects", ["subject_type_id"], name: "index_subjects_on_subject_type_id"
1395
- add_index "subjects", ["term"], name: "index_subjects_on_term"
1396
- add_index "subjects", ["use_term_id"], name: "index_subjects_on_use_term_id"
1397
-
1398
1342
  create_table "subscribes", force: :cascade do |t|
1399
- t.integer "subscription_id", null: false
1400
- t.integer "work_id", null: false
1401
- t.datetime "start_at", null: false
1402
- t.datetime "end_at", null: false
1343
+ t.integer "subscription_id", null: false
1344
+ t.integer "work_id", null: false
1345
+ t.datetime "start_at", null: false
1346
+ t.datetime "end_at", null: false
1403
1347
  t.datetime "created_at"
1404
1348
  t.datetime "updated_at"
1349
+ t.index ["subscription_id"], name: "index_subscribes_on_subscription_id"
1350
+ t.index ["work_id"], name: "index_subscribes_on_work_id"
1405
1351
  end
1406
1352
 
1407
- add_index "subscribes", ["subscription_id"], name: "index_subscribes_on_subscription_id"
1408
- add_index "subscribes", ["work_id"], name: "index_subscribes_on_work_id"
1409
-
1410
1353
  create_table "subscriptions", force: :cascade do |t|
1411
- t.text "title", null: false
1412
- t.text "note"
1413
- t.integer "user_id"
1414
- t.integer "order_list_id"
1354
+ t.text "title", null: false
1355
+ t.text "note"
1356
+ t.integer "user_id"
1357
+ t.integer "order_list_id"
1415
1358
  t.datetime "deleted_at"
1416
- t.integer "subscribes_count", default: 0, null: false
1359
+ t.integer "subscribes_count", default: 0, null: false
1417
1360
  t.datetime "created_at"
1418
1361
  t.datetime "updated_at"
1362
+ t.index ["order_list_id"], name: "index_subscriptions_on_order_list_id"
1363
+ t.index ["user_id"], name: "index_subscriptions_on_user_id"
1419
1364
  end
1420
1365
 
1421
- add_index "subscriptions", ["order_list_id"], name: "index_subscriptions_on_order_list_id"
1422
- add_index "subscriptions", ["user_id"], name: "index_subscriptions_on_user_id"
1423
-
1424
1366
  create_table "taggings", force: :cascade do |t|
1425
- t.integer "tag_id"
1426
- t.integer "taggable_id"
1427
- t.string "taggable_type"
1428
- t.integer "tagger_id"
1429
- t.string "tagger_type"
1430
- t.string "context"
1367
+ t.integer "tag_id"
1368
+ t.string "taggable_type"
1369
+ t.integer "taggable_id"
1370
+ t.string "tagger_type"
1371
+ t.integer "tagger_id"
1372
+ t.string "context"
1431
1373
  t.datetime "created_at"
1374
+ t.index ["tag_id"], name: "index_taggings_on_tag_id"
1375
+ t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
1432
1376
  end
1433
1377
 
1434
- add_index "taggings", ["tag_id"], name: "index_taggings_on_tag_id"
1435
- add_index "taggings", ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
1436
-
1437
1378
  create_table "tags", force: :cascade do |t|
1438
- t.string "name"
1439
- t.string "name_transcription"
1379
+ t.string "name"
1380
+ t.string "name_transcription"
1440
1381
  t.datetime "created_at"
1441
1382
  t.datetime "updated_at"
1442
1383
  end
1443
1384
 
1444
1385
  create_table "use_restrictions", force: :cascade do |t|
1445
- t.string "name", null: false
1446
- t.text "display_name"
1447
- t.text "note"
1448
- t.integer "position"
1386
+ t.string "name", null: false
1387
+ t.text "display_name"
1388
+ t.text "note"
1389
+ t.integer "position"
1449
1390
  t.datetime "created_at"
1450
1391
  t.datetime "updated_at"
1451
1392
  end
1452
1393
 
1453
1394
  create_table "user_checkout_stat_transitions", force: :cascade do |t|
1454
- t.string "to_state"
1455
- t.text "metadata", default: "{}"
1456
- t.integer "sort_key"
1457
- t.integer "user_checkout_stat_id"
1395
+ t.string "to_state"
1396
+ t.text "metadata", default: "{}"
1397
+ t.integer "sort_key"
1398
+ t.integer "user_checkout_stat_id"
1458
1399
  t.datetime "created_at"
1459
1400
  t.datetime "updated_at"
1401
+ t.index ["sort_key", "user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_sort_key_and_stat_id", unique: true
1402
+ t.index ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
1460
1403
  end
1461
1404
 
1462
- 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
1463
- add_index "user_checkout_stat_transitions", ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
1464
-
1465
1405
  create_table "user_checkout_stats", force: :cascade do |t|
1466
1406
  t.datetime "start_date"
1467
1407
  t.datetime "end_date"
1468
- t.text "note"
1408
+ t.text "note"
1469
1409
  t.datetime "created_at"
1470
1410
  t.datetime "updated_at"
1471
1411
  t.datetime "started_at"
1472
1412
  t.datetime "completed_at"
1473
- t.integer "user_id"
1413
+ t.integer "user_id"
1414
+ t.index ["user_id"], name: "index_user_checkout_stats_on_user_id"
1474
1415
  end
1475
1416
 
1476
- add_index "user_checkout_stats", ["user_id"], name: "index_user_checkout_stats_on_user_id"
1477
-
1478
1417
  create_table "user_export_file_transitions", force: :cascade do |t|
1479
- t.string "to_state"
1480
- t.text "metadata", default: "{}"
1481
- t.integer "sort_key"
1482
- t.integer "user_export_file_id"
1418
+ t.string "to_state"
1419
+ t.text "metadata", default: "{}"
1420
+ t.integer "sort_key"
1421
+ t.integer "user_export_file_id"
1483
1422
  t.datetime "created_at"
1484
1423
  t.datetime "updated_at"
1485
- t.boolean "most_recent", null: false
1424
+ t.boolean "most_recent", null: false
1425
+ t.index ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
1426
+ t.index ["user_export_file_id", "most_recent"], name: "index_user_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1427
+ t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_file_id"
1428
+ t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
1486
1429
  end
1487
1430
 
1488
- 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
1489
- add_index "user_export_file_transitions", ["user_export_file_id", "most_recent"], name: "index_user_export_file_transitions_parent_most_recent", unique: true
1490
- add_index "user_export_file_transitions", ["user_export_file_id"], name: "index_user_export_file_transitions_on_file_id"
1491
- add_index "user_export_file_transitions", ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
1492
-
1493
1431
  create_table "user_export_files", force: :cascade do |t|
1494
- t.integer "user_id"
1495
- t.string "user_export_file_name"
1496
- t.string "user_export_content_type"
1497
- t.integer "user_export_file_size"
1432
+ t.integer "user_id"
1433
+ t.string "user_export_file_name"
1434
+ t.string "user_export_content_type"
1435
+ t.integer "user_export_file_size"
1498
1436
  t.datetime "user_export_updated_at"
1499
1437
  t.datetime "executed_at"
1500
1438
  t.datetime "created_at"
1501
1439
  t.datetime "updated_at"
1440
+ t.index ["user_id"], name: "index_user_export_files_on_user_id"
1502
1441
  end
1503
1442
 
1504
- add_index "user_export_files", ["user_id"], name: "index_user_export_files_on_user_id"
1505
-
1506
1443
  create_table "user_group_has_checkout_types", force: :cascade do |t|
1507
- t.integer "user_group_id", null: false
1508
- t.integer "checkout_type_id", null: false
1509
- t.integer "checkout_limit", default: 0, null: false
1510
- t.integer "checkout_period", default: 0, null: false
1511
- t.integer "checkout_renewal_limit", default: 0, null: false
1512
- t.integer "reservation_limit", default: 0, null: false
1513
- t.integer "reservation_expired_period", default: 7, null: false
1514
- t.boolean "set_due_date_before_closing_day", default: false, null: false
1444
+ t.integer "user_group_id", null: false
1445
+ t.integer "checkout_type_id", null: false
1446
+ t.integer "checkout_limit", default: 0, null: false
1447
+ t.integer "checkout_period", default: 0, null: false
1448
+ t.integer "checkout_renewal_limit", default: 0, null: false
1449
+ t.integer "reservation_limit", default: 0, null: false
1450
+ t.integer "reservation_expired_period", default: 7, null: false
1451
+ t.boolean "set_due_date_before_closing_day", default: false, null: false
1515
1452
  t.datetime "fixed_due_date"
1516
- t.text "note"
1517
- t.integer "position"
1453
+ t.text "note"
1454
+ t.integer "position"
1518
1455
  t.datetime "created_at"
1519
1456
  t.datetime "updated_at"
1520
- t.integer "current_checkout_count"
1457
+ t.integer "current_checkout_count"
1458
+ t.index ["checkout_type_id"], name: "index_user_group_has_checkout_types_on_checkout_type_id"
1459
+ t.index ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1521
1460
  end
1522
1461
 
1523
- add_index "user_group_has_checkout_types", ["checkout_type_id"], name: "index_user_group_has_checkout_types_on_checkout_type_id"
1524
- add_index "user_group_has_checkout_types", ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1525
-
1526
1462
  create_table "user_groups", force: :cascade do |t|
1527
- t.string "name"
1528
- t.text "display_name"
1529
- t.text "note"
1530
- t.integer "position"
1463
+ t.string "name"
1464
+ t.text "display_name"
1465
+ t.text "note"
1466
+ t.integer "position"
1531
1467
  t.datetime "created_at"
1532
1468
  t.datetime "updated_at"
1533
1469
  t.datetime "deleted_at"
1534
- t.integer "valid_period_for_new_user", default: 0, null: false
1470
+ t.integer "valid_period_for_new_user", default: 0, null: false
1535
1471
  t.datetime "expired_at"
1536
- t.integer "number_of_day_to_notify_overdue", default: 1, null: false
1537
- t.integer "number_of_day_to_notify_due_date", default: 7, null: false
1538
- t.integer "number_of_time_to_notify_overdue", default: 3, null: false
1472
+ t.integer "number_of_day_to_notify_overdue", default: 1, null: false
1473
+ t.integer "number_of_day_to_notify_due_date", default: 7, null: false
1474
+ t.integer "number_of_time_to_notify_overdue", default: 3, null: false
1539
1475
  end
1540
1476
 
1541
1477
  create_table "user_has_roles", force: :cascade do |t|
1542
- t.integer "user_id"
1543
- t.integer "role_id"
1478
+ t.integer "user_id"
1479
+ t.integer "role_id"
1544
1480
  t.datetime "created_at"
1545
1481
  t.datetime "updated_at"
1482
+ t.index ["role_id"], name: "index_user_has_roles_on_role_id"
1483
+ t.index ["user_id"], name: "index_user_has_roles_on_user_id"
1546
1484
  end
1547
1485
 
1548
- add_index "user_has_roles", ["role_id"], name: "index_user_has_roles_on_role_id"
1549
- add_index "user_has_roles", ["user_id"], name: "index_user_has_roles_on_user_id"
1550
-
1551
1486
  create_table "user_import_file_transitions", force: :cascade do |t|
1552
- t.string "to_state"
1553
- t.text "metadata", default: "{}"
1554
- t.integer "sort_key"
1555
- t.integer "user_import_file_id"
1487
+ t.string "to_state"
1488
+ t.text "metadata", default: "{}"
1489
+ t.integer "sort_key"
1490
+ t.integer "user_import_file_id"
1556
1491
  t.datetime "created_at"
1557
1492
  t.datetime "updated_at"
1558
- t.boolean "most_recent", null: false
1493
+ t.boolean "most_recent", null: false
1494
+ t.index ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
1495
+ t.index ["user_import_file_id", "most_recent"], name: "index_user_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1496
+ t.index ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
1559
1497
  end
1560
1498
 
1561
- 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
1562
- add_index "user_import_file_transitions", ["user_import_file_id", "most_recent"], name: "index_user_import_file_transitions_parent_most_recent", unique: true
1563
- add_index "user_import_file_transitions", ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
1564
-
1565
1499
  create_table "user_import_files", force: :cascade do |t|
1566
- t.integer "user_id"
1567
- t.text "note"
1500
+ t.integer "user_id"
1501
+ t.text "note"
1568
1502
  t.datetime "executed_at"
1569
- t.string "user_import_file_name"
1570
- t.string "user_import_content_type"
1571
- t.integer "user_import_file_size"
1503
+ t.string "user_import_file_name"
1504
+ t.string "user_import_content_type"
1505
+ t.integer "user_import_file_size"
1572
1506
  t.datetime "user_import_updated_at"
1573
- t.string "user_import_fingerprint"
1574
- t.string "edit_mode"
1575
- t.text "error_message"
1507
+ t.string "user_import_fingerprint"
1508
+ t.string "edit_mode"
1509
+ t.text "error_message"
1576
1510
  t.datetime "created_at"
1577
1511
  t.datetime "updated_at"
1578
- t.string "user_encoding"
1579
- t.integer "default_library_id"
1580
- t.integer "default_user_group_id"
1512
+ t.string "user_encoding"
1513
+ t.integer "default_library_id"
1514
+ t.integer "default_user_group_id"
1515
+ t.index ["user_id"], name: "index_user_import_files_on_user_id"
1581
1516
  end
1582
1517
 
1583
- add_index "user_import_files", ["user_id"], name: "index_user_import_files_on_user_id"
1584
-
1585
1518
  create_table "user_import_results", force: :cascade do |t|
1586
- t.integer "user_import_file_id"
1587
- t.integer "user_id"
1588
- t.text "body"
1519
+ t.integer "user_import_file_id"
1520
+ t.integer "user_id"
1521
+ t.text "body"
1589
1522
  t.datetime "created_at"
1590
1523
  t.datetime "updated_at"
1591
- t.text "error_message"
1524
+ t.text "error_message"
1525
+ t.index ["user_id"], name: "index_user_import_results_on_user_id"
1526
+ t.index ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
1592
1527
  end
1593
1528
 
1594
- add_index "user_import_results", ["user_id"], name: "index_user_import_results_on_user_id"
1595
- add_index "user_import_results", ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
1596
-
1597
1529
  create_table "user_reserve_stat_transitions", force: :cascade do |t|
1598
- t.string "to_state"
1599
- t.text "metadata", default: "{}"
1600
- t.integer "sort_key"
1601
- t.integer "user_reserve_stat_id"
1530
+ t.string "to_state"
1531
+ t.text "metadata", default: "{}"
1532
+ t.integer "sort_key"
1533
+ t.integer "user_reserve_stat_id"
1602
1534
  t.datetime "created_at"
1603
1535
  t.datetime "updated_at"
1536
+ t.index ["sort_key", "user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_sort_key_and_stat_id", unique: true
1537
+ t.index ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
1604
1538
  end
1605
1539
 
1606
- 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
1607
- add_index "user_reserve_stat_transitions", ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
1608
-
1609
1540
  create_table "user_reserve_stats", force: :cascade do |t|
1610
1541
  t.datetime "start_date"
1611
1542
  t.datetime "end_date"
1612
- t.text "note"
1543
+ t.text "note"
1613
1544
  t.datetime "created_at"
1614
1545
  t.datetime "updated_at"
1615
1546
  t.datetime "started_at"
1616
1547
  t.datetime "completed_at"
1617
- t.integer "user_id"
1548
+ t.integer "user_id"
1549
+ t.index ["user_id"], name: "index_user_reserve_stats_on_user_id"
1618
1550
  end
1619
1551
 
1620
- add_index "user_reserve_stats", ["user_id"], name: "index_user_reserve_stats_on_user_id"
1621
-
1622
1552
  create_table "users", force: :cascade do |t|
1623
- t.string "email", default: "", null: false
1624
- t.string "encrypted_password", default: "", null: false
1625
- t.string "reset_password_token"
1553
+ t.string "email", default: "", null: false
1554
+ t.string "encrypted_password", default: "", null: false
1555
+ t.string "reset_password_token"
1626
1556
  t.datetime "reset_password_sent_at"
1627
1557
  t.datetime "remember_created_at"
1628
- t.integer "sign_in_count", default: 0
1558
+ t.integer "sign_in_count", default: 0
1629
1559
  t.datetime "current_sign_in_at"
1630
1560
  t.datetime "last_sign_in_at"
1631
- t.string "current_sign_in_ip"
1632
- t.string "last_sign_in_ip"
1561
+ t.string "current_sign_in_ip"
1562
+ t.string "last_sign_in_ip"
1633
1563
  t.datetime "created_at"
1634
1564
  t.datetime "updated_at"
1635
- t.boolean "save_checkout_history", default: false, null: false
1636
- t.string "checkout_icalendar_token"
1637
- t.string "username"
1565
+ t.boolean "save_checkout_history", default: false, null: false
1566
+ t.string "checkout_icalendar_token"
1567
+ t.string "username"
1638
1568
  t.datetime "deleted_at"
1639
1569
  t.datetime "expired_at"
1640
- t.integer "failed_attempts", default: 0
1641
- t.string "unlock_token"
1570
+ t.integer "failed_attempts", default: 0
1571
+ t.string "unlock_token"
1642
1572
  t.datetime "locked_at"
1643
1573
  t.datetime "confirmed_at"
1574
+ t.index ["checkout_icalendar_token"], name: "index_users_on_checkout_icalendar_token", unique: true
1575
+ t.index ["email"], name: "index_users_on_email"
1576
+ t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
1577
+ t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
1578
+ t.index ["username"], name: "index_users_on_username", unique: true
1644
1579
  end
1645
1580
 
1646
- add_index "users", ["checkout_icalendar_token"], name: "index_users_on_checkout_icalendar_token", unique: true
1647
- add_index "users", ["email"], name: "index_users_on_email"
1648
- add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
1649
- add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", unique: true
1650
- add_index "users", ["username"], name: "index_users_on_username", unique: true
1651
-
1652
1581
  create_table "versions", force: :cascade do |t|
1653
- t.string "item_type", null: false
1654
- t.integer "item_id", null: false
1655
- t.string "event", null: false
1656
- t.string "whodunnit"
1657
- t.text "object"
1582
+ t.string "item_type", null: false
1583
+ t.integer "item_id", null: false
1584
+ t.string "event", null: false
1585
+ t.string "whodunnit"
1586
+ t.text "object"
1658
1587
  t.datetime "created_at"
1588
+ t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
1659
1589
  end
1660
1590
 
1661
- add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
1662
-
1663
1591
  create_table "withdraws", force: :cascade do |t|
1664
- t.integer "basket_id"
1665
- t.integer "item_id"
1666
- t.integer "librarian_id"
1667
- t.datetime "created_at", null: false
1668
- t.datetime "updated_at", null: false
1592
+ t.integer "basket_id"
1593
+ t.integer "item_id"
1594
+ t.integer "librarian_id"
1595
+ t.datetime "created_at", null: false
1596
+ t.datetime "updated_at", null: false
1597
+ t.index ["basket_id"], name: "index_withdraws_on_basket_id"
1598
+ t.index ["item_id"], name: "index_withdraws_on_item_id"
1599
+ t.index ["librarian_id"], name: "index_withdraws_on_librarian_id"
1669
1600
  end
1670
1601
 
1671
- add_index "withdraws", ["basket_id"], name: "index_withdraws_on_basket_id"
1672
- add_index "withdraws", ["item_id"], name: "index_withdraws_on_item_id"
1673
- add_index "withdraws", ["librarian_id"], name: "index_withdraws_on_librarian_id"
1674
-
1675
1602
  end