enju_ndl 0.3.3 → 0.4.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +2 -7
  4. data/Rakefile +24 -13
  5. data/app/models/concerns/enju_ndl/enju_agent.rb +12 -0
  6. data/{lib/enju_ndl/ndl_search.rb → app/models/concerns/enju_ndl/enju_manifestation.rb} +40 -34
  7. data/{lib/enju_ndl/crd.rb → app/models/concerns/enju_ndl/enju_question.rb} +12 -9
  8. data/app/models/jpno_record.rb +14 -0
  9. data/app/models/ndl_bib_id_record.rb +14 -0
  10. data/app/models/ndl_book.rb +2 -2
  11. data/app/models/ndla_record.rb +14 -0
  12. data/db/migrate/20170116150432_create_jpno_records.rb +10 -0
  13. data/db/migrate/20171126072934_create_ndla_records.rb +10 -0
  14. data/db/migrate/20190501043418_create_ndl_bib_id_records.rb +10 -0
  15. data/lib/enju_ndl/version.rb +1 -1
  16. data/lib/enju_ndl.rb +1 -21
  17. data/spec/dummy/app/models/user.rb +5 -1
  18. data/spec/dummy/bin/bundle +1 -1
  19. data/spec/dummy/bin/setup +1 -3
  20. data/spec/dummy/bin/update +4 -2
  21. data/spec/dummy/bin/yarn +3 -3
  22. data/spec/dummy/config/application.rb +2 -1
  23. data/spec/dummy/config/database.yml +70 -9
  24. data/spec/dummy/config/initializers/assets.rb +1 -1
  25. data/spec/dummy/config/initializers/session_store.rb +8 -0
  26. data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +2 -4
  27. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +4 -5
  28. data/spec/dummy/db/migrate/20190630113817_add_display_name_translations_to_library_group.rb +12 -0
  29. data/spec/dummy/db/migrate/20190630115523_add_login_banner_translations_to_library_group.rb +6 -0
  30. data/spec/dummy/db/migrate/20190630151446_add_display_name_translations_to_role.rb +5 -0
  31. data/spec/dummy/db/migrate/20190712163038_add_display_name_translations_to_carrier_type.rb +21 -0
  32. data/spec/dummy/db/migrate/20190713114940_add_profile_id_to_user.rb +5 -0
  33. data/spec/dummy/db/migrate/20190713115451_add_full_name_translations_to_profile.rb +5 -0
  34. data/spec/dummy/db/schema.rb +195 -147
  35. data/spec/dummy/db/test.sqlite3 +0 -0
  36. data/spec/fixtures/agent_types.yml +10 -11
  37. data/spec/fixtures/carrier_types.yml +28 -24
  38. data/spec/fixtures/frequencies.yml +17 -25
  39. data/spec/fixtures/profiles.yml +9 -12
  40. data/spec/fixtures/roles.yml +16 -13
  41. data/spec/fixtures/users.yml +7 -0
  42. data/spec/rails_helper.rb +5 -1
  43. metadata +360 -428
  44. data/app/assets/config/enju_ndl_manifest.js +0 -0
  45. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +0 -5
  46. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +0 -5
  47. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +0 -12
@@ -10,9 +10,13 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2019_12_19_122214) do
13
+ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
14
14
 
15
- create_table "accepts", force: :cascade do |t|
15
+ # These are extensions that must be enabled in order to support this database
16
+ enable_extension "pgcrypto"
17
+ enable_extension "plpgsql"
18
+
19
+ create_table "accepts", id: :serial, force: :cascade do |t|
16
20
  t.integer "basket_id"
17
21
  t.integer "item_id"
18
22
  t.integer "librarian_id"
@@ -23,7 +27,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
23
27
  t.index ["librarian_id"], name: "index_accepts_on_librarian_id"
24
28
  end
25
29
 
26
- create_table "agent_import_file_transitions", force: :cascade do |t|
30
+ create_table "agent_import_file_transitions", id: :serial, force: :cascade do |t|
27
31
  t.string "to_state"
28
32
  t.text "metadata", default: "{}"
29
33
  t.integer "sort_key"
@@ -36,7 +40,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
36
40
  t.index ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
37
41
  end
38
42
 
39
- create_table "agent_import_files", force: :cascade do |t|
43
+ create_table "agent_import_files", id: :serial, force: :cascade do |t|
40
44
  t.integer "parent_id"
41
45
  t.string "content_type"
42
46
  t.integer "size"
@@ -57,7 +61,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
57
61
  t.index ["user_id"], name: "index_agent_import_files_on_user_id"
58
62
  end
59
63
 
60
- create_table "agent_import_results", force: :cascade do |t|
64
+ create_table "agent_import_results", id: :serial, force: :cascade do |t|
61
65
  t.integer "agent_import_file_id"
62
66
  t.integer "agent_id"
63
67
  t.text "body"
@@ -65,13 +69,13 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
65
69
  t.datetime "updated_at"
66
70
  end
67
71
 
68
- create_table "agent_merge_lists", force: :cascade do |t|
72
+ create_table "agent_merge_lists", id: :serial, force: :cascade do |t|
69
73
  t.string "title"
70
74
  t.datetime "created_at"
71
75
  t.datetime "updated_at"
72
76
  end
73
77
 
74
- create_table "agent_merges", force: :cascade do |t|
78
+ create_table "agent_merges", id: :serial, force: :cascade do |t|
75
79
  t.integer "agent_id", null: false
76
80
  t.integer "agent_merge_list_id", null: false
77
81
  t.datetime "created_at"
@@ -80,16 +84,17 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
80
84
  t.index ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
81
85
  end
82
86
 
83
- create_table "agent_relationship_types", force: :cascade do |t|
87
+ create_table "agent_relationship_types", id: :serial, force: :cascade do |t|
84
88
  t.string "name", null: false
85
89
  t.text "display_name"
86
90
  t.text "note"
87
91
  t.integer "position"
88
92
  t.datetime "created_at"
89
93
  t.datetime "updated_at"
94
+ t.jsonb "display_name_translations", default: {}, null: false
90
95
  end
91
96
 
92
- create_table "agent_relationships", force: :cascade do |t|
97
+ create_table "agent_relationships", id: :serial, force: :cascade do |t|
93
98
  t.integer "parent_id"
94
99
  t.integer "child_id"
95
100
  t.integer "agent_relationship_type_id"
@@ -100,16 +105,17 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
100
105
  t.index ["parent_id"], name: "index_agent_relationships_on_parent_id"
101
106
  end
102
107
 
103
- create_table "agent_types", force: :cascade do |t|
108
+ create_table "agent_types", id: :serial, force: :cascade do |t|
104
109
  t.string "name", null: false
105
110
  t.text "display_name"
106
111
  t.text "note"
107
112
  t.integer "position"
108
113
  t.datetime "created_at"
109
114
  t.datetime "updated_at"
115
+ t.jsonb "display_name_translations", default: {}, null: false
110
116
  end
111
117
 
112
- create_table "agents", force: :cascade do |t|
118
+ create_table "agents", id: :serial, force: :cascade do |t|
113
119
  t.string "last_name"
114
120
  t.string "middle_name"
115
121
  t.string "first_name"
@@ -164,7 +170,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
164
170
  t.index ["required_role_id"], name: "index_agents_on_required_role_id"
165
171
  end
166
172
 
167
- create_table "baskets", force: :cascade do |t|
173
+ create_table "baskets", id: :serial, force: :cascade do |t|
168
174
  t.integer "user_id"
169
175
  t.text "note"
170
176
  t.integer "lock_version", default: 0, null: false
@@ -173,7 +179,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
173
179
  t.index ["user_id"], name: "index_baskets_on_user_id"
174
180
  end
175
181
 
176
- create_table "bookmark_stat_has_manifestations", force: :cascade do |t|
182
+ create_table "bookmark_stat_has_manifestations", id: :serial, force: :cascade do |t|
177
183
  t.integer "bookmark_stat_id", null: false
178
184
  t.integer "manifestation_id", null: false
179
185
  t.integer "bookmarks_count"
@@ -183,7 +189,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
183
189
  t.index ["manifestation_id"], name: "index_bookmark_stat_has_manifestations_on_manifestation_id"
184
190
  end
185
191
 
186
- create_table "bookmark_stat_transitions", force: :cascade do |t|
192
+ create_table "bookmark_stat_transitions", id: :serial, force: :cascade do |t|
187
193
  t.string "to_state"
188
194
  t.text "metadata", default: "{}"
189
195
  t.integer "sort_key"
@@ -194,7 +200,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
194
200
  t.index ["sort_key", "bookmark_stat_id"], name: "index_bookmark_stat_transitions_on_sort_key_and_stat_id", unique: true
195
201
  end
196
202
 
197
- create_table "bookmark_stats", force: :cascade do |t|
203
+ create_table "bookmark_stats", id: :serial, force: :cascade do |t|
198
204
  t.datetime "start_date"
199
205
  t.datetime "end_date"
200
206
  t.datetime "started_at"
@@ -204,7 +210,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
204
210
  t.datetime "updated_at"
205
211
  end
206
212
 
207
- create_table "bookmarks", force: :cascade do |t|
213
+ create_table "bookmarks", id: :serial, force: :cascade do |t|
208
214
  t.integer "user_id", null: false
209
215
  t.integer "manifestation_id"
210
216
  t.text "title"
@@ -218,7 +224,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
218
224
  t.index ["user_id"], name: "index_bookmarks_on_user_id"
219
225
  end
220
226
 
221
- create_table "bookstores", force: :cascade do |t|
227
+ create_table "bookstores", id: :serial, force: :cascade do |t|
222
228
  t.text "name", null: false
223
229
  t.string "zip_code"
224
230
  t.text "address"
@@ -232,16 +238,17 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
232
238
  t.datetime "updated_at"
233
239
  end
234
240
 
235
- create_table "budget_types", force: :cascade do |t|
241
+ create_table "budget_types", id: :serial, force: :cascade do |t|
236
242
  t.string "name"
237
243
  t.text "display_name"
238
244
  t.text "note"
239
245
  t.integer "position"
240
246
  t.datetime "created_at"
241
247
  t.datetime "updated_at"
248
+ t.jsonb "display_name_translations", default: {}, null: false
242
249
  end
243
250
 
244
- create_table "carrier_type_has_checkout_types", force: :cascade do |t|
251
+ create_table "carrier_type_has_checkout_types", id: :serial, force: :cascade do |t|
245
252
  t.integer "carrier_type_id", null: false
246
253
  t.integer "checkout_type_id", null: false
247
254
  t.text "note"
@@ -252,7 +259,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
252
259
  t.index ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
253
260
  end
254
261
 
255
- create_table "carrier_types", force: :cascade do |t|
262
+ create_table "carrier_types", id: :serial, force: :cascade do |t|
256
263
  t.string "name", null: false
257
264
  t.text "display_name"
258
265
  t.text "note"
@@ -261,11 +268,12 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
261
268
  t.datetime "updated_at"
262
269
  t.string "attachment_file_name"
263
270
  t.string "attachment_content_type"
264
- t.integer "attachment_file_size"
271
+ t.bigint "attachment_file_size"
265
272
  t.datetime "attachment_updated_at"
273
+ t.jsonb "display_name_translations", default: {}, null: false
266
274
  end
267
275
 
268
- create_table "checked_items", force: :cascade do |t|
276
+ create_table "checked_items", id: :serial, force: :cascade do |t|
269
277
  t.integer "item_id", null: false
270
278
  t.integer "basket_id", null: false
271
279
  t.datetime "due_date", null: false
@@ -276,7 +284,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
276
284
  t.index ["item_id"], name: "index_checked_items_on_item_id"
277
285
  end
278
286
 
279
- create_table "checkins", force: :cascade do |t|
287
+ create_table "checkins", id: :serial, force: :cascade do |t|
280
288
  t.integer "item_id", null: false
281
289
  t.integer "librarian_id"
282
290
  t.integer "basket_id"
@@ -288,7 +296,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
288
296
  t.index ["librarian_id"], name: "index_checkins_on_librarian_id"
289
297
  end
290
298
 
291
- create_table "checkout_stat_has_manifestations", force: :cascade do |t|
299
+ create_table "checkout_stat_has_manifestations", id: :serial, force: :cascade do |t|
292
300
  t.integer "manifestation_checkout_stat_id", null: false
293
301
  t.integer "manifestation_id", null: false
294
302
  t.integer "checkouts_count"
@@ -298,7 +306,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
298
306
  t.index ["manifestation_id"], name: "index_checkout_stat_has_manifestations_on_manifestation_id"
299
307
  end
300
308
 
301
- create_table "checkout_stat_has_users", force: :cascade do |t|
309
+ create_table "checkout_stat_has_users", id: :serial, force: :cascade do |t|
302
310
  t.integer "user_checkout_stat_id", null: false
303
311
  t.integer "user_id", null: false
304
312
  t.integer "checkouts_count", default: 0, null: false
@@ -308,7 +316,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
308
316
  t.index ["user_id"], name: "index_checkout_stat_has_users_on_user_id"
309
317
  end
310
318
 
311
- create_table "checkout_types", force: :cascade do |t|
319
+ create_table "checkout_types", id: :serial, force: :cascade do |t|
312
320
  t.string "name", null: false
313
321
  t.text "display_name"
314
322
  t.text "note"
@@ -318,7 +326,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
318
326
  t.index ["name"], name: "index_checkout_types_on_name"
319
327
  end
320
328
 
321
- create_table "checkouts", force: :cascade do |t|
329
+ create_table "checkouts", id: :serial, force: :cascade do |t|
322
330
  t.integer "user_id"
323
331
  t.integer "item_id", null: false
324
332
  t.integer "checkin_id"
@@ -339,7 +347,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
339
347
  t.index ["user_id"], name: "index_checkouts_on_user_id"
340
348
  end
341
349
 
342
- create_table "circulation_statuses", force: :cascade do |t|
350
+ create_table "circulation_statuses", id: :serial, force: :cascade do |t|
343
351
  t.string "name", null: false
344
352
  t.text "display_name"
345
353
  t.text "note"
@@ -348,7 +356,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
348
356
  t.datetime "updated_at"
349
357
  end
350
358
 
351
- create_table "classification_types", force: :cascade do |t|
359
+ create_table "classification_types", id: :serial, force: :cascade do |t|
352
360
  t.string "name", null: false
353
361
  t.text "display_name"
354
362
  t.text "note"
@@ -357,7 +365,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
357
365
  t.datetime "updated_at"
358
366
  end
359
367
 
360
- create_table "classifications", force: :cascade do |t|
368
+ create_table "classifications", id: :serial, force: :cascade do |t|
361
369
  t.integer "parent_id"
362
370
  t.string "category", null: false
363
371
  t.text "note"
@@ -373,7 +381,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
373
381
  t.index ["parent_id"], name: "index_classifications_on_parent_id"
374
382
  end
375
383
 
376
- create_table "colors", force: :cascade do |t|
384
+ create_table "colors", id: :serial, force: :cascade do |t|
377
385
  t.integer "library_group_id"
378
386
  t.string "property"
379
387
  t.string "code"
@@ -383,16 +391,17 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
383
391
  t.index ["library_group_id"], name: "index_colors_on_library_group_id"
384
392
  end
385
393
 
386
- create_table "content_types", force: :cascade do |t|
394
+ create_table "content_types", id: :serial, force: :cascade do |t|
387
395
  t.string "name", null: false
388
396
  t.text "display_name"
389
397
  t.text "note"
390
398
  t.integer "position"
391
399
  t.datetime "created_at"
392
400
  t.datetime "updated_at"
401
+ t.jsonb "display_name_translations", default: {}, null: false
393
402
  end
394
403
 
395
- create_table "countries", force: :cascade do |t|
404
+ create_table "countries", id: :serial, force: :cascade do |t|
396
405
  t.string "name", null: false
397
406
  t.text "display_name"
398
407
  t.string "alpha_2"
@@ -406,16 +415,17 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
406
415
  t.index ["numeric_3"], name: "index_countries_on_numeric_3"
407
416
  end
408
417
 
409
- create_table "create_types", force: :cascade do |t|
418
+ create_table "create_types", id: :serial, force: :cascade do |t|
410
419
  t.string "name"
411
420
  t.text "display_name"
412
421
  t.text "note"
413
422
  t.integer "position"
414
423
  t.datetime "created_at"
415
424
  t.datetime "updated_at"
425
+ t.jsonb "display_name_translations", default: {}, null: false
416
426
  end
417
427
 
418
- create_table "creates", force: :cascade do |t|
428
+ create_table "creates", id: :serial, force: :cascade do |t|
419
429
  t.integer "agent_id", null: false
420
430
  t.integer "work_id", null: false
421
431
  t.integer "position"
@@ -426,16 +436,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
426
436
  t.index ["work_id"], name: "index_creates_on_work_id"
427
437
  end
428
438
 
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
437
-
438
- create_table "donates", force: :cascade do |t|
439
+ create_table "donates", id: :serial, force: :cascade do |t|
439
440
  t.integer "agent_id", null: false
440
441
  t.integer "item_id", null: false
441
442
  t.datetime "created_at"
@@ -444,7 +445,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
444
445
  t.index ["item_id"], name: "index_donates_on_item_id"
445
446
  end
446
447
 
447
- create_table "event_categories", force: :cascade do |t|
448
+ create_table "event_categories", id: :serial, force: :cascade do |t|
448
449
  t.string "name", null: false
449
450
  t.text "display_name"
450
451
  t.text "note"
@@ -453,7 +454,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
453
454
  t.datetime "updated_at"
454
455
  end
455
456
 
456
- create_table "event_export_file_transitions", force: :cascade do |t|
457
+ create_table "event_export_file_transitions", id: :serial, force: :cascade do |t|
457
458
  t.string "to_state"
458
459
  t.text "metadata", default: "{}"
459
460
  t.integer "sort_key"
@@ -464,18 +465,18 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
464
465
  t.index ["sort_key", "event_export_file_id"], name: "index_event_export_file_transitions_on_sort_key_and_file_id", unique: true
465
466
  end
466
467
 
467
- create_table "event_export_files", force: :cascade do |t|
468
+ create_table "event_export_files", id: :serial, force: :cascade do |t|
468
469
  t.integer "user_id"
469
470
  t.string "event_export_file_name"
470
471
  t.string "event_export_content_type"
471
- t.integer "event_export_file_size"
472
+ t.bigint "event_export_file_size"
472
473
  t.datetime "event_export_updated_at"
473
474
  t.datetime "executed_at"
474
475
  t.datetime "created_at"
475
476
  t.datetime "updated_at"
476
477
  end
477
478
 
478
- create_table "event_import_file_transitions", force: :cascade do |t|
479
+ create_table "event_import_file_transitions", id: :serial, force: :cascade do |t|
479
480
  t.string "to_state"
480
481
  t.text "metadata", default: "{}"
481
482
  t.integer "sort_key"
@@ -486,7 +487,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
486
487
  t.index ["sort_key", "event_import_file_id"], name: "index_event_import_file_transitions_on_sort_key_and_file_id", unique: true
487
488
  end
488
489
 
489
- create_table "event_import_files", force: :cascade do |t|
490
+ create_table "event_import_files", id: :serial, force: :cascade do |t|
490
491
  t.integer "parent_id"
491
492
  t.string "content_type"
492
493
  t.integer "size"
@@ -509,7 +510,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
509
510
  t.index ["user_id"], name: "index_event_import_files_on_user_id"
510
511
  end
511
512
 
512
- create_table "event_import_results", force: :cascade do |t|
513
+ create_table "event_import_results", id: :serial, force: :cascade do |t|
513
514
  t.integer "event_import_file_id"
514
515
  t.integer "event_id"
515
516
  t.text "body"
@@ -517,7 +518,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
517
518
  t.datetime "updated_at"
518
519
  end
519
520
 
520
- create_table "events", force: :cascade do |t|
521
+ create_table "events", id: :serial, force: :cascade do |t|
521
522
  t.integer "library_id", null: false
522
523
  t.integer "event_category_id", null: false
523
524
  t.string "name"
@@ -533,7 +534,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
533
534
  t.index ["library_id"], name: "index_events_on_library_id"
534
535
  end
535
536
 
536
- create_table "exemplifies", force: :cascade do |t|
537
+ create_table "exemplifies", id: :serial, force: :cascade do |t|
537
538
  t.integer "manifestation_id", null: false
538
539
  t.integer "item_id", null: false
539
540
  t.integer "position"
@@ -543,7 +544,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
543
544
  t.index ["manifestation_id"], name: "index_exemplifies_on_manifestation_id"
544
545
  end
545
546
 
546
- create_table "extents", force: :cascade do |t|
547
+ create_table "extents", id: :serial, force: :cascade do |t|
547
548
  t.string "name", null: false
548
549
  t.text "display_name"
549
550
  t.text "note"
@@ -552,25 +553,27 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
552
553
  t.datetime "updated_at"
553
554
  end
554
555
 
555
- create_table "form_of_works", force: :cascade do |t|
556
+ create_table "form_of_works", id: :serial, force: :cascade do |t|
556
557
  t.string "name", null: false
557
558
  t.text "display_name"
558
559
  t.text "note"
559
560
  t.integer "position"
560
561
  t.datetime "created_at"
561
562
  t.datetime "updated_at"
563
+ t.jsonb "display_name_translations", default: {}, null: false
562
564
  end
563
565
 
564
- create_table "frequencies", force: :cascade do |t|
566
+ create_table "frequencies", id: :serial, force: :cascade do |t|
565
567
  t.string "name", null: false
566
568
  t.text "display_name"
567
569
  t.text "note"
568
570
  t.integer "position"
569
571
  t.datetime "created_at"
570
572
  t.datetime "updated_at"
573
+ t.jsonb "display_name_translations", default: {}, null: false
571
574
  end
572
575
 
573
- create_table "identifier_types", force: :cascade do |t|
576
+ create_table "identifier_types", id: :serial, force: :cascade do |t|
574
577
  t.string "name"
575
578
  t.text "display_name"
576
579
  t.text "note"
@@ -579,7 +582,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
579
582
  t.datetime "updated_at"
580
583
  end
581
584
 
582
- create_table "identifiers", force: :cascade do |t|
585
+ create_table "identifiers", id: :serial, force: :cascade do |t|
583
586
  t.string "body", null: false
584
587
  t.integer "identifier_type_id", null: false
585
588
  t.integer "manifestation_id"
@@ -591,7 +594,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
591
594
  t.index ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
592
595
  end
593
596
 
594
- create_table "import_request_transitions", force: :cascade do |t|
597
+ create_table "import_request_transitions", id: :serial, force: :cascade do |t|
595
598
  t.string "to_state"
596
599
  t.text "metadata", default: "{}"
597
600
  t.integer "sort_key"
@@ -604,7 +607,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
604
607
  t.index ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
605
608
  end
606
609
 
607
- create_table "import_requests", force: :cascade do |t|
610
+ create_table "import_requests", id: :serial, force: :cascade do |t|
608
611
  t.string "isbn"
609
612
  t.integer "manifestation_id"
610
613
  t.integer "user_id"
@@ -615,7 +618,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
615
618
  t.index ["user_id"], name: "index_import_requests_on_user_id"
616
619
  end
617
620
 
618
- create_table "item_has_use_restrictions", force: :cascade do |t|
621
+ create_table "item_has_use_restrictions", id: :serial, force: :cascade do |t|
619
622
  t.integer "item_id", null: false
620
623
  t.integer "use_restriction_id", null: false
621
624
  t.datetime "created_at"
@@ -624,7 +627,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
624
627
  t.index ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
625
628
  end
626
629
 
627
- create_table "items", force: :cascade do |t|
630
+ create_table "items", id: :serial, force: :cascade do |t|
628
631
  t.string "call_number"
629
632
  t.string "item_identifier"
630
633
  t.datetime "created_at"
@@ -647,7 +650,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
647
650
  t.string "binding_call_number"
648
651
  t.datetime "binded_at"
649
652
  t.integer "manifestation_id", null: false
650
- t.text "memo"
651
653
  t.index ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
652
654
  t.index ["bookstore_id"], name: "index_items_on_bookstore_id"
653
655
  t.index ["checkout_type_id"], name: "index_items_on_checkout_type_id"
@@ -658,7 +660,16 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
658
660
  t.index ["shelf_id"], name: "index_items_on_shelf_id"
659
661
  end
660
662
 
661
- create_table "languages", force: :cascade do |t|
663
+ create_table "jpno_records", force: :cascade do |t|
664
+ t.string "body", null: false
665
+ t.bigint "manifestation_id", null: false
666
+ t.datetime "created_at", null: false
667
+ t.datetime "updated_at", null: false
668
+ t.index ["body"], name: "index_jpno_records_on_body", unique: true
669
+ t.index ["manifestation_id"], name: "index_jpno_records_on_manifestation_id"
670
+ end
671
+
672
+ create_table "languages", id: :serial, force: :cascade do |t|
662
673
  t.string "name", null: false
663
674
  t.string "native_name"
664
675
  t.text "display_name"
@@ -667,13 +678,14 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
667
678
  t.string "iso_639_3"
668
679
  t.text "note"
669
680
  t.integer "position"
681
+ t.jsonb "display_name_translations", default: {}, null: false
670
682
  t.index ["iso_639_1"], name: "index_languages_on_iso_639_1"
671
683
  t.index ["iso_639_2"], name: "index_languages_on_iso_639_2"
672
684
  t.index ["iso_639_3"], name: "index_languages_on_iso_639_3"
673
685
  t.index ["name"], name: "index_languages_on_name", unique: true
674
686
  end
675
687
 
676
- create_table "lending_policies", force: :cascade do |t|
688
+ create_table "lending_policies", id: :serial, force: :cascade do |t|
677
689
  t.integer "item_id", null: false
678
690
  t.integer "user_group_id", null: false
679
691
  t.integer "loan_period", default: 0, null: false
@@ -687,7 +699,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
687
699
  t.index ["item_id", "user_group_id"], name: "index_lending_policies_on_item_id_and_user_group_id", unique: true
688
700
  end
689
701
 
690
- create_table "libraries", force: :cascade do |t|
702
+ create_table "libraries", id: :serial, force: :cascade do |t|
691
703
  t.string "name", null: false
692
704
  t.text "display_name"
693
705
  t.string "short_display_name", null: false
@@ -712,22 +724,12 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
712
724
  t.string "isil"
713
725
  t.float "latitude"
714
726
  t.float "longitude"
727
+ t.jsonb "display_name_translations", default: {}, null: false
715
728
  t.index ["library_group_id"], name: "index_libraries_on_library_group_id"
716
729
  t.index ["name"], name: "index_libraries_on_name"
717
730
  end
718
731
 
719
- create_table "library_group_translations", force: :cascade do |t|
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"
728
- end
729
-
730
- create_table "library_groups", force: :cascade do |t|
732
+ create_table "library_groups", id: :serial, force: :cascade do |t|
731
733
  t.string "name", null: false
732
734
  t.text "display_name"
733
735
  t.string "short_name", null: false
@@ -750,23 +752,27 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
750
752
  t.boolean "csv_charset_conversion", default: false, null: false
751
753
  t.string "header_logo_file_name"
752
754
  t.string "header_logo_content_type"
753
- t.integer "header_logo_file_size"
755
+ t.bigint "header_logo_file_size"
754
756
  t.datetime "header_logo_updated_at"
755
757
  t.text "header_logo_meta"
758
+ t.jsonb "display_name_translations", default: {}, null: false
759
+ t.jsonb "login_banner_translations", default: {}, null: false
760
+ t.jsonb "footer_banner_translations", default: {}, null: false
756
761
  t.index ["short_name"], name: "index_library_groups_on_short_name"
757
762
  t.index ["user_id"], name: "index_library_groups_on_user_id"
758
763
  end
759
764
 
760
- create_table "licenses", force: :cascade do |t|
765
+ create_table "licenses", id: :serial, force: :cascade do |t|
761
766
  t.string "name", null: false
762
767
  t.string "display_name"
763
768
  t.text "note"
764
769
  t.integer "position"
765
770
  t.datetime "created_at"
766
771
  t.datetime "updated_at"
772
+ t.jsonb "display_name_translations", default: {}, null: false
767
773
  end
768
774
 
769
- create_table "manifestation_checkout_stat_transitions", force: :cascade do |t|
775
+ create_table "manifestation_checkout_stat_transitions", id: :serial, force: :cascade do |t|
770
776
  t.string "to_state"
771
777
  t.text "metadata", default: "{}"
772
778
  t.integer "sort_key"
@@ -777,7 +783,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
777
783
  t.index ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
778
784
  end
779
785
 
780
- create_table "manifestation_checkout_stats", force: :cascade do |t|
786
+ create_table "manifestation_checkout_stats", id: :serial, force: :cascade do |t|
781
787
  t.datetime "start_date"
782
788
  t.datetime "end_date"
783
789
  t.text "note"
@@ -789,16 +795,17 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
789
795
  t.index ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
790
796
  end
791
797
 
792
- create_table "manifestation_relationship_types", force: :cascade do |t|
798
+ create_table "manifestation_relationship_types", id: :serial, force: :cascade do |t|
793
799
  t.string "name", null: false
794
800
  t.text "display_name"
795
801
  t.text "note"
796
802
  t.integer "position"
797
803
  t.datetime "created_at"
798
804
  t.datetime "updated_at"
805
+ t.jsonb "display_name_translations", default: {}, null: false
799
806
  end
800
807
 
801
- create_table "manifestation_relationships", force: :cascade do |t|
808
+ create_table "manifestation_relationships", id: :serial, force: :cascade do |t|
802
809
  t.integer "parent_id"
803
810
  t.integer "child_id"
804
811
  t.integer "manifestation_relationship_type_id"
@@ -809,7 +816,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
809
816
  t.index ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
810
817
  end
811
818
 
812
- create_table "manifestation_reserve_stat_transitions", force: :cascade do |t|
819
+ create_table "manifestation_reserve_stat_transitions", id: :serial, force: :cascade do |t|
813
820
  t.string "to_state"
814
821
  t.text "metadata", default: "{}"
815
822
  t.integer "sort_key"
@@ -820,7 +827,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
820
827
  t.index ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
821
828
  end
822
829
 
823
- create_table "manifestation_reserve_stats", force: :cascade do |t|
830
+ create_table "manifestation_reserve_stats", id: :serial, force: :cascade do |t|
824
831
  t.datetime "start_date"
825
832
  t.datetime "end_date"
826
833
  t.text "note"
@@ -832,7 +839,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
832
839
  t.index ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
833
840
  end
834
841
 
835
- create_table "manifestations", force: :cascade do |t|
842
+ create_table "manifestations", id: :serial, force: :cascade do |t|
836
843
  t.text "original_title", null: false
837
844
  t.text "title_alternative"
838
845
  t.text "title_transcription"
@@ -892,7 +899,6 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
892
899
  t.text "publication_place"
893
900
  t.text "extent"
894
901
  t.text "dimensions"
895
- t.text "memo"
896
902
  t.index ["access_address"], name: "index_manifestations_on_access_address"
897
903
  t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
898
904
  t.index ["doi"], name: "index_manifestations_on_doi"
@@ -900,16 +906,17 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
900
906
  t.index ["updated_at"], name: "index_manifestations_on_updated_at"
901
907
  end
902
908
 
903
- create_table "medium_of_performances", force: :cascade do |t|
909
+ create_table "medium_of_performances", id: :serial, force: :cascade do |t|
904
910
  t.string "name", null: false
905
911
  t.text "display_name"
906
912
  t.text "note"
907
913
  t.integer "position"
908
914
  t.datetime "created_at"
909
915
  t.datetime "updated_at"
916
+ t.jsonb "display_name_translations", default: {}, null: false
910
917
  end
911
918
 
912
- create_table "message_request_transitions", force: :cascade do |t|
919
+ create_table "message_request_transitions", id: :serial, force: :cascade do |t|
913
920
  t.string "to_state"
914
921
  t.text "metadata", default: "{}"
915
922
  t.integer "sort_key"
@@ -921,7 +928,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
921
928
  t.index ["sort_key", "message_request_id"], name: "index_message_request_transitions_on_sort_key_and_request_id", unique: true
922
929
  end
923
930
 
924
- create_table "message_requests", force: :cascade do |t|
931
+ create_table "message_requests", id: :serial, force: :cascade do |t|
925
932
  t.integer "sender_id"
926
933
  t.integer "receiver_id"
927
934
  t.integer "message_template_id"
@@ -932,7 +939,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
932
939
  t.datetime "updated_at"
933
940
  end
934
941
 
935
- create_table "message_templates", force: :cascade do |t|
942
+ create_table "message_templates", id: :serial, force: :cascade do |t|
936
943
  t.string "status", null: false
937
944
  t.text "title", null: false
938
945
  t.text "body", null: false
@@ -943,7 +950,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
943
950
  t.index ["status"], name: "index_message_templates_on_status", unique: true
944
951
  end
945
952
 
946
- create_table "message_transitions", force: :cascade do |t|
953
+ create_table "message_transitions", id: :serial, force: :cascade do |t|
947
954
  t.string "to_state"
948
955
  t.text "metadata", default: "{}"
949
956
  t.integer "sort_key"
@@ -955,7 +962,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
955
962
  t.index ["sort_key", "message_id"], name: "index_message_transitions_on_sort_key_and_message_id", unique: true
956
963
  end
957
964
 
958
- create_table "messages", force: :cascade do |t|
965
+ create_table "messages", id: :serial, force: :cascade do |t|
959
966
  t.datetime "read_at"
960
967
  t.integer "receiver_id"
961
968
  t.integer "sender_id"
@@ -974,7 +981,25 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
974
981
  t.index ["sender_id"], name: "index_messages_on_sender_id"
975
982
  end
976
983
 
977
- create_table "owns", force: :cascade do |t|
984
+ create_table "ndl_bib_id_records", force: :cascade do |t|
985
+ t.string "body", null: false
986
+ t.bigint "manifestation_id", null: false
987
+ t.datetime "created_at", null: false
988
+ t.datetime "updated_at", null: false
989
+ t.index ["body"], name: "index_ndl_bib_id_records_on_body", unique: true
990
+ t.index ["manifestation_id"], name: "index_ndl_bib_id_records_on_manifestation_id"
991
+ end
992
+
993
+ create_table "ndla_records", force: :cascade do |t|
994
+ t.bigint "agent_id"
995
+ t.string "body", null: false
996
+ t.datetime "created_at", null: false
997
+ t.datetime "updated_at", null: false
998
+ t.index ["agent_id"], name: "index_ndla_records_on_agent_id"
999
+ t.index ["body"], name: "index_ndla_records_on_body", unique: true
1000
+ end
1001
+
1002
+ create_table "owns", id: :serial, force: :cascade do |t|
978
1003
  t.integer "agent_id", null: false
979
1004
  t.integer "item_id", null: false
980
1005
  t.integer "position"
@@ -984,7 +1009,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
984
1009
  t.index ["item_id"], name: "index_owns_on_item_id"
985
1010
  end
986
1011
 
987
- create_table "participates", force: :cascade do |t|
1012
+ create_table "participates", id: :serial, force: :cascade do |t|
988
1013
  t.integer "agent_id", null: false
989
1014
  t.integer "event_id", null: false
990
1015
  t.integer "position"
@@ -994,7 +1019,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
994
1019
  t.index ["event_id"], name: "index_participates_on_event_id"
995
1020
  end
996
1021
 
997
- create_table "picture_files", force: :cascade do |t|
1022
+ create_table "picture_files", id: :serial, force: :cascade do |t|
998
1023
  t.integer "picture_attachable_id"
999
1024
  t.string "picture_attachable_type"
1000
1025
  t.string "content_type"
@@ -1014,16 +1039,17 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1014
1039
  t.index ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
1015
1040
  end
1016
1041
 
1017
- create_table "produce_types", force: :cascade do |t|
1042
+ create_table "produce_types", id: :serial, force: :cascade do |t|
1018
1043
  t.string "name"
1019
1044
  t.text "display_name"
1020
1045
  t.text "note"
1021
1046
  t.integer "position"
1022
1047
  t.datetime "created_at"
1023
1048
  t.datetime "updated_at"
1049
+ t.jsonb "display_name_translations", default: {}, null: false
1024
1050
  end
1025
1051
 
1026
- create_table "produces", force: :cascade do |t|
1052
+ create_table "produces", id: :serial, force: :cascade do |t|
1027
1053
  t.integer "agent_id", null: false
1028
1054
  t.integer "manifestation_id", null: false
1029
1055
  t.integer "position"
@@ -1034,7 +1060,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1034
1060
  t.index ["manifestation_id"], name: "index_produces_on_manifestation_id"
1035
1061
  end
1036
1062
 
1037
- create_table "profiles", force: :cascade do |t|
1063
+ create_table "profiles", id: :serial, force: :cascade do |t|
1038
1064
  t.integer "user_id"
1039
1065
  t.integer "user_group_id"
1040
1066
  t.integer "library_id"
@@ -1052,21 +1078,25 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1052
1078
  t.boolean "share_bookmarks"
1053
1079
  t.text "full_name_transcription"
1054
1080
  t.datetime "date_of_birth"
1081
+ t.jsonb "full_name_translations", default: {}, null: false
1055
1082
  t.index ["checkout_icalendar_token"], name: "index_profiles_on_checkout_icalendar_token", unique: true
1083
+ t.index ["library_id"], name: "index_profiles_on_library_id"
1084
+ t.index ["user_group_id"], name: "index_profiles_on_user_group_id"
1056
1085
  t.index ["user_id"], name: "index_profiles_on_user_id"
1057
1086
  t.index ["user_number"], name: "index_profiles_on_user_number", unique: true
1058
1087
  end
1059
1088
 
1060
- create_table "realize_types", force: :cascade do |t|
1089
+ create_table "realize_types", id: :serial, force: :cascade do |t|
1061
1090
  t.string "name"
1062
1091
  t.text "display_name"
1063
1092
  t.text "note"
1064
1093
  t.integer "position"
1065
1094
  t.datetime "created_at"
1066
1095
  t.datetime "updated_at"
1096
+ t.jsonb "display_name_translations", default: {}, null: false
1067
1097
  end
1068
1098
 
1069
- create_table "realizes", force: :cascade do |t|
1099
+ create_table "realizes", id: :serial, force: :cascade do |t|
1070
1100
  t.integer "agent_id", null: false
1071
1101
  t.integer "expression_id", null: false
1072
1102
  t.integer "position"
@@ -1077,25 +1107,27 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1077
1107
  t.index ["expression_id"], name: "index_realizes_on_expression_id"
1078
1108
  end
1079
1109
 
1080
- create_table "request_status_types", force: :cascade do |t|
1110
+ create_table "request_status_types", id: :serial, force: :cascade do |t|
1081
1111
  t.string "name", null: false
1082
1112
  t.text "display_name"
1083
1113
  t.text "note"
1084
1114
  t.integer "position"
1085
1115
  t.datetime "created_at"
1086
1116
  t.datetime "updated_at"
1117
+ t.jsonb "display_name_translations", default: {}, null: false
1087
1118
  end
1088
1119
 
1089
- create_table "request_types", force: :cascade do |t|
1120
+ create_table "request_types", id: :serial, force: :cascade do |t|
1090
1121
  t.string "name", null: false
1091
1122
  t.text "display_name"
1092
1123
  t.text "note"
1093
1124
  t.integer "position"
1094
1125
  t.datetime "created_at"
1095
1126
  t.datetime "updated_at"
1127
+ t.jsonb "display_name_translations", default: {}, null: false
1096
1128
  end
1097
1129
 
1098
- create_table "reserve_stat_has_manifestations", force: :cascade do |t|
1130
+ create_table "reserve_stat_has_manifestations", id: :serial, force: :cascade do |t|
1099
1131
  t.integer "manifestation_reserve_stat_id", null: false
1100
1132
  t.integer "manifestation_id", null: false
1101
1133
  t.integer "reserves_count"
@@ -1105,7 +1137,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1105
1137
  t.index ["manifestation_reserve_stat_id"], name: "index_reserve_stat_has_manifestations_on_m_reserve_stat_id"
1106
1138
  end
1107
1139
 
1108
- create_table "reserve_stat_has_users", force: :cascade do |t|
1140
+ create_table "reserve_stat_has_users", id: :serial, force: :cascade do |t|
1109
1141
  t.integer "user_reserve_stat_id", null: false
1110
1142
  t.integer "user_id", null: false
1111
1143
  t.integer "reserves_count"
@@ -1115,7 +1147,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1115
1147
  t.index ["user_reserve_stat_id"], name: "index_reserve_stat_has_users_on_user_reserve_stat_id"
1116
1148
  end
1117
1149
 
1118
- create_table "reserve_transitions", force: :cascade do |t|
1150
+ create_table "reserve_transitions", id: :serial, force: :cascade do |t|
1119
1151
  t.string "to_state"
1120
1152
  t.text "metadata", default: "{}"
1121
1153
  t.integer "sort_key"
@@ -1126,7 +1158,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1126
1158
  t.index ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
1127
1159
  end
1128
1160
 
1129
- create_table "reserves", force: :cascade do |t|
1161
+ create_table "reserves", id: :serial, force: :cascade do |t|
1130
1162
  t.integer "user_id", null: false
1131
1163
  t.integer "manifestation_id", null: false
1132
1164
  t.integer "item_id"
@@ -1148,7 +1180,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1148
1180
  t.index ["user_id"], name: "index_reserves_on_user_id"
1149
1181
  end
1150
1182
 
1151
- create_table "resource_export_file_transitions", force: :cascade do |t|
1183
+ create_table "resource_export_file_transitions", id: :serial, force: :cascade do |t|
1152
1184
  t.string "to_state"
1153
1185
  t.text "metadata", default: "{}"
1154
1186
  t.integer "sort_key"
@@ -1161,18 +1193,18 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1161
1193
  t.index ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
1162
1194
  end
1163
1195
 
1164
- create_table "resource_export_files", force: :cascade do |t|
1196
+ create_table "resource_export_files", id: :serial, force: :cascade do |t|
1165
1197
  t.integer "user_id"
1166
1198
  t.string "resource_export_file_name"
1167
1199
  t.string "resource_export_content_type"
1168
- t.integer "resource_export_file_size"
1200
+ t.bigint "resource_export_file_size"
1169
1201
  t.datetime "resource_export_updated_at"
1170
1202
  t.datetime "executed_at"
1171
1203
  t.datetime "created_at"
1172
1204
  t.datetime "updated_at"
1173
1205
  end
1174
1206
 
1175
- create_table "resource_import_file_transitions", force: :cascade do |t|
1207
+ create_table "resource_import_file_transitions", id: :serial, force: :cascade do |t|
1176
1208
  t.string "to_state"
1177
1209
  t.text "metadata", default: "{}"
1178
1210
  t.integer "sort_key"
@@ -1185,7 +1217,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1185
1217
  t.index ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
1186
1218
  end
1187
1219
 
1188
- create_table "resource_import_files", force: :cascade do |t|
1220
+ create_table "resource_import_files", id: :serial, force: :cascade do |t|
1189
1221
  t.integer "parent_id"
1190
1222
  t.string "content_type"
1191
1223
  t.integer "size"
@@ -1207,7 +1239,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1207
1239
  t.index ["user_id"], name: "index_resource_import_files_on_user_id"
1208
1240
  end
1209
1241
 
1210
- create_table "resource_import_results", force: :cascade do |t|
1242
+ create_table "resource_import_results", id: :serial, force: :cascade do |t|
1211
1243
  t.integer "resource_import_file_id"
1212
1244
  t.integer "manifestation_id"
1213
1245
  t.integer "item_id"
@@ -1220,7 +1252,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1220
1252
  t.index ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
1221
1253
  end
1222
1254
 
1223
- create_table "roles", force: :cascade do |t|
1255
+ create_table "roles", id: :serial, force: :cascade do |t|
1224
1256
  t.string "name", null: false
1225
1257
  t.string "display_name"
1226
1258
  t.text "note"
@@ -1228,9 +1260,10 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1228
1260
  t.datetime "updated_at"
1229
1261
  t.integer "score", default: 0, null: false
1230
1262
  t.integer "position"
1263
+ t.jsonb "display_name_translations", default: {}, null: false
1231
1264
  end
1232
1265
 
1233
- create_table "search_engines", force: :cascade do |t|
1266
+ create_table "search_engines", id: :serial, force: :cascade do |t|
1234
1267
  t.string "name", null: false
1235
1268
  t.text "display_name"
1236
1269
  t.string "url", null: false
@@ -1242,15 +1275,16 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1242
1275
  t.integer "position"
1243
1276
  t.datetime "created_at"
1244
1277
  t.datetime "updated_at"
1278
+ t.jsonb "display_name_translations", default: {}, null: false
1245
1279
  end
1246
1280
 
1247
- create_table "series_statement_merge_lists", force: :cascade do |t|
1281
+ create_table "series_statement_merge_lists", id: :serial, force: :cascade do |t|
1248
1282
  t.string "title"
1249
1283
  t.datetime "created_at"
1250
1284
  t.datetime "updated_at"
1251
1285
  end
1252
1286
 
1253
- create_table "series_statement_merges", force: :cascade do |t|
1287
+ create_table "series_statement_merges", id: :serial, force: :cascade do |t|
1254
1288
  t.integer "series_statement_id", null: false
1255
1289
  t.integer "series_statement_merge_list_id", null: false
1256
1290
  t.datetime "created_at"
@@ -1259,7 +1293,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1259
1293
  t.index ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
1260
1294
  end
1261
1295
 
1262
- create_table "series_statements", force: :cascade do |t|
1296
+ create_table "series_statements", id: :serial, force: :cascade do |t|
1263
1297
  t.text "original_title"
1264
1298
  t.text "numbering"
1265
1299
  t.text "title_subseries"
@@ -1283,7 +1317,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1283
1317
  t.index ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
1284
1318
  end
1285
1319
 
1286
- create_table "shelves", force: :cascade do |t|
1320
+ create_table "shelves", id: :serial, force: :cascade do |t|
1287
1321
  t.string "name", null: false
1288
1322
  t.text "display_name"
1289
1323
  t.text "note"
@@ -1294,10 +1328,11 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1294
1328
  t.datetime "updated_at"
1295
1329
  t.datetime "deleted_at"
1296
1330
  t.boolean "closed", default: false, null: false
1331
+ t.jsonb "display_name_translations", default: {}, null: false
1297
1332
  t.index ["library_id"], name: "index_shelves_on_library_id"
1298
1333
  end
1299
1334
 
1300
- create_table "subject_heading_types", force: :cascade do |t|
1335
+ create_table "subject_heading_types", id: :serial, force: :cascade do |t|
1301
1336
  t.string "name", null: false
1302
1337
  t.text "display_name"
1303
1338
  t.text "note"
@@ -1306,7 +1341,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1306
1341
  t.datetime "updated_at"
1307
1342
  end
1308
1343
 
1309
- create_table "subject_types", force: :cascade do |t|
1344
+ create_table "subject_types", id: :serial, force: :cascade do |t|
1310
1345
  t.string "name", null: false
1311
1346
  t.text "display_name"
1312
1347
  t.text "note"
@@ -1315,7 +1350,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1315
1350
  t.datetime "updated_at"
1316
1351
  end
1317
1352
 
1318
- create_table "subjects", force: :cascade do |t|
1353
+ create_table "subjects", id: :serial, force: :cascade do |t|
1319
1354
  t.integer "parent_id"
1320
1355
  t.integer "use_term_id"
1321
1356
  t.string "term"
@@ -1339,7 +1374,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1339
1374
  t.index ["use_term_id"], name: "index_subjects_on_use_term_id"
1340
1375
  end
1341
1376
 
1342
- create_table "subscribes", force: :cascade do |t|
1377
+ create_table "subscribes", id: :serial, force: :cascade do |t|
1343
1378
  t.integer "subscription_id", null: false
1344
1379
  t.integer "work_id", null: false
1345
1380
  t.datetime "start_at", null: false
@@ -1350,7 +1385,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1350
1385
  t.index ["work_id"], name: "index_subscribes_on_work_id"
1351
1386
  end
1352
1387
 
1353
- create_table "subscriptions", force: :cascade do |t|
1388
+ create_table "subscriptions", id: :serial, force: :cascade do |t|
1354
1389
  t.text "title", null: false
1355
1390
  t.text "note"
1356
1391
  t.integer "user_id"
@@ -1363,7 +1398,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1363
1398
  t.index ["user_id"], name: "index_subscriptions_on_user_id"
1364
1399
  end
1365
1400
 
1366
- create_table "taggings", force: :cascade do |t|
1401
+ create_table "taggings", id: :serial, force: :cascade do |t|
1367
1402
  t.integer "tag_id"
1368
1403
  t.string "taggable_type"
1369
1404
  t.integer "taggable_id"
@@ -1375,14 +1410,14 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1375
1410
  t.index ["taggable_id", "taggable_type", "context"], name: "index_taggings_on_taggable_id_and_taggable_type_and_context"
1376
1411
  end
1377
1412
 
1378
- create_table "tags", force: :cascade do |t|
1413
+ create_table "tags", id: :serial, force: :cascade do |t|
1379
1414
  t.string "name"
1380
1415
  t.string "name_transcription"
1381
1416
  t.datetime "created_at"
1382
1417
  t.datetime "updated_at"
1383
1418
  end
1384
1419
 
1385
- create_table "use_restrictions", force: :cascade do |t|
1420
+ create_table "use_restrictions", id: :serial, force: :cascade do |t|
1386
1421
  t.string "name", null: false
1387
1422
  t.text "display_name"
1388
1423
  t.text "note"
@@ -1391,7 +1426,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1391
1426
  t.datetime "updated_at"
1392
1427
  end
1393
1428
 
1394
- create_table "user_checkout_stat_transitions", force: :cascade do |t|
1429
+ create_table "user_checkout_stat_transitions", id: :serial, force: :cascade do |t|
1395
1430
  t.string "to_state"
1396
1431
  t.text "metadata", default: "{}"
1397
1432
  t.integer "sort_key"
@@ -1402,7 +1437,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1402
1437
  t.index ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
1403
1438
  end
1404
1439
 
1405
- create_table "user_checkout_stats", force: :cascade do |t|
1440
+ create_table "user_checkout_stats", id: :serial, force: :cascade do |t|
1406
1441
  t.datetime "start_date"
1407
1442
  t.datetime "end_date"
1408
1443
  t.text "note"
@@ -1414,7 +1449,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1414
1449
  t.index ["user_id"], name: "index_user_checkout_stats_on_user_id"
1415
1450
  end
1416
1451
 
1417
- create_table "user_export_file_transitions", force: :cascade do |t|
1452
+ create_table "user_export_file_transitions", id: :serial, force: :cascade do |t|
1418
1453
  t.string "to_state"
1419
1454
  t.text "metadata", default: "{}"
1420
1455
  t.integer "sort_key"
@@ -1428,11 +1463,11 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1428
1463
  t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
1429
1464
  end
1430
1465
 
1431
- create_table "user_export_files", force: :cascade do |t|
1466
+ create_table "user_export_files", id: :serial, force: :cascade do |t|
1432
1467
  t.integer "user_id"
1433
1468
  t.string "user_export_file_name"
1434
1469
  t.string "user_export_content_type"
1435
- t.integer "user_export_file_size"
1470
+ t.bigint "user_export_file_size"
1436
1471
  t.datetime "user_export_updated_at"
1437
1472
  t.datetime "executed_at"
1438
1473
  t.datetime "created_at"
@@ -1440,7 +1475,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1440
1475
  t.index ["user_id"], name: "index_user_export_files_on_user_id"
1441
1476
  end
1442
1477
 
1443
- create_table "user_group_has_checkout_types", force: :cascade do |t|
1478
+ create_table "user_group_has_checkout_types", id: :serial, force: :cascade do |t|
1444
1479
  t.integer "user_group_id", null: false
1445
1480
  t.integer "checkout_type_id", null: false
1446
1481
  t.integer "checkout_limit", default: 0, null: false
@@ -1459,7 +1494,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1459
1494
  t.index ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1460
1495
  end
1461
1496
 
1462
- create_table "user_groups", force: :cascade do |t|
1497
+ create_table "user_groups", id: :serial, force: :cascade do |t|
1463
1498
  t.string "name"
1464
1499
  t.text "display_name"
1465
1500
  t.text "note"
@@ -1472,18 +1507,19 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1472
1507
  t.integer "number_of_day_to_notify_overdue", default: 1, null: false
1473
1508
  t.integer "number_of_day_to_notify_due_date", default: 7, null: false
1474
1509
  t.integer "number_of_time_to_notify_overdue", default: 3, null: false
1510
+ t.jsonb "display_name_translations", default: {}, null: false
1475
1511
  end
1476
1512
 
1477
- create_table "user_has_roles", force: :cascade do |t|
1478
- t.integer "user_id"
1479
- t.integer "role_id"
1513
+ create_table "user_has_roles", id: :serial, force: :cascade do |t|
1514
+ t.integer "user_id", null: false
1515
+ t.integer "role_id", null: false
1480
1516
  t.datetime "created_at"
1481
1517
  t.datetime "updated_at"
1482
1518
  t.index ["role_id"], name: "index_user_has_roles_on_role_id"
1483
1519
  t.index ["user_id"], name: "index_user_has_roles_on_user_id"
1484
1520
  end
1485
1521
 
1486
- create_table "user_import_file_transitions", force: :cascade do |t|
1522
+ create_table "user_import_file_transitions", id: :serial, force: :cascade do |t|
1487
1523
  t.string "to_state"
1488
1524
  t.text "metadata", default: "{}"
1489
1525
  t.integer "sort_key"
@@ -1496,7 +1532,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1496
1532
  t.index ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
1497
1533
  end
1498
1534
 
1499
- create_table "user_import_files", force: :cascade do |t|
1535
+ create_table "user_import_files", id: :serial, force: :cascade do |t|
1500
1536
  t.integer "user_id"
1501
1537
  t.text "note"
1502
1538
  t.datetime "executed_at"
@@ -1515,7 +1551,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1515
1551
  t.index ["user_id"], name: "index_user_import_files_on_user_id"
1516
1552
  end
1517
1553
 
1518
- create_table "user_import_results", force: :cascade do |t|
1554
+ create_table "user_import_results", id: :serial, force: :cascade do |t|
1519
1555
  t.integer "user_import_file_id"
1520
1556
  t.integer "user_id"
1521
1557
  t.text "body"
@@ -1526,7 +1562,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1526
1562
  t.index ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
1527
1563
  end
1528
1564
 
1529
- create_table "user_reserve_stat_transitions", force: :cascade do |t|
1565
+ create_table "user_reserve_stat_transitions", id: :serial, force: :cascade do |t|
1530
1566
  t.string "to_state"
1531
1567
  t.text "metadata", default: "{}"
1532
1568
  t.integer "sort_key"
@@ -1537,7 +1573,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1537
1573
  t.index ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
1538
1574
  end
1539
1575
 
1540
- create_table "user_reserve_stats", force: :cascade do |t|
1576
+ create_table "user_reserve_stats", id: :serial, force: :cascade do |t|
1541
1577
  t.datetime "start_date"
1542
1578
  t.datetime "end_date"
1543
1579
  t.text "note"
@@ -1549,7 +1585,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1549
1585
  t.index ["user_id"], name: "index_user_reserve_stats_on_user_id"
1550
1586
  end
1551
1587
 
1552
- create_table "users", force: :cascade do |t|
1588
+ create_table "users", id: :serial, force: :cascade do |t|
1553
1589
  t.string "email", default: "", null: false
1554
1590
  t.string "encrypted_password", default: "", null: false
1555
1591
  t.string "reset_password_token"
@@ -1571,14 +1607,16 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1571
1607
  t.string "unlock_token"
1572
1608
  t.datetime "locked_at"
1573
1609
  t.datetime "confirmed_at"
1610
+ t.bigint "profile_id"
1574
1611
  t.index ["checkout_icalendar_token"], name: "index_users_on_checkout_icalendar_token", unique: true
1575
1612
  t.index ["email"], name: "index_users_on_email"
1613
+ t.index ["profile_id"], name: "index_users_on_profile_id"
1576
1614
  t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
1577
1615
  t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
1578
1616
  t.index ["username"], name: "index_users_on_username", unique: true
1579
1617
  end
1580
1618
 
1581
- create_table "versions", force: :cascade do |t|
1619
+ create_table "versions", id: :serial, force: :cascade do |t|
1582
1620
  t.string "item_type", null: false
1583
1621
  t.integer "item_id", null: false
1584
1622
  t.string "event", null: false
@@ -1588,7 +1626,7 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1588
1626
  t.index ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
1589
1627
  end
1590
1628
 
1591
- create_table "withdraws", force: :cascade do |t|
1629
+ create_table "withdraws", id: :serial, force: :cascade do |t|
1592
1630
  t.integer "basket_id"
1593
1631
  t.integer "item_id"
1594
1632
  t.integer "librarian_id"
@@ -1599,4 +1637,14 @@ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
1599
1637
  t.index ["librarian_id"], name: "index_withdraws_on_librarian_id"
1600
1638
  end
1601
1639
 
1640
+ add_foreign_key "items", "manifestations"
1641
+ add_foreign_key "jpno_records", "manifestations"
1642
+ add_foreign_key "libraries", "library_groups"
1643
+ add_foreign_key "library_groups", "users"
1644
+ add_foreign_key "ndl_bib_id_records", "manifestations"
1645
+ add_foreign_key "ndla_records", "agents"
1646
+ add_foreign_key "profiles", "users"
1647
+ add_foreign_key "user_has_roles", "roles"
1648
+ add_foreign_key "user_has_roles", "users"
1649
+ add_foreign_key "users", "profiles"
1602
1650
  end