enju_seed 0.3.0.beta.1 → 0.3.0.beta.2

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