enju_message 0.3.0.beta.1 → 0.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (76) hide show
  1. checksums.yaml +5 -5
  2. data/README.md +10 -0
  3. data/app/models/message.rb +5 -5
  4. data/app/models/message_request.rb +3 -4
  5. data/app/models/message_request_transition.rb +3 -4
  6. data/app/models/message_template.rb +3 -3
  7. data/app/models/message_transition.rb +3 -4
  8. data/app/views/message_templates/_form.html.erb +1 -1
  9. data/app/views/messages/index.rss.builder +2 -2
  10. data/db/migrate/149_create_message_templates.rb +3 -8
  11. data/db/migrate/154_create_messages.rb +4 -8
  12. data/db/migrate/20080819181903_create_message_requests.rb +2 -7
  13. data/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +2 -7
  14. data/db/migrate/20120125050502_add_depth_to_message.rb +1 -2
  15. data/db/migrate/20140518111006_create_message_transitions.rb +3 -8
  16. data/db/migrate/20140518135713_create_message_request_transitions.rb +3 -8
  17. data/db/migrate/20160703185015_add_most_recent_to_message_transitions.rb +1 -1
  18. data/db/migrate/20160814165332_add_most_recent_to_message_request_transitions.rb +1 -1
  19. data/db/migrate/20180107162659_add_constraints_to_most_recent_for_message_transitions.rb +1 -1
  20. data/db/migrate/20180107162711_add_constraints_to_most_recent_for_message_request_transitions.rb +1 -1
  21. data/lib/enju_message/version.rb +1 -1
  22. data/spec/controllers/messages_controller_spec.rb +27 -25
  23. data/spec/dummy/app/controllers/application_controller.rb +0 -1
  24. data/spec/dummy/app/jobs/application_job.rb +7 -0
  25. data/spec/dummy/app/models/application_record.rb +3 -0
  26. data/spec/dummy/app/models/user.rb +1 -1
  27. data/spec/dummy/bin/bundle +1 -1
  28. data/spec/dummy/bin/setup +1 -3
  29. data/spec/dummy/bin/update +4 -2
  30. data/spec/dummy/bin/yarn +3 -3
  31. data/spec/dummy/config/application.rb +1 -1
  32. data/spec/dummy/config/environments/development.rb +9 -2
  33. data/spec/dummy/config/environments/production.rb +7 -4
  34. data/spec/dummy/config/environments/test.rb +5 -1
  35. data/spec/dummy/config/storage.yml +34 -0
  36. data/spec/dummy/db/migrate/005_create_manifestations.rb +3 -3
  37. data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +2 -4
  38. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +4 -5
  39. data/spec/dummy/db/migrate/20150421023923_create_identities.rb +14 -0
  40. data/spec/dummy/db/migrate/20151126005552_add_provider_to_identity.rb +5 -0
  41. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +0 -8
  42. data/spec/dummy/db/migrate/20160319144230_create_issn_records.rb +11 -0
  43. data/spec/dummy/db/migrate/20160506144040_create_isbn_records.rb +11 -0
  44. data/spec/dummy/db/migrate/20170114174536_add_profile_id_to_user.rb +5 -0
  45. data/spec/dummy/db/migrate/20170116134107_create_issn_record_and_manifestations.rb +11 -0
  46. data/spec/dummy/db/migrate/20170116134120_create_isbn_record_and_manifestations.rb +11 -0
  47. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
  48. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
  49. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +1 -1
  50. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +1 -1
  51. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +1 -1
  52. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +1 -1
  53. data/spec/dummy/db/migrate/20181026064038_add_login_banner_to_library_group.rb +6 -0
  54. data/spec/dummy/db/migrate/20181030072731_add_not_null_to_position_on_carrier_type.rb +14 -0
  55. data/spec/dummy/db/migrate/20181030074920_add_not_null_to_position_on_library.rb +14 -0
  56. data/spec/dummy/db/migrate/20190208135957_create_active_storage_tables.active_storage.rb +27 -0
  57. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +5 -0
  58. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +5 -0
  59. data/spec/dummy/db/migrate/20191219122214_create_custom_properties.rb +12 -0
  60. data/spec/dummy/db/schema.rb +125 -34
  61. data/spec/factories/message.rb +4 -4
  62. data/spec/factories/message_request.rb +1 -1
  63. data/spec/factories/profile.rb +10 -7
  64. data/spec/factories/user.rb +25 -22
  65. data/spec/fixtures/message_request_transitions.yml +2 -2
  66. data/spec/fixtures/message_requests.yml +2 -3
  67. data/spec/fixtures/message_templates.yml +2 -2
  68. data/spec/fixtures/messages.yml +3 -3
  69. data/spec/models/message_request_spec.rb +2 -3
  70. data/spec/models/message_spec.rb +3 -3
  71. data/spec/models/message_template_spec.rb +2 -2
  72. data/spec/views/messages/index.html.erb_spec.rb +3 -9
  73. metadata +99 -28
  74. data/README.rdoc +0 -10
  75. data/spec/dummy/config/initializers/secret_token.rb +0 -7
  76. data/spec/dummy/config/initializers/session_store.rb +0 -8
@@ -0,0 +1,14 @@
1
+ class AddNotNullToPositionOnCarrierType < ActiveRecord::Migration[5.2]
2
+ def change
3
+ change_column :carrier_types, :position, :integer, null: false, default: 1
4
+ change_column :content_types, :position, :integer, null: false, default: 1
5
+ change_column :frequencies, :position, :integer, null: false, default: 1
6
+ change_column :licenses, :position, :integer, null: false, default: 1
7
+ change_column :creates, :position, :integer, null: false, default: 1
8
+ change_column :realizes, :position, :integer, null: false, default: 1
9
+ change_column :produces, :position, :integer, null: false, default: 1
10
+ change_column :owns, :position, :integer, null: false, default: 1
11
+ change_column :form_of_works, :position, :integer, null: false, default: 1
12
+ change_column :agent_types, :position, :integer, null: false, default: 1
13
+ end
14
+ end
@@ -0,0 +1,14 @@
1
+ class AddNotNullToPositionOnLibrary < ActiveRecord::Migration[5.2]
2
+ def change
3
+ change_column :libraries, :position, :integer, null: false, default: 1
4
+ change_column :shelves, :position, :integer, null: false, default: 1
5
+ change_column :library_groups, :position, :integer, null: false, default: 1
6
+ change_column :user_groups, :position, :integer, null: false, default: 1
7
+ change_column :bookstores, :position, :integer, null: false, default: 1
8
+ change_column :budget_types, :position, :integer, null: false, default: 1
9
+ change_column :colors, :position, :integer, null: false, default: 1
10
+ change_column :request_types, :position, :integer, null: false, default: 1
11
+ change_column :request_status_types, :position, :integer, null: false, default: 1
12
+ change_column :search_engines, :position, :integer, null: false, default: 1
13
+ end
14
+ end
@@ -0,0 +1,27 @@
1
+ # This migration comes from active_storage (originally 20170806125915)
2
+ class CreateActiveStorageTables < ActiveRecord::Migration[5.2]
3
+ def change
4
+ create_table :active_storage_blobs do |t|
5
+ t.string :key, null: false
6
+ t.string :filename, null: false
7
+ t.string :content_type
8
+ t.text :metadata
9
+ t.bigint :byte_size, null: false
10
+ t.string :checksum, null: false
11
+ t.datetime :created_at, null: false
12
+
13
+ t.index [ :key ], unique: true
14
+ end
15
+
16
+ create_table :active_storage_attachments do |t|
17
+ t.string :name, null: false
18
+ t.references :record, null: false, polymorphic: true, index: false
19
+ t.references :blob, null: false
20
+
21
+ t.datetime :created_at, null: false
22
+
23
+ t.index [ :record_type, :record_id, :name, :blob_id ], name: "index_active_storage_attachments_uniqueness", unique: true
24
+ t.foreign_key :active_storage_blobs, column: :blob_id
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,5 @@
1
+ class AddMemoToManifestation < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :manifestations, :memo, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddMemoToItem < ActiveRecord::Migration[5.2]
2
+ def change
3
+ add_column :items, :memo, :text
4
+ end
5
+ end
@@ -0,0 +1,12 @@
1
+ class CreateCustomProperties < ActiveRecord::Migration[5.2]
2
+ def change
3
+ create_table :custom_properties do |t|
4
+ t.integer :resource_id, null: false
5
+ t.string :resource_type, null: false
6
+ t.text :label, null: false
7
+ t.text :value
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -10,7 +10,7 @@
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: 20180107162711) do
13
+ ActiveRecord::Schema.define(version: 2019_12_19_122214) do
14
14
 
15
15
  create_table "accepts", force: :cascade do |t|
16
16
  t.integer "basket_id"
@@ -23,6 +23,27 @@ ActiveRecord::Schema.define(version: 20180107162711) do
23
23
  t.index ["librarian_id"], name: "index_accepts_on_librarian_id"
24
24
  end
25
25
 
26
+ create_table "active_storage_attachments", force: :cascade do |t|
27
+ t.string "name", null: false
28
+ t.string "record_type", null: false
29
+ t.integer "record_id", null: false
30
+ t.integer "blob_id", null: false
31
+ t.datetime "created_at", null: false
32
+ t.index ["blob_id"], name: "index_active_storage_attachments_on_blob_id"
33
+ t.index ["record_type", "record_id", "name", "blob_id"], name: "index_active_storage_attachments_uniqueness", unique: true
34
+ end
35
+
36
+ create_table "active_storage_blobs", force: :cascade do |t|
37
+ t.string "key", null: false
38
+ t.string "filename", null: false
39
+ t.string "content_type"
40
+ t.text "metadata"
41
+ t.bigint "byte_size", null: false
42
+ t.string "checksum", null: false
43
+ t.datetime "created_at", null: false
44
+ t.index ["key"], name: "index_active_storage_blobs_on_key", unique: true
45
+ end
46
+
26
47
  create_table "agent_import_file_transitions", force: :cascade do |t|
27
48
  t.string "to_state"
28
49
  t.text "metadata", default: "{}"
@@ -104,7 +125,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
104
125
  t.string "name", null: false
105
126
  t.text "display_name"
106
127
  t.text "note"
107
- t.integer "position"
128
+ t.integer "position", default: 1, null: false
108
129
  t.datetime "created_at"
109
130
  t.datetime "updated_at"
110
131
  end
@@ -181,7 +202,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
181
202
  t.string "telephone_number"
182
203
  t.string "fax_number"
183
204
  t.string "url"
184
- t.integer "position"
205
+ t.integer "position", default: 1, null: false
185
206
  t.datetime "deleted_at"
186
207
  t.datetime "created_at"
187
208
  t.datetime "updated_at"
@@ -191,7 +212,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
191
212
  t.string "name"
192
213
  t.text "display_name"
193
214
  t.text "note"
194
- t.integer "position"
215
+ t.integer "position", default: 1, null: false
195
216
  t.datetime "created_at"
196
217
  t.datetime "updated_at"
197
218
  end
@@ -200,7 +221,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
200
221
  t.string "name", null: false
201
222
  t.text "display_name"
202
223
  t.text "note"
203
- t.integer "position"
224
+ t.integer "position", default: 1, null: false
204
225
  t.datetime "created_at"
205
226
  t.datetime "updated_at"
206
227
  t.string "attachment_file_name"
@@ -213,7 +234,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
213
234
  t.integer "library_group_id"
214
235
  t.string "property"
215
236
  t.string "code"
216
- t.integer "position"
237
+ t.integer "position", default: 1, null: false
217
238
  t.datetime "created_at"
218
239
  t.datetime "updated_at"
219
240
  t.index ["library_group_id"], name: "index_colors_on_library_group_id"
@@ -223,7 +244,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
223
244
  t.string "name", null: false
224
245
  t.text "display_name"
225
246
  t.text "note"
226
- t.integer "position"
247
+ t.integer "position", default: 1, null: false
227
248
  t.datetime "created_at"
228
249
  t.datetime "updated_at"
229
250
  end
@@ -254,7 +275,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
254
275
  create_table "creates", force: :cascade do |t|
255
276
  t.integer "agent_id", null: false
256
277
  t.integer "work_id", null: false
257
- t.integer "position"
278
+ t.integer "position", default: 1, null: false
258
279
  t.datetime "created_at"
259
280
  t.datetime "updated_at"
260
281
  t.integer "create_type_id"
@@ -262,6 +283,15 @@ ActiveRecord::Schema.define(version: 20180107162711) do
262
283
  t.index ["work_id"], name: "index_creates_on_work_id"
263
284
  end
264
285
 
286
+ create_table "custom_properties", force: :cascade do |t|
287
+ t.integer "resource_id", null: false
288
+ t.string "resource_type", null: false
289
+ t.text "label", null: false
290
+ t.text "value"
291
+ t.datetime "created_at", null: false
292
+ t.datetime "updated_at", null: false
293
+ end
294
+
265
295
  create_table "donates", force: :cascade do |t|
266
296
  t.integer "agent_id", null: false
267
297
  t.integer "item_id", null: false
@@ -294,7 +324,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
294
324
  t.string "name", null: false
295
325
  t.text "display_name"
296
326
  t.text "note"
297
- t.integer "position"
327
+ t.integer "position", default: 1, null: false
298
328
  t.datetime "created_at"
299
329
  t.datetime "updated_at"
300
330
  end
@@ -303,7 +333,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
303
333
  t.string "name", null: false
304
334
  t.text "display_name"
305
335
  t.text "note"
306
- t.integer "position"
336
+ t.integer "position", default: 1, null: false
307
337
  t.datetime "created_at"
308
338
  t.datetime "updated_at"
309
339
  end
@@ -329,6 +359,19 @@ ActiveRecord::Schema.define(version: 20180107162711) do
329
359
  t.index ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
330
360
  end
331
361
 
362
+ create_table "identities", force: :cascade do |t|
363
+ t.string "name"
364
+ t.string "email"
365
+ t.string "password_digest"
366
+ t.integer "profile_id"
367
+ t.datetime "created_at", null: false
368
+ t.datetime "updated_at", null: false
369
+ t.string "provider"
370
+ t.index ["email"], name: "index_identities_on_email"
371
+ t.index ["name"], name: "index_identities_on_name"
372
+ t.index ["profile_id"], name: "index_identities_on_profile_id"
373
+ end
374
+
332
375
  create_table "import_request_transitions", force: :cascade do |t|
333
376
  t.string "to_state"
334
377
  t.text "metadata", default: "{}"
@@ -353,6 +396,44 @@ ActiveRecord::Schema.define(version: 20180107162711) do
353
396
  t.index ["user_id"], name: "index_import_requests_on_user_id"
354
397
  end
355
398
 
399
+ create_table "isbn_record_and_manifestations", force: :cascade do |t|
400
+ t.integer "isbn_record_id", null: false
401
+ t.integer "manifestation_id", null: false
402
+ t.integer "position"
403
+ t.datetime "created_at", null: false
404
+ t.datetime "updated_at", null: false
405
+ t.index ["isbn_record_id"], name: "index_isbn_record_and_manifestations_on_isbn_record_id"
406
+ t.index ["manifestation_id"], name: "index_isbn_record_and_manifestations_on_manifestation_id"
407
+ end
408
+
409
+ create_table "isbn_records", force: :cascade do |t|
410
+ t.string "body", null: false
411
+ t.string "isbn_type"
412
+ t.string "source"
413
+ t.datetime "created_at", null: false
414
+ t.datetime "updated_at", null: false
415
+ t.index ["body"], name: "index_isbn_records_on_body", unique: true
416
+ end
417
+
418
+ create_table "issn_record_and_manifestations", force: :cascade do |t|
419
+ t.integer "issn_record_id", null: false
420
+ t.integer "manifestation_id", null: false
421
+ t.integer "position"
422
+ t.datetime "created_at", null: false
423
+ t.datetime "updated_at", null: false
424
+ t.index ["issn_record_id"], name: "index_issn_record_and_manifestations_on_issn_record_id"
425
+ t.index ["manifestation_id"], name: "index_issn_record_and_manifestations_on_manifestation_id"
426
+ end
427
+
428
+ create_table "issn_records", force: :cascade do |t|
429
+ t.string "body", null: false
430
+ t.string "issn_type"
431
+ t.string "source"
432
+ t.datetime "created_at", null: false
433
+ t.datetime "updated_at", null: false
434
+ t.index ["body"], name: "index_issn_records_on_body", unique: true
435
+ end
436
+
356
437
  create_table "items", force: :cascade do |t|
357
438
  t.string "call_number"
358
439
  t.string "item_identifier"
@@ -374,6 +455,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
374
455
  t.string "binding_call_number"
375
456
  t.datetime "binded_at"
376
457
  t.integer "manifestation_id", null: false
458
+ t.text "memo"
377
459
  t.index ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
378
460
  t.index ["bookstore_id"], name: "index_items_on_bookstore_id"
379
461
  t.index ["item_identifier"], name: "index_items_on_item_identifier"
@@ -413,7 +495,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
413
495
  t.string "call_number_delimiter", default: "|", null: false
414
496
  t.integer "library_group_id", null: false
415
497
  t.integer "users_count", default: 0, null: false
416
- t.integer "position"
498
+ t.integer "position", default: 1, null: false
417
499
  t.integer "country_id"
418
500
  t.datetime "created_at"
419
501
  t.datetime "updated_at"
@@ -445,7 +527,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
445
527
  t.text "old_login_banner"
446
528
  t.text "note"
447
529
  t.integer "country_id"
448
- t.integer "position"
530
+ t.integer "position", default: 1, null: false
449
531
  t.datetime "created_at"
450
532
  t.datetime "updated_at"
451
533
  t.text "admin_networks"
@@ -462,6 +544,8 @@ ActiveRecord::Schema.define(version: 20180107162711) do
462
544
  t.integer "header_logo_file_size"
463
545
  t.datetime "header_logo_updated_at"
464
546
  t.text "header_logo_meta"
547
+ t.json "login_banner_translations", default: "\"{}\"", null: false
548
+ t.json "footer_banner_translations", default: "\"{}\"", null: false
465
549
  t.index ["short_name"], name: "index_library_groups_on_short_name"
466
550
  t.index ["user_id"], name: "index_library_groups_on_user_id"
467
551
  end
@@ -470,7 +554,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
470
554
  t.string "name", null: false
471
555
  t.string "display_name"
472
556
  t.text "note"
473
- t.integer "position"
557
+ t.integer "position", default: 1, null: false
474
558
  t.datetime "created_at"
475
559
  t.datetime "updated_at"
476
560
  end
@@ -555,6 +639,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
555
639
  t.text "extent_of_text"
556
640
  t.text "extent"
557
641
  t.text "dimensions"
642
+ t.text "memo"
558
643
  t.index ["access_address"], name: "index_manifestations_on_access_address"
559
644
  t.index ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
560
645
  t.index ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier"
@@ -575,8 +660,8 @@ ActiveRecord::Schema.define(version: 20180107162711) do
575
660
  t.text "metadata", default: "{}"
576
661
  t.integer "sort_key"
577
662
  t.integer "message_request_id"
578
- t.datetime "created_at"
579
- t.datetime "updated_at"
663
+ t.datetime "created_at", null: false
664
+ t.datetime "updated_at", null: false
580
665
  t.boolean "most_recent", null: false
581
666
  t.index ["message_request_id", "most_recent"], name: "index_message_request_transitions_parent_most_recent", unique: true, where: "most_recent"
582
667
  t.index ["message_request_id"], name: "index_message_request_transitions_on_message_request_id"
@@ -588,10 +673,12 @@ ActiveRecord::Schema.define(version: 20180107162711) do
588
673
  t.integer "receiver_id"
589
674
  t.integer "message_template_id"
590
675
  t.datetime "sent_at"
591
- t.datetime "deleted_at"
592
676
  t.text "body"
593
- t.datetime "created_at"
594
- t.datetime "updated_at"
677
+ t.datetime "created_at", null: false
678
+ t.datetime "updated_at", null: false
679
+ t.index ["message_template_id"], name: "index_message_requests_on_message_template_id"
680
+ t.index ["receiver_id"], name: "index_message_requests_on_receiver_id"
681
+ t.index ["sender_id"], name: "index_message_requests_on_sender_id"
595
682
  end
596
683
 
597
684
  create_table "message_templates", force: :cascade do |t|
@@ -600,8 +687,8 @@ ActiveRecord::Schema.define(version: 20180107162711) do
600
687
  t.text "body", null: false
601
688
  t.integer "position"
602
689
  t.string "locale", default: "en"
603
- t.datetime "created_at"
604
- t.datetime "updated_at"
690
+ t.datetime "created_at", null: false
691
+ t.datetime "updated_at", null: false
605
692
  t.index ["status"], name: "index_message_templates_on_status", unique: true
606
693
  end
607
694
 
@@ -610,8 +697,8 @@ ActiveRecord::Schema.define(version: 20180107162711) do
610
697
  t.text "metadata", default: "{}"
611
698
  t.integer "sort_key"
612
699
  t.integer "message_id"
613
- t.datetime "created_at"
614
- t.datetime "updated_at"
700
+ t.datetime "created_at", null: false
701
+ t.datetime "updated_at", null: false
615
702
  t.boolean "most_recent", null: false
616
703
  t.index ["message_id", "most_recent"], name: "index_message_transitions_parent_most_recent", unique: true, where: "most_recent"
617
704
  t.index ["message_id"], name: "index_message_transitions_on_message_id"
@@ -626,8 +713,8 @@ ActiveRecord::Schema.define(version: 20180107162711) do
626
713
  t.text "body"
627
714
  t.integer "message_request_id"
628
715
  t.integer "parent_id"
629
- t.datetime "created_at"
630
- t.datetime "updated_at"
716
+ t.datetime "created_at", null: false
717
+ t.datetime "updated_at", null: false
631
718
  t.integer "lft"
632
719
  t.integer "rgt"
633
720
  t.integer "depth"
@@ -640,7 +727,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
640
727
  create_table "owns", force: :cascade do |t|
641
728
  t.integer "agent_id", null: false
642
729
  t.integer "item_id", null: false
643
- t.integer "position"
730
+ t.integer "position", default: 1, null: false
644
731
  t.datetime "created_at"
645
732
  t.datetime "updated_at"
646
733
  t.index ["agent_id"], name: "index_owns_on_agent_id"
@@ -679,7 +766,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
679
766
  create_table "produces", force: :cascade do |t|
680
767
  t.integer "agent_id", null: false
681
768
  t.integer "manifestation_id", null: false
682
- t.integer "position"
769
+ t.integer "position", default: 1, null: false
683
770
  t.datetime "created_at"
684
771
  t.datetime "updated_at"
685
772
  t.integer "produce_type_id"
@@ -702,6 +789,8 @@ ActiveRecord::Schema.define(version: 20180107162711) do
702
789
  t.datetime "expired_at"
703
790
  t.text "full_name_transcription"
704
791
  t.datetime "date_of_birth"
792
+ t.index ["library_id"], name: "index_profiles_on_library_id"
793
+ t.index ["user_group_id"], name: "index_profiles_on_user_group_id"
705
794
  t.index ["user_id"], name: "index_profiles_on_user_id"
706
795
  t.index ["user_number"], name: "index_profiles_on_user_number", unique: true
707
796
  end
@@ -718,7 +807,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
718
807
  create_table "realizes", force: :cascade do |t|
719
808
  t.integer "agent_id", null: false
720
809
  t.integer "expression_id", null: false
721
- t.integer "position"
810
+ t.integer "position", default: 1, null: false
722
811
  t.datetime "created_at"
723
812
  t.datetime "updated_at"
724
813
  t.integer "realize_type_id"
@@ -730,7 +819,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
730
819
  t.string "name", null: false
731
820
  t.text "display_name"
732
821
  t.text "note"
733
- t.integer "position"
822
+ t.integer "position", default: 1, null: false
734
823
  t.datetime "created_at"
735
824
  t.datetime "updated_at"
736
825
  end
@@ -739,7 +828,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
739
828
  t.string "name", null: false
740
829
  t.text "display_name"
741
830
  t.text "note"
742
- t.integer "position"
831
+ t.integer "position", default: 1, null: false
743
832
  t.datetime "created_at"
744
833
  t.datetime "updated_at"
745
834
  end
@@ -835,7 +924,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
835
924
  t.text "query_param", null: false
836
925
  t.text "additional_param"
837
926
  t.text "note"
838
- t.integer "position"
927
+ t.integer "position", default: 1, null: false
839
928
  t.datetime "created_at"
840
929
  t.datetime "updated_at"
841
930
  end
@@ -885,7 +974,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
885
974
  t.text "note"
886
975
  t.integer "library_id", null: false
887
976
  t.integer "items_count", default: 0, null: false
888
- t.integer "position"
977
+ t.integer "position", default: 1, null: false
889
978
  t.datetime "created_at"
890
979
  t.datetime "updated_at"
891
980
  t.datetime "deleted_at"
@@ -947,7 +1036,7 @@ ActiveRecord::Schema.define(version: 20180107162711) do
947
1036
  t.string "name"
948
1037
  t.text "display_name"
949
1038
  t.text "note"
950
- t.integer "position"
1039
+ t.integer "position", default: 1, null: false
951
1040
  t.datetime "created_at"
952
1041
  t.datetime "updated_at"
953
1042
  t.datetime "deleted_at"
@@ -956,8 +1045,8 @@ ActiveRecord::Schema.define(version: 20180107162711) do
956
1045
  end
957
1046
 
958
1047
  create_table "user_has_roles", force: :cascade do |t|
959
- t.integer "user_id"
960
- t.integer "role_id"
1048
+ t.integer "user_id", null: false
1049
+ t.integer "role_id", null: false
961
1050
  t.datetime "created_at"
962
1051
  t.datetime "updated_at"
963
1052
  t.index ["role_id"], name: "index_user_has_roles_on_role_id"
@@ -1027,7 +1116,9 @@ ActiveRecord::Schema.define(version: 20180107162711) do
1027
1116
  t.string "unlock_token"
1028
1117
  t.datetime "locked_at"
1029
1118
  t.datetime "confirmed_at"
1119
+ t.integer "profile_id"
1030
1120
  t.index ["email"], name: "index_users_on_email"
1121
+ t.index ["profile_id"], name: "index_users_on_profile_id"
1031
1122
  t.index ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
1032
1123
  t.index ["unlock_token"], name: "index_users_on_unlock_token", unique: true
1033
1124
  t.index ["username"], name: "index_users_on_username", unique: true