enju_circulation 0.1.0.pre40 → 0.1.0.pre41
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.rdoc +8 -1
- data/app/controllers/checked_items_controller.rb +1 -1
- data/app/controllers/checkout_types_controller.rb +0 -7
- data/app/controllers/checkouts_controller.rb +1 -1
- data/app/controllers/manifestation_checkout_stats_controller.rb +22 -8
- data/app/controllers/reserves_controller.rb +17 -5
- data/app/models/carrier_type_has_checkout_type.rb +2 -3
- data/app/models/checked_item.rb +2 -3
- data/app/models/checkin.rb +2 -3
- data/app/models/checkout.rb +6 -2
- data/app/models/checkout_stat_has_manifestation.rb +2 -3
- data/app/models/checkout_stat_has_user.rb +2 -3
- data/app/models/checkout_type.rb +2 -3
- data/app/models/circulation_status.rb +2 -3
- data/app/models/item_has_use_restriction.rb +2 -3
- data/app/models/lending_policy.rb +2 -3
- data/app/models/manifestation_checkout_stat.rb +3 -3
- data/app/models/manifestation_checkout_stat_state_machine.rb +1 -1
- data/app/models/manifestation_checkout_stat_transition.rb +2 -2
- data/app/models/manifestation_reserve_stat.rb +3 -3
- data/app/models/manifestation_reserve_stat_transition.rb +2 -2
- data/app/models/reserve.rb +14 -11
- data/app/models/reserve_stat_has_manifestation.rb +2 -3
- data/app/models/reserve_stat_has_user.rb +2 -3
- data/app/models/reserve_transition.rb +2 -2
- data/app/models/use_restriction.rb +2 -3
- data/app/models/user_checkout_stat.rb +2 -2
- data/app/models/user_checkout_stat_transition.rb +2 -2
- data/app/models/user_group_has_checkout_type.rb +6 -7
- data/app/models/user_reserve_stat.rb +2 -2
- data/app/models/user_reserve_stat_transition.rb +2 -2
- data/app/views/checkouts/_list.html.erb +5 -0
- data/app/views/checkouts/index.rss.builder +3 -3
- data/app/views/manifestation_checkout_stats/_group_by_carrier_type.html.erb +53 -0
- data/app/views/manifestation_checkout_stats/_group_by_checkout_type.html.erb +54 -0
- data/app/views/manifestation_checkout_stats/show.html.erb +6 -38
- data/app/views/reserves/_new.html.erb +6 -1
- data/app/views/reserves/_new_user.html.erb +6 -1
- data/app/views/reserves/edit.html.erb +5 -0
- data/app/views/reserves/index.html.erb +2 -0
- data/app/views/reserves/index.rss.builder +2 -2
- data/app/views/reserves/show.html.erb +5 -0
- data/config/locales/translation_en.yml +2 -0
- data/config/locales/translation_ja.yml +2 -0
- data/db/migrate/20111129044509_add_pickup_location_to_reserve.rb +6 -0
- data/db/migrate/20140518050147_create_reserve_transitions.rb +5 -1
- data/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +5 -1
- data/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +5 -1
- data/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +5 -1
- data/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +5 -1
- data/db/migrate/20141014065831_add_shelf_id_to_checkout.rb +6 -0
- data/db/migrate/20141020120523_add_library_id_to_checkout.rb +6 -0
- data/lib/enju_circulation/accept.rb +22 -0
- data/lib/enju_circulation/basket.rb +37 -0
- data/lib/enju_circulation/item.rb +14 -8
- data/lib/enju_circulation/profile.rb +1 -1
- data/lib/enju_circulation/version.rb +1 -1
- data/lib/enju_circulation.rb +4 -0
- data/lib/tasks/checkout.rb +7 -0
- data/lib/tasks/enju_circulation_tasks.rake +10 -2
- data/spec/controllers/manifestation_checkout_stats_controller_spec.rb +2 -0
- data/spec/dummy/config/database.yml +23 -18
- data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +5 -1
- data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +5 -1
- data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +5 -1
- data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +5 -1
- data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +5 -1
- data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +5 -1
- data/spec/dummy/db/schema.rb +561 -555
- data/spec/fixtures/carrier_type_has_checkout_types.yml +2 -3
- data/spec/fixtures/checked_items.yml +6 -7
- data/spec/fixtures/checkins.yml +2 -3
- data/spec/fixtures/checkout_stat_has_manifestations.yml +2 -3
- data/spec/fixtures/checkout_stat_has_users.yml +2 -3
- data/spec/fixtures/checkout_types.yml +2 -3
- data/spec/fixtures/checkouts.yml +17 -15
- data/spec/fixtures/circulation_statuses.yml +2 -3
- data/spec/fixtures/item_has_use_restrictions.yml +2 -3
- data/spec/fixtures/lending_policies.yml +2 -3
- data/spec/fixtures/manifestation_checkout_stats.yml +2 -2
- data/spec/fixtures/manifestation_reserve_stats.yml +2 -2
- data/spec/fixtures/manifestations.yml +114 -114
- data/spec/fixtures/reserve_stat_has_manifestations.yml +2 -3
- data/spec/fixtures/reserve_stat_has_users.yml +2 -3
- data/spec/fixtures/reserve_transitions.yml +2 -2
- data/spec/fixtures/reserves.yml +20 -19
- data/spec/fixtures/use_restrictions.yml +2 -3
- data/spec/fixtures/user_checkout_stats.yml +2 -2
- data/spec/fixtures/user_group_has_checkout_types.yml +2 -3
- data/spec/fixtures/user_reserve_stats.yml +2 -2
- data/spec/fixtures/users.yml +1 -1
- data/spec/models/basket_spec.rb +15 -2
- data/spec/models/carrier_type_has_checkout_type_spec.rb +2 -3
- data/spec/models/checked_item_spec.rb +2 -3
- data/spec/models/checkin_spec.rb +2 -3
- data/spec/models/checkout_spec.rb +4 -2
- data/spec/models/checkout_stat_has_manifestation_spec.rb +2 -3
- data/spec/models/checkout_stat_has_user_spec.rb +2 -3
- data/spec/models/checkout_type_spec.rb +2 -3
- data/spec/models/circulation_status_spec.rb +2 -3
- data/spec/models/lending_policy_spec.rb +2 -3
- data/spec/models/manifestation_checkout_stat_spec.rb +5 -4
- data/spec/models/manifestation_reserve_stat_spec.rb +2 -2
- data/spec/models/reserve_spec.rb +3 -2
- data/spec/models/reserve_stat_has_manifestation_spec.rb +2 -3
- data/spec/models/reserve_stat_has_user_spec.rb +2 -3
- data/spec/models/user_checkout_stat_spec.rb +2 -2
- data/spec/models/user_group_has_checkout_type_spec.rb +2 -3
- data/spec/models/user_reserve_stat_spec.rb +2 -2
- data/spec/spec_helper.rb +2 -0
- metadata +44 -8
data/spec/dummy/db/schema.rb
CHANGED
@@ -9,23 +9,23 @@
|
|
9
9
|
# from scratch. The latter is a flawed and unsustainable approach (the more migrations
|
10
10
|
# you'll amass, the slower it'll run and the greater likelihood for issues).
|
11
11
|
#
|
12
|
-
# It's strongly recommended
|
12
|
+
# It's strongly recommended that you check this file into your version control system.
|
13
13
|
|
14
|
-
ActiveRecord::Schema.define(:
|
14
|
+
ActiveRecord::Schema.define(version: 20141020120523) do
|
15
15
|
|
16
|
-
create_table "agent_import_file_transitions", :
|
16
|
+
create_table "agent_import_file_transitions", force: true do |t|
|
17
17
|
t.string "to_state"
|
18
|
-
t.text "metadata", :
|
18
|
+
t.text "metadata", default: "{}"
|
19
19
|
t.integer "sort_key"
|
20
20
|
t.integer "agent_import_file_id"
|
21
|
-
t.datetime "created_at"
|
22
|
-
t.datetime "updated_at"
|
21
|
+
t.datetime "created_at"
|
22
|
+
t.datetime "updated_at"
|
23
23
|
end
|
24
24
|
|
25
|
-
add_index "agent_import_file_transitions", ["agent_import_file_id"], :
|
26
|
-
add_index "agent_import_file_transitions", ["sort_key", "agent_import_file_id"], :
|
25
|
+
add_index "agent_import_file_transitions", ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
|
26
|
+
add_index "agent_import_file_transitions", ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
|
27
27
|
|
28
|
-
create_table "agent_import_files", :
|
28
|
+
create_table "agent_import_files", force: true do |t|
|
29
29
|
t.integer "parent_id"
|
30
30
|
t.string "content_type"
|
31
31
|
t.integer "size"
|
@@ -36,72 +36,72 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
36
36
|
t.string "agent_import_content_type"
|
37
37
|
t.integer "agent_import_file_size"
|
38
38
|
t.datetime "agent_import_updated_at"
|
39
|
-
t.datetime "created_at"
|
40
|
-
t.datetime "updated_at"
|
39
|
+
t.datetime "created_at"
|
40
|
+
t.datetime "updated_at"
|
41
41
|
t.string "agent_import_fingerprint"
|
42
42
|
t.text "error_message"
|
43
43
|
t.string "edit_mode"
|
44
44
|
t.string "user_encoding"
|
45
45
|
end
|
46
46
|
|
47
|
-
add_index "agent_import_files", ["parent_id"], :
|
48
|
-
add_index "agent_import_files", ["user_id"], :
|
47
|
+
add_index "agent_import_files", ["parent_id"], name: "index_agent_import_files_on_parent_id"
|
48
|
+
add_index "agent_import_files", ["user_id"], name: "index_agent_import_files_on_user_id"
|
49
49
|
|
50
|
-
create_table "agent_import_results", :
|
50
|
+
create_table "agent_import_results", force: true do |t|
|
51
51
|
t.integer "agent_import_file_id"
|
52
52
|
t.integer "agent_id"
|
53
53
|
t.text "body"
|
54
|
-
t.datetime "created_at"
|
55
|
-
t.datetime "updated_at"
|
54
|
+
t.datetime "created_at"
|
55
|
+
t.datetime "updated_at"
|
56
56
|
end
|
57
57
|
|
58
|
-
create_table "agent_merge_lists", :
|
58
|
+
create_table "agent_merge_lists", force: true do |t|
|
59
59
|
t.string "title"
|
60
|
-
t.datetime "created_at"
|
61
|
-
t.datetime "updated_at"
|
60
|
+
t.datetime "created_at"
|
61
|
+
t.datetime "updated_at"
|
62
62
|
end
|
63
63
|
|
64
|
-
create_table "agent_merges", :
|
65
|
-
t.integer "agent_id", :
|
66
|
-
t.integer "agent_merge_list_id", :
|
67
|
-
t.datetime "created_at"
|
68
|
-
t.datetime "updated_at"
|
64
|
+
create_table "agent_merges", force: true do |t|
|
65
|
+
t.integer "agent_id", null: false
|
66
|
+
t.integer "agent_merge_list_id", null: false
|
67
|
+
t.datetime "created_at"
|
68
|
+
t.datetime "updated_at"
|
69
69
|
end
|
70
70
|
|
71
|
-
add_index "agent_merges", ["agent_id"], :
|
72
|
-
add_index "agent_merges", ["agent_merge_list_id"], :
|
71
|
+
add_index "agent_merges", ["agent_id"], name: "index_agent_merges_on_agent_id"
|
72
|
+
add_index "agent_merges", ["agent_merge_list_id"], name: "index_agent_merges_on_agent_merge_list_id"
|
73
73
|
|
74
|
-
create_table "agent_relationship_types", :
|
75
|
-
t.string "name", :
|
74
|
+
create_table "agent_relationship_types", force: true do |t|
|
75
|
+
t.string "name", null: false
|
76
76
|
t.text "display_name"
|
77
77
|
t.text "note"
|
78
78
|
t.integer "position"
|
79
|
-
t.datetime "created_at"
|
80
|
-
t.datetime "updated_at"
|
79
|
+
t.datetime "created_at"
|
80
|
+
t.datetime "updated_at"
|
81
81
|
end
|
82
82
|
|
83
|
-
create_table "agent_relationships", :
|
83
|
+
create_table "agent_relationships", force: true do |t|
|
84
84
|
t.integer "parent_id"
|
85
85
|
t.integer "child_id"
|
86
86
|
t.integer "agent_relationship_type_id"
|
87
|
-
t.datetime "created_at"
|
88
|
-
t.datetime "updated_at"
|
87
|
+
t.datetime "created_at"
|
88
|
+
t.datetime "updated_at"
|
89
89
|
t.integer "position"
|
90
90
|
end
|
91
91
|
|
92
|
-
add_index "agent_relationships", ["child_id"], :
|
93
|
-
add_index "agent_relationships", ["parent_id"], :
|
92
|
+
add_index "agent_relationships", ["child_id"], name: "index_agent_relationships_on_child_id"
|
93
|
+
add_index "agent_relationships", ["parent_id"], name: "index_agent_relationships_on_parent_id"
|
94
94
|
|
95
|
-
create_table "agent_types", :
|
96
|
-
t.string "name", :
|
95
|
+
create_table "agent_types", force: true do |t|
|
96
|
+
t.string "name", null: false
|
97
97
|
t.text "display_name"
|
98
98
|
t.text "note"
|
99
99
|
t.integer "position"
|
100
|
-
t.datetime "created_at"
|
101
|
-
t.datetime "updated_at"
|
100
|
+
t.datetime "created_at"
|
101
|
+
t.datetime "updated_at"
|
102
102
|
end
|
103
103
|
|
104
|
-
create_table "agents", :
|
104
|
+
create_table "agents", force: true do |t|
|
105
105
|
t.string "last_name"
|
106
106
|
t.string "middle_name"
|
107
107
|
t.string "first_name"
|
@@ -113,8 +113,8 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
113
113
|
t.string "full_name"
|
114
114
|
t.text "full_name_transcription"
|
115
115
|
t.text "full_name_alternative"
|
116
|
-
t.datetime "created_at"
|
117
|
-
t.datetime "updated_at"
|
116
|
+
t.datetime "created_at"
|
117
|
+
t.datetime "updated_at"
|
118
118
|
t.datetime "deleted_at"
|
119
119
|
t.string "zip_code_1"
|
120
120
|
t.string "zip_code_2"
|
@@ -134,13 +134,13 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
134
134
|
t.text "region"
|
135
135
|
t.datetime "date_of_birth"
|
136
136
|
t.datetime "date_of_death"
|
137
|
-
t.integer "language_id", :
|
138
|
-
t.integer "country_id", :
|
139
|
-
t.integer "agent_type_id", :
|
140
|
-
t.integer "lock_version", :
|
137
|
+
t.integer "language_id", default: 1, null: false
|
138
|
+
t.integer "country_id", default: 1, null: false
|
139
|
+
t.integer "agent_type_id", default: 1, null: false
|
140
|
+
t.integer "lock_version", default: 0, null: false
|
141
141
|
t.text "note"
|
142
|
-
t.integer "required_role_id", :
|
143
|
-
t.integer "required_score", :
|
142
|
+
t.integer "required_role_id", default: 1, null: false
|
143
|
+
t.integer "required_score", default: 0, null: false
|
144
144
|
t.text "email"
|
145
145
|
t.text "url"
|
146
146
|
t.text "full_name_alternative_transcription"
|
@@ -149,141 +149,145 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
149
149
|
t.string "agent_identifier"
|
150
150
|
end
|
151
151
|
|
152
|
-
add_index "agents", ["agent_identifier"], :
|
153
|
-
add_index "agents", ["country_id"], :
|
154
|
-
add_index "agents", ["full_name"], :
|
155
|
-
add_index "agents", ["language_id"], :
|
156
|
-
add_index "agents", ["required_role_id"], :
|
152
|
+
add_index "agents", ["agent_identifier"], name: "index_agents_on_agent_identifier"
|
153
|
+
add_index "agents", ["country_id"], name: "index_agents_on_country_id"
|
154
|
+
add_index "agents", ["full_name"], name: "index_agents_on_full_name"
|
155
|
+
add_index "agents", ["language_id"], name: "index_agents_on_language_id"
|
156
|
+
add_index "agents", ["required_role_id"], name: "index_agents_on_required_role_id"
|
157
157
|
|
158
|
-
create_table "baskets", :
|
158
|
+
create_table "baskets", force: true do |t|
|
159
159
|
t.integer "user_id"
|
160
160
|
t.text "note"
|
161
|
-
t.integer "lock_version", :
|
162
|
-
t.datetime "created_at"
|
163
|
-
t.datetime "updated_at"
|
161
|
+
t.integer "lock_version", default: 0, null: false
|
162
|
+
t.datetime "created_at"
|
163
|
+
t.datetime "updated_at"
|
164
164
|
end
|
165
165
|
|
166
|
-
add_index "baskets", ["user_id"], :
|
166
|
+
add_index "baskets", ["user_id"], name: "index_baskets_on_user_id"
|
167
167
|
|
168
|
-
create_table "carrier_type_has_checkout_types", :
|
169
|
-
t.integer "carrier_type_id", :
|
170
|
-
t.integer "checkout_type_id", :
|
168
|
+
create_table "carrier_type_has_checkout_types", force: true do |t|
|
169
|
+
t.integer "carrier_type_id", null: false
|
170
|
+
t.integer "checkout_type_id", null: false
|
171
171
|
t.text "note"
|
172
172
|
t.integer "position"
|
173
|
-
t.datetime "created_at"
|
174
|
-
t.datetime "updated_at"
|
173
|
+
t.datetime "created_at"
|
174
|
+
t.datetime "updated_at"
|
175
175
|
end
|
176
176
|
|
177
|
-
add_index "carrier_type_has_checkout_types", ["carrier_type_id"], :
|
178
|
-
add_index "carrier_type_has_checkout_types", ["checkout_type_id"], :
|
177
|
+
add_index "carrier_type_has_checkout_types", ["carrier_type_id"], name: "index_carrier_type_has_checkout_types_on_m_form_id"
|
178
|
+
add_index "carrier_type_has_checkout_types", ["checkout_type_id"], name: "index_carrier_type_has_checkout_types_on_checkout_type_id"
|
179
179
|
|
180
|
-
create_table "carrier_types", :
|
181
|
-
t.string "name", :
|
180
|
+
create_table "carrier_types", force: true do |t|
|
181
|
+
t.string "name", null: false
|
182
182
|
t.text "display_name"
|
183
183
|
t.text "note"
|
184
184
|
t.integer "position"
|
185
|
-
t.datetime "created_at"
|
186
|
-
t.datetime "updated_at"
|
185
|
+
t.datetime "created_at"
|
186
|
+
t.datetime "updated_at"
|
187
187
|
end
|
188
188
|
|
189
|
-
create_table "checked_items", :
|
190
|
-
t.integer "item_id", :
|
191
|
-
t.integer "basket_id", :
|
192
|
-
t.datetime "due_date", :
|
193
|
-
t.datetime "created_at"
|
194
|
-
t.datetime "updated_at"
|
189
|
+
create_table "checked_items", force: true do |t|
|
190
|
+
t.integer "item_id", null: false
|
191
|
+
t.integer "basket_id", null: false
|
192
|
+
t.datetime "due_date", null: false
|
193
|
+
t.datetime "created_at"
|
194
|
+
t.datetime "updated_at"
|
195
195
|
t.integer "librarian_id"
|
196
196
|
end
|
197
197
|
|
198
|
-
add_index "checked_items", ["basket_id"], :
|
199
|
-
add_index "checked_items", ["item_id"], :
|
198
|
+
add_index "checked_items", ["basket_id"], name: "index_checked_items_on_basket_id"
|
199
|
+
add_index "checked_items", ["item_id"], name: "index_checked_items_on_item_id"
|
200
200
|
|
201
|
-
create_table "checkins", :
|
202
|
-
t.integer "item_id",
|
201
|
+
create_table "checkins", force: true do |t|
|
202
|
+
t.integer "item_id", null: false
|
203
203
|
t.integer "librarian_id"
|
204
204
|
t.integer "basket_id"
|
205
|
-
t.datetime "created_at"
|
206
|
-
t.datetime "updated_at"
|
207
|
-
t.integer "lock_version", :
|
205
|
+
t.datetime "created_at"
|
206
|
+
t.datetime "updated_at"
|
207
|
+
t.integer "lock_version", default: 0, null: false
|
208
208
|
end
|
209
209
|
|
210
|
-
add_index "checkins", ["basket_id"], :
|
211
|
-
add_index "checkins", ["item_id"], :
|
212
|
-
add_index "checkins", ["librarian_id"], :
|
210
|
+
add_index "checkins", ["basket_id"], name: "index_checkins_on_basket_id"
|
211
|
+
add_index "checkins", ["item_id"], name: "index_checkins_on_item_id"
|
212
|
+
add_index "checkins", ["librarian_id"], name: "index_checkins_on_librarian_id"
|
213
213
|
|
214
|
-
create_table "checkout_stat_has_manifestations", :
|
215
|
-
t.integer "manifestation_checkout_stat_id", :
|
216
|
-
t.integer "manifestation_id", :
|
214
|
+
create_table "checkout_stat_has_manifestations", force: true do |t|
|
215
|
+
t.integer "manifestation_checkout_stat_id", null: false
|
216
|
+
t.integer "manifestation_id", null: false
|
217
217
|
t.integer "checkouts_count"
|
218
|
-
t.datetime "created_at"
|
219
|
-
t.datetime "updated_at"
|
218
|
+
t.datetime "created_at"
|
219
|
+
t.datetime "updated_at"
|
220
220
|
end
|
221
221
|
|
222
|
-
add_index "checkout_stat_has_manifestations", ["manifestation_checkout_stat_id"], :
|
223
|
-
add_index "checkout_stat_has_manifestations", ["manifestation_id"], :
|
222
|
+
add_index "checkout_stat_has_manifestations", ["manifestation_checkout_stat_id"], name: "index_checkout_stat_has_manifestations_on_checkout_stat_id"
|
223
|
+
add_index "checkout_stat_has_manifestations", ["manifestation_id"], name: "index_checkout_stat_has_manifestations_on_manifestation_id"
|
224
224
|
|
225
|
-
create_table "checkout_stat_has_users", :
|
226
|
-
t.integer "user_checkout_stat_id",
|
227
|
-
t.integer "user_id",
|
228
|
-
t.integer "checkouts_count", :
|
229
|
-
t.datetime "created_at"
|
230
|
-
t.datetime "updated_at"
|
225
|
+
create_table "checkout_stat_has_users", force: true do |t|
|
226
|
+
t.integer "user_checkout_stat_id", null: false
|
227
|
+
t.integer "user_id", null: false
|
228
|
+
t.integer "checkouts_count", default: 0, null: false
|
229
|
+
t.datetime "created_at"
|
230
|
+
t.datetime "updated_at"
|
231
231
|
end
|
232
232
|
|
233
|
-
add_index "checkout_stat_has_users", ["user_checkout_stat_id"], :
|
234
|
-
add_index "checkout_stat_has_users", ["user_id"], :
|
233
|
+
add_index "checkout_stat_has_users", ["user_checkout_stat_id"], name: "index_checkout_stat_has_users_on_user_checkout_stat_id"
|
234
|
+
add_index "checkout_stat_has_users", ["user_id"], name: "index_checkout_stat_has_users_on_user_id"
|
235
235
|
|
236
|
-
create_table "checkout_types", :
|
237
|
-
t.string "name", :
|
236
|
+
create_table "checkout_types", force: true do |t|
|
237
|
+
t.string "name", null: false
|
238
238
|
t.text "display_name"
|
239
239
|
t.text "note"
|
240
240
|
t.integer "position"
|
241
|
-
t.datetime "created_at"
|
242
|
-
t.datetime "updated_at"
|
241
|
+
t.datetime "created_at"
|
242
|
+
t.datetime "updated_at"
|
243
243
|
end
|
244
244
|
|
245
|
-
add_index "checkout_types", ["name"], :
|
245
|
+
add_index "checkout_types", ["name"], name: "index_checkout_types_on_name"
|
246
246
|
|
247
|
-
create_table "checkouts", :
|
247
|
+
create_table "checkouts", force: true do |t|
|
248
248
|
t.integer "user_id"
|
249
|
-
t.integer "item_id",
|
249
|
+
t.integer "item_id", null: false
|
250
250
|
t.integer "checkin_id"
|
251
251
|
t.integer "librarian_id"
|
252
252
|
t.integer "basket_id"
|
253
253
|
t.datetime "due_date"
|
254
|
-
t.integer "checkout_renewal_count", :
|
255
|
-
t.integer "lock_version", :
|
256
|
-
t.datetime "created_at"
|
257
|
-
t.datetime "updated_at"
|
254
|
+
t.integer "checkout_renewal_count", default: 0, null: false
|
255
|
+
t.integer "lock_version", default: 0, null: false
|
256
|
+
t.datetime "created_at"
|
257
|
+
t.datetime "updated_at"
|
258
|
+
t.integer "shelf_id"
|
259
|
+
t.integer "library_id"
|
258
260
|
end
|
259
261
|
|
260
|
-
add_index "checkouts", ["basket_id"], :
|
261
|
-
add_index "checkouts", ["checkin_id"], :
|
262
|
-
add_index "checkouts", ["item_id", "basket_id"], :
|
263
|
-
add_index "checkouts", ["item_id"], :
|
264
|
-
add_index "checkouts", ["librarian_id"], :
|
265
|
-
add_index "checkouts", ["
|
262
|
+
add_index "checkouts", ["basket_id"], name: "index_checkouts_on_basket_id"
|
263
|
+
add_index "checkouts", ["checkin_id"], name: "index_checkouts_on_checkin_id"
|
264
|
+
add_index "checkouts", ["item_id", "basket_id"], name: "index_checkouts_on_item_id_and_basket_id", unique: true
|
265
|
+
add_index "checkouts", ["item_id"], name: "index_checkouts_on_item_id"
|
266
|
+
add_index "checkouts", ["librarian_id"], name: "index_checkouts_on_librarian_id"
|
267
|
+
add_index "checkouts", ["library_id"], name: "index_checkouts_on_library_id"
|
268
|
+
add_index "checkouts", ["shelf_id"], name: "index_checkouts_on_shelf_id"
|
269
|
+
add_index "checkouts", ["user_id"], name: "index_checkouts_on_user_id"
|
266
270
|
|
267
|
-
create_table "circulation_statuses", :
|
268
|
-
t.string "name", :
|
271
|
+
create_table "circulation_statuses", force: true do |t|
|
272
|
+
t.string "name", null: false
|
269
273
|
t.text "display_name"
|
270
274
|
t.text "note"
|
271
275
|
t.integer "position"
|
272
|
-
t.datetime "created_at"
|
273
|
-
t.datetime "updated_at"
|
276
|
+
t.datetime "created_at"
|
277
|
+
t.datetime "updated_at"
|
274
278
|
end
|
275
279
|
|
276
|
-
create_table "content_types", :
|
277
|
-
t.string "name", :
|
280
|
+
create_table "content_types", force: true do |t|
|
281
|
+
t.string "name", null: false
|
278
282
|
t.text "display_name"
|
279
283
|
t.text "note"
|
280
284
|
t.integer "position"
|
281
|
-
t.datetime "created_at"
|
282
|
-
t.datetime "updated_at"
|
285
|
+
t.datetime "created_at"
|
286
|
+
t.datetime "updated_at"
|
283
287
|
end
|
284
288
|
|
285
|
-
create_table "countries", :
|
286
|
-
t.string "name", :
|
289
|
+
create_table "countries", force: true do |t|
|
290
|
+
t.string "name", null: false
|
287
291
|
t.text "display_name"
|
288
292
|
t.string "alpha_2"
|
289
293
|
t.string "alpha_3"
|
@@ -292,35 +296,35 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
292
296
|
t.integer "position"
|
293
297
|
end
|
294
298
|
|
295
|
-
add_index "countries", ["alpha_2"], :
|
296
|
-
add_index "countries", ["alpha_3"], :
|
297
|
-
add_index "countries", ["name"], :
|
298
|
-
add_index "countries", ["numeric_3"], :
|
299
|
+
add_index "countries", ["alpha_2"], name: "index_countries_on_alpha_2"
|
300
|
+
add_index "countries", ["alpha_3"], name: "index_countries_on_alpha_3"
|
301
|
+
add_index "countries", ["name"], name: "index_countries_on_name"
|
302
|
+
add_index "countries", ["numeric_3"], name: "index_countries_on_numeric_3"
|
299
303
|
|
300
|
-
create_table "create_types", :
|
304
|
+
create_table "create_types", force: true do |t|
|
301
305
|
t.string "name"
|
302
306
|
t.text "display_name"
|
303
307
|
t.text "note"
|
304
308
|
t.integer "position"
|
305
|
-
t.datetime "created_at"
|
306
|
-
t.datetime "updated_at"
|
309
|
+
t.datetime "created_at"
|
310
|
+
t.datetime "updated_at"
|
307
311
|
end
|
308
312
|
|
309
|
-
create_table "creates", :
|
310
|
-
t.integer "agent_id", :
|
311
|
-
t.integer "work_id", :
|
313
|
+
create_table "creates", force: true do |t|
|
314
|
+
t.integer "agent_id", null: false
|
315
|
+
t.integer "work_id", null: false
|
312
316
|
t.integer "position"
|
313
|
-
t.datetime "created_at"
|
314
|
-
t.datetime "updated_at"
|
317
|
+
t.datetime "created_at"
|
318
|
+
t.datetime "updated_at"
|
315
319
|
t.integer "create_type_id"
|
316
320
|
end
|
317
321
|
|
318
|
-
add_index "creates", ["agent_id"], :
|
319
|
-
add_index "creates", ["work_id"], :
|
322
|
+
add_index "creates", ["agent_id"], name: "index_creates_on_agent_id"
|
323
|
+
add_index "creates", ["work_id"], name: "index_creates_on_work_id"
|
320
324
|
|
321
|
-
create_table "delayed_jobs", :
|
322
|
-
t.integer "priority", :
|
323
|
-
t.integer "attempts", :
|
325
|
+
create_table "delayed_jobs", force: true do |t|
|
326
|
+
t.integer "priority", default: 0
|
327
|
+
t.integer "attempts", default: 0
|
324
328
|
t.text "handler"
|
325
329
|
t.text "last_error"
|
326
330
|
t.datetime "run_at"
|
@@ -328,178 +332,178 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
328
332
|
t.datetime "failed_at"
|
329
333
|
t.string "locked_by"
|
330
334
|
t.string "queue"
|
331
|
-
t.datetime "created_at"
|
332
|
-
t.datetime "updated_at"
|
335
|
+
t.datetime "created_at"
|
336
|
+
t.datetime "updated_at"
|
333
337
|
end
|
334
338
|
|
335
|
-
add_index "delayed_jobs", ["priority", "run_at"], :
|
339
|
+
add_index "delayed_jobs", ["priority", "run_at"], name: "delayed_jobs_priority"
|
336
340
|
|
337
|
-
create_table "donates", :
|
338
|
-
t.integer "agent_id", :
|
339
|
-
t.integer "item_id", :
|
340
|
-
t.datetime "created_at"
|
341
|
-
t.datetime "updated_at"
|
341
|
+
create_table "donates", force: true do |t|
|
342
|
+
t.integer "agent_id", null: false
|
343
|
+
t.integer "item_id", null: false
|
344
|
+
t.datetime "created_at"
|
345
|
+
t.datetime "updated_at"
|
342
346
|
end
|
343
347
|
|
344
|
-
add_index "donates", ["agent_id"], :
|
345
|
-
add_index "donates", ["item_id"], :
|
348
|
+
add_index "donates", ["agent_id"], name: "index_donates_on_agent_id"
|
349
|
+
add_index "donates", ["item_id"], name: "index_donates_on_item_id"
|
346
350
|
|
347
|
-
create_table "event_categories", :
|
348
|
-
t.string "name", :
|
351
|
+
create_table "event_categories", force: true do |t|
|
352
|
+
t.string "name", null: false
|
349
353
|
t.text "display_name"
|
350
354
|
t.text "note"
|
351
355
|
t.integer "position"
|
352
|
-
t.datetime "created_at"
|
353
|
-
t.datetime "updated_at"
|
356
|
+
t.datetime "created_at"
|
357
|
+
t.datetime "updated_at"
|
354
358
|
end
|
355
359
|
|
356
|
-
create_table "events", :
|
357
|
-
t.integer "library_id", :
|
358
|
-
t.integer "event_category_id", :
|
360
|
+
create_table "events", force: true do |t|
|
361
|
+
t.integer "library_id", default: 1, null: false
|
362
|
+
t.integer "event_category_id", default: 1, null: false
|
359
363
|
t.string "name"
|
360
364
|
t.text "note"
|
361
365
|
t.datetime "start_at"
|
362
366
|
t.datetime "end_at"
|
363
|
-
t.boolean "all_day", :
|
367
|
+
t.boolean "all_day", default: false, null: false
|
364
368
|
t.datetime "deleted_at"
|
365
369
|
t.text "display_name"
|
366
|
-
t.datetime "created_at"
|
367
|
-
t.datetime "updated_at"
|
370
|
+
t.datetime "created_at"
|
371
|
+
t.datetime "updated_at"
|
368
372
|
end
|
369
373
|
|
370
|
-
add_index "events", ["event_category_id"], :
|
371
|
-
add_index "events", ["library_id"], :
|
374
|
+
add_index "events", ["event_category_id"], name: "index_events_on_event_category_id"
|
375
|
+
add_index "events", ["library_id"], name: "index_events_on_library_id"
|
372
376
|
|
373
|
-
create_table "exemplifies", :
|
374
|
-
t.integer "manifestation_id", :
|
375
|
-
t.integer "item_id", :
|
377
|
+
create_table "exemplifies", force: true do |t|
|
378
|
+
t.integer "manifestation_id", null: false
|
379
|
+
t.integer "item_id", null: false
|
376
380
|
t.integer "position"
|
377
|
-
t.datetime "created_at"
|
378
|
-
t.datetime "updated_at"
|
381
|
+
t.datetime "created_at"
|
382
|
+
t.datetime "updated_at"
|
379
383
|
end
|
380
384
|
|
381
|
-
add_index "exemplifies", ["item_id"], :
|
382
|
-
add_index "exemplifies", ["manifestation_id"], :
|
385
|
+
add_index "exemplifies", ["item_id"], name: "index_exemplifies_on_item_id", unique: true
|
386
|
+
add_index "exemplifies", ["manifestation_id"], name: "index_exemplifies_on_manifestation_id"
|
383
387
|
|
384
|
-
create_table "extents", :
|
385
|
-
t.string "name", :
|
388
|
+
create_table "extents", force: true do |t|
|
389
|
+
t.string "name", null: false
|
386
390
|
t.text "display_name"
|
387
391
|
t.text "note"
|
388
392
|
t.integer "position"
|
389
|
-
t.datetime "created_at"
|
390
|
-
t.datetime "updated_at"
|
393
|
+
t.datetime "created_at"
|
394
|
+
t.datetime "updated_at"
|
391
395
|
end
|
392
396
|
|
393
|
-
create_table "form_of_works", :
|
394
|
-
t.string "name", :
|
397
|
+
create_table "form_of_works", force: true do |t|
|
398
|
+
t.string "name", null: false
|
395
399
|
t.text "display_name"
|
396
400
|
t.text "note"
|
397
401
|
t.integer "position"
|
398
|
-
t.datetime "created_at"
|
399
|
-
t.datetime "updated_at"
|
402
|
+
t.datetime "created_at"
|
403
|
+
t.datetime "updated_at"
|
400
404
|
end
|
401
405
|
|
402
|
-
create_table "frequencies", :
|
403
|
-
t.string "name", :
|
406
|
+
create_table "frequencies", force: true do |t|
|
407
|
+
t.string "name", null: false
|
404
408
|
t.text "display_name"
|
405
409
|
t.text "note"
|
406
410
|
t.integer "position"
|
407
|
-
t.datetime "created_at"
|
408
|
-
t.datetime "updated_at"
|
411
|
+
t.datetime "created_at"
|
412
|
+
t.datetime "updated_at"
|
409
413
|
end
|
410
414
|
|
411
|
-
create_table "identifier_types", :
|
415
|
+
create_table "identifier_types", force: true do |t|
|
412
416
|
t.string "name"
|
413
417
|
t.text "display_name"
|
414
418
|
t.text "note"
|
415
419
|
t.integer "position"
|
416
|
-
t.datetime "created_at"
|
417
|
-
t.datetime "updated_at"
|
420
|
+
t.datetime "created_at"
|
421
|
+
t.datetime "updated_at"
|
418
422
|
end
|
419
423
|
|
420
|
-
create_table "identifiers", :
|
421
|
-
t.string "body", :
|
422
|
-
t.integer "identifier_type_id", :
|
424
|
+
create_table "identifiers", force: true do |t|
|
425
|
+
t.string "body", null: false
|
426
|
+
t.integer "identifier_type_id", null: false
|
423
427
|
t.integer "manifestation_id"
|
424
428
|
t.boolean "primary"
|
425
429
|
t.integer "position"
|
426
|
-
t.datetime "created_at"
|
427
|
-
t.datetime "updated_at"
|
430
|
+
t.datetime "created_at"
|
431
|
+
t.datetime "updated_at"
|
428
432
|
end
|
429
433
|
|
430
|
-
add_index "identifiers", ["body", "identifier_type_id"], :
|
431
|
-
add_index "identifiers", ["manifestation_id"], :
|
434
|
+
add_index "identifiers", ["body", "identifier_type_id"], name: "index_identifiers_on_body_and_identifier_type_id"
|
435
|
+
add_index "identifiers", ["manifestation_id"], name: "index_identifiers_on_manifestation_id"
|
432
436
|
|
433
|
-
create_table "import_request_transitions", :
|
437
|
+
create_table "import_request_transitions", force: true do |t|
|
434
438
|
t.string "to_state"
|
435
|
-
t.text "metadata", :
|
439
|
+
t.text "metadata", default: "{}"
|
436
440
|
t.integer "sort_key"
|
437
441
|
t.integer "import_request_id"
|
438
|
-
t.datetime "created_at"
|
439
|
-
t.datetime "updated_at"
|
442
|
+
t.datetime "created_at"
|
443
|
+
t.datetime "updated_at"
|
440
444
|
end
|
441
445
|
|
442
|
-
add_index "import_request_transitions", ["import_request_id"], :
|
443
|
-
add_index "import_request_transitions", ["sort_key", "import_request_id"], :
|
446
|
+
add_index "import_request_transitions", ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
|
447
|
+
add_index "import_request_transitions", ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
|
444
448
|
|
445
|
-
create_table "import_requests", :
|
449
|
+
create_table "import_requests", force: true do |t|
|
446
450
|
t.string "isbn"
|
447
451
|
t.integer "manifestation_id"
|
448
452
|
t.integer "user_id"
|
449
|
-
t.datetime "created_at"
|
450
|
-
t.datetime "updated_at"
|
453
|
+
t.datetime "created_at"
|
454
|
+
t.datetime "updated_at"
|
451
455
|
end
|
452
456
|
|
453
|
-
add_index "import_requests", ["isbn"], :
|
454
|
-
add_index "import_requests", ["manifestation_id"], :
|
455
|
-
add_index "import_requests", ["user_id"], :
|
457
|
+
add_index "import_requests", ["isbn"], name: "index_import_requests_on_isbn"
|
458
|
+
add_index "import_requests", ["manifestation_id"], name: "index_import_requests_on_manifestation_id"
|
459
|
+
add_index "import_requests", ["user_id"], name: "index_import_requests_on_user_id"
|
456
460
|
|
457
|
-
create_table "item_has_use_restrictions", :
|
458
|
-
t.integer "item_id", :
|
459
|
-
t.integer "use_restriction_id", :
|
460
|
-
t.datetime "created_at"
|
461
|
-
t.datetime "updated_at"
|
461
|
+
create_table "item_has_use_restrictions", force: true do |t|
|
462
|
+
t.integer "item_id", null: false
|
463
|
+
t.integer "use_restriction_id", null: false
|
464
|
+
t.datetime "created_at"
|
465
|
+
t.datetime "updated_at"
|
462
466
|
end
|
463
467
|
|
464
|
-
add_index "item_has_use_restrictions", ["item_id"], :
|
465
|
-
add_index "item_has_use_restrictions", ["use_restriction_id"], :
|
468
|
+
add_index "item_has_use_restrictions", ["item_id"], name: "index_item_has_use_restrictions_on_item_id"
|
469
|
+
add_index "item_has_use_restrictions", ["use_restriction_id"], name: "index_item_has_use_restrictions_on_use_restriction_id"
|
466
470
|
|
467
|
-
create_table "items", :
|
471
|
+
create_table "items", force: true do |t|
|
468
472
|
t.string "call_number"
|
469
473
|
t.string "item_identifier"
|
470
|
-
t.datetime "created_at"
|
471
|
-
t.datetime "updated_at"
|
474
|
+
t.datetime "created_at"
|
475
|
+
t.datetime "updated_at"
|
472
476
|
t.datetime "deleted_at"
|
473
|
-
t.integer "shelf_id", :
|
474
|
-
t.boolean "include_supplements", :
|
477
|
+
t.integer "shelf_id", default: 1, null: false
|
478
|
+
t.boolean "include_supplements", default: false, null: false
|
475
479
|
t.text "note"
|
476
480
|
t.string "url"
|
477
481
|
t.integer "price"
|
478
|
-
t.integer "lock_version", :
|
479
|
-
t.integer "required_role_id", :
|
480
|
-
t.integer "required_score", :
|
482
|
+
t.integer "lock_version", default: 0, null: false
|
483
|
+
t.integer "required_role_id", default: 1, null: false
|
484
|
+
t.integer "required_score", default: 0, null: false
|
481
485
|
t.datetime "acquired_at"
|
482
486
|
t.integer "bookstore_id"
|
483
487
|
t.integer "budget_type_id"
|
484
|
-
t.integer "circulation_status_id", :
|
485
|
-
t.integer "checkout_type_id", :
|
488
|
+
t.integer "circulation_status_id", default: 5, null: false
|
489
|
+
t.integer "checkout_type_id", default: 1, null: false
|
486
490
|
t.string "binding_item_identifier"
|
487
491
|
t.string "binding_call_number"
|
488
492
|
t.datetime "binded_at"
|
489
493
|
t.integer "manifestation_id"
|
490
494
|
end
|
491
495
|
|
492
|
-
add_index "items", ["binding_item_identifier"], :
|
493
|
-
add_index "items", ["bookstore_id"], :
|
494
|
-
add_index "items", ["checkout_type_id"], :
|
495
|
-
add_index "items", ["circulation_status_id"], :
|
496
|
-
add_index "items", ["item_identifier"], :
|
497
|
-
add_index "items", ["manifestation_id"], :
|
498
|
-
add_index "items", ["required_role_id"], :
|
499
|
-
add_index "items", ["shelf_id"], :
|
496
|
+
add_index "items", ["binding_item_identifier"], name: "index_items_on_binding_item_identifier"
|
497
|
+
add_index "items", ["bookstore_id"], name: "index_items_on_bookstore_id"
|
498
|
+
add_index "items", ["checkout_type_id"], name: "index_items_on_checkout_type_id"
|
499
|
+
add_index "items", ["circulation_status_id"], name: "index_items_on_circulation_status_id"
|
500
|
+
add_index "items", ["item_identifier"], name: "index_items_on_item_identifier"
|
501
|
+
add_index "items", ["manifestation_id"], name: "index_items_on_manifestation_id"
|
502
|
+
add_index "items", ["required_role_id"], name: "index_items_on_required_role_id"
|
503
|
+
add_index "items", ["shelf_id"], name: "index_items_on_shelf_id"
|
500
504
|
|
501
|
-
create_table "languages", :
|
502
|
-
t.string "name", :
|
505
|
+
create_table "languages", force: true do |t|
|
506
|
+
t.string "name", null: false
|
503
507
|
t.string "native_name"
|
504
508
|
t.text "display_name"
|
505
509
|
t.string "iso_639_1"
|
@@ -509,30 +513,30 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
509
513
|
t.integer "position"
|
510
514
|
end
|
511
515
|
|
512
|
-
add_index "languages", ["iso_639_1"], :
|
513
|
-
add_index "languages", ["iso_639_2"], :
|
514
|
-
add_index "languages", ["iso_639_3"], :
|
515
|
-
add_index "languages", ["name"], :
|
516
|
+
add_index "languages", ["iso_639_1"], name: "index_languages_on_iso_639_1"
|
517
|
+
add_index "languages", ["iso_639_2"], name: "index_languages_on_iso_639_2"
|
518
|
+
add_index "languages", ["iso_639_3"], name: "index_languages_on_iso_639_3"
|
519
|
+
add_index "languages", ["name"], name: "index_languages_on_name", unique: true
|
516
520
|
|
517
|
-
create_table "lending_policies", :
|
518
|
-
t.integer "item_id",
|
519
|
-
t.integer "user_group_id",
|
520
|
-
t.integer "loan_period", :
|
521
|
+
create_table "lending_policies", force: true do |t|
|
522
|
+
t.integer "item_id", null: false
|
523
|
+
t.integer "user_group_id", null: false
|
524
|
+
t.integer "loan_period", default: 0, null: false
|
521
525
|
t.datetime "fixed_due_date"
|
522
|
-
t.integer "renewal", :
|
523
|
-
t.integer "fine", :
|
526
|
+
t.integer "renewal", default: 0, null: false
|
527
|
+
t.integer "fine", default: 0, null: false
|
524
528
|
t.text "note"
|
525
529
|
t.integer "position"
|
526
|
-
t.datetime "created_at"
|
527
|
-
t.datetime "updated_at"
|
530
|
+
t.datetime "created_at"
|
531
|
+
t.datetime "updated_at"
|
528
532
|
end
|
529
533
|
|
530
|
-
add_index "lending_policies", ["item_id", "user_group_id"], :
|
534
|
+
add_index "lending_policies", ["item_id", "user_group_id"], name: "index_lending_policies_on_item_id_and_user_group_id", unique: true
|
531
535
|
|
532
|
-
create_table "libraries", :
|
533
|
-
t.string "name",
|
536
|
+
create_table "libraries", force: true do |t|
|
537
|
+
t.string "name", null: false
|
534
538
|
t.text "display_name"
|
535
|
-
t.string "short_display_name",
|
539
|
+
t.string "short_display_name", null: false
|
536
540
|
t.string "zip_code"
|
537
541
|
t.text "street"
|
538
542
|
t.text "locality"
|
@@ -541,136 +545,136 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
541
545
|
t.string "telephone_number_2"
|
542
546
|
t.string "fax_number"
|
543
547
|
t.text "note"
|
544
|
-
t.integer "call_number_rows", :
|
545
|
-
t.string "call_number_delimiter", :
|
546
|
-
t.integer "library_group_id", :
|
547
|
-
t.integer "users_count", :
|
548
|
+
t.integer "call_number_rows", default: 1, null: false
|
549
|
+
t.string "call_number_delimiter", default: "|", null: false
|
550
|
+
t.integer "library_group_id", default: 1, null: false
|
551
|
+
t.integer "users_count", default: 0, null: false
|
548
552
|
t.integer "position"
|
549
553
|
t.integer "country_id"
|
550
|
-
t.datetime "created_at"
|
551
|
-
t.datetime "updated_at"
|
554
|
+
t.datetime "created_at"
|
555
|
+
t.datetime "updated_at"
|
552
556
|
t.datetime "deleted_at"
|
553
557
|
t.string "isil"
|
554
558
|
end
|
555
559
|
|
556
|
-
add_index "libraries", ["library_group_id"], :
|
557
|
-
add_index "libraries", ["name"], :
|
560
|
+
add_index "libraries", ["library_group_id"], name: "index_libraries_on_library_group_id"
|
561
|
+
add_index "libraries", ["name"], name: "index_libraries_on_name", unique: true
|
558
562
|
|
559
|
-
create_table "library_groups", :
|
560
|
-
t.string "name",
|
563
|
+
create_table "library_groups", force: true do |t|
|
564
|
+
t.string "name", null: false
|
561
565
|
t.text "display_name"
|
562
|
-
t.string "short_name",
|
566
|
+
t.string "short_name", null: false
|
563
567
|
t.string "email"
|
564
568
|
t.text "my_networks"
|
565
569
|
t.text "login_banner"
|
566
570
|
t.text "note"
|
567
|
-
t.integer "valid_period_for_new_user", :
|
568
|
-
t.boolean "post_to_union_catalog", :
|
571
|
+
t.integer "valid_period_for_new_user", default: 365, null: false
|
572
|
+
t.boolean "post_to_union_catalog", default: false, null: false
|
569
573
|
t.integer "country_id"
|
570
|
-
t.datetime "created_at"
|
571
|
-
t.datetime "updated_at"
|
574
|
+
t.datetime "created_at"
|
575
|
+
t.datetime "updated_at"
|
572
576
|
t.text "admin_networks"
|
573
|
-
t.boolean "allow_bookmark_external_url", :
|
577
|
+
t.boolean "allow_bookmark_external_url", default: false, null: false
|
574
578
|
t.integer "position"
|
575
|
-
t.string "url", :
|
579
|
+
t.string "url", default: "http://localhost:3000/"
|
576
580
|
end
|
577
581
|
|
578
|
-
add_index "library_groups", ["short_name"], :
|
582
|
+
add_index "library_groups", ["short_name"], name: "index_library_groups_on_short_name"
|
579
583
|
|
580
|
-
create_table "licenses", :
|
581
|
-
t.string "name", :
|
584
|
+
create_table "licenses", force: true do |t|
|
585
|
+
t.string "name", null: false
|
582
586
|
t.string "display_name"
|
583
587
|
t.text "note"
|
584
588
|
t.integer "position"
|
585
|
-
t.datetime "created_at"
|
586
|
-
t.datetime "updated_at"
|
589
|
+
t.datetime "created_at"
|
590
|
+
t.datetime "updated_at"
|
587
591
|
end
|
588
592
|
|
589
|
-
create_table "manifestation_checkout_stat_transitions", :
|
593
|
+
create_table "manifestation_checkout_stat_transitions", force: true do |t|
|
590
594
|
t.string "to_state"
|
591
|
-
t.text "metadata", :
|
595
|
+
t.text "metadata", default: "{}"
|
592
596
|
t.integer "sort_key"
|
593
597
|
t.integer "manifestation_checkout_stat_id"
|
594
|
-
t.datetime "created_at"
|
595
|
-
t.datetime "updated_at"
|
598
|
+
t.datetime "created_at"
|
599
|
+
t.datetime "updated_at"
|
596
600
|
end
|
597
601
|
|
598
|
-
add_index "manifestation_checkout_stat_transitions", ["manifestation_checkout_stat_id"], :
|
599
|
-
add_index "manifestation_checkout_stat_transitions", ["sort_key", "manifestation_checkout_stat_id"], :
|
602
|
+
add_index "manifestation_checkout_stat_transitions", ["manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_stat_id"
|
603
|
+
add_index "manifestation_checkout_stat_transitions", ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
|
600
604
|
|
601
|
-
create_table "manifestation_checkout_stats", :
|
605
|
+
create_table "manifestation_checkout_stats", force: true do |t|
|
602
606
|
t.datetime "start_date"
|
603
607
|
t.datetime "end_date"
|
604
608
|
t.text "note"
|
605
|
-
t.datetime "created_at"
|
606
|
-
t.datetime "updated_at"
|
609
|
+
t.datetime "created_at"
|
610
|
+
t.datetime "updated_at"
|
607
611
|
t.datetime "started_at"
|
608
612
|
t.datetime "completed_at"
|
609
613
|
t.integer "user_id"
|
610
614
|
end
|
611
615
|
|
612
|
-
add_index "manifestation_checkout_stats", ["user_id"], :
|
616
|
+
add_index "manifestation_checkout_stats", ["user_id"], name: "index_manifestation_checkout_stats_on_user_id"
|
613
617
|
|
614
|
-
create_table "manifestation_relationship_types", :
|
615
|
-
t.string "name", :
|
618
|
+
create_table "manifestation_relationship_types", force: true do |t|
|
619
|
+
t.string "name", null: false
|
616
620
|
t.text "display_name"
|
617
621
|
t.text "note"
|
618
622
|
t.integer "position"
|
619
|
-
t.datetime "created_at"
|
620
|
-
t.datetime "updated_at"
|
623
|
+
t.datetime "created_at"
|
624
|
+
t.datetime "updated_at"
|
621
625
|
end
|
622
626
|
|
623
|
-
create_table "manifestation_relationships", :
|
627
|
+
create_table "manifestation_relationships", force: true do |t|
|
624
628
|
t.integer "parent_id"
|
625
629
|
t.integer "child_id"
|
626
630
|
t.integer "manifestation_relationship_type_id"
|
627
|
-
t.datetime "created_at"
|
628
|
-
t.datetime "updated_at"
|
631
|
+
t.datetime "created_at"
|
632
|
+
t.datetime "updated_at"
|
629
633
|
t.integer "position"
|
630
634
|
end
|
631
635
|
|
632
|
-
add_index "manifestation_relationships", ["child_id"], :
|
633
|
-
add_index "manifestation_relationships", ["parent_id"], :
|
636
|
+
add_index "manifestation_relationships", ["child_id"], name: "index_manifestation_relationships_on_child_id"
|
637
|
+
add_index "manifestation_relationships", ["parent_id"], name: "index_manifestation_relationships_on_parent_id"
|
634
638
|
|
635
|
-
create_table "manifestation_reserve_stat_transitions", :
|
639
|
+
create_table "manifestation_reserve_stat_transitions", force: true do |t|
|
636
640
|
t.string "to_state"
|
637
|
-
t.text "metadata", :
|
641
|
+
t.text "metadata", default: "{}"
|
638
642
|
t.integer "sort_key"
|
639
643
|
t.integer "manifestation_reserve_stat_id"
|
640
|
-
t.datetime "created_at"
|
641
|
-
t.datetime "updated_at"
|
644
|
+
t.datetime "created_at"
|
645
|
+
t.datetime "updated_at"
|
642
646
|
end
|
643
647
|
|
644
|
-
add_index "manifestation_reserve_stat_transitions", ["manifestation_reserve_stat_id"], :
|
645
|
-
add_index "manifestation_reserve_stat_transitions", ["sort_key", "manifestation_reserve_stat_id"], :
|
648
|
+
add_index "manifestation_reserve_stat_transitions", ["manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_stat_id"
|
649
|
+
add_index "manifestation_reserve_stat_transitions", ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
|
646
650
|
|
647
|
-
create_table "manifestation_reserve_stats", :
|
651
|
+
create_table "manifestation_reserve_stats", force: true do |t|
|
648
652
|
t.datetime "start_date"
|
649
653
|
t.datetime "end_date"
|
650
654
|
t.text "note"
|
651
|
-
t.datetime "created_at"
|
652
|
-
t.datetime "updated_at"
|
655
|
+
t.datetime "created_at"
|
656
|
+
t.datetime "updated_at"
|
653
657
|
t.datetime "started_at"
|
654
658
|
t.datetime "completed_at"
|
655
659
|
t.integer "user_id"
|
656
660
|
end
|
657
661
|
|
658
|
-
add_index "manifestation_reserve_stats", ["user_id"], :
|
662
|
+
add_index "manifestation_reserve_stats", ["user_id"], name: "index_manifestation_reserve_stats_on_user_id"
|
659
663
|
|
660
|
-
create_table "manifestations", :
|
661
|
-
t.text "original_title",
|
664
|
+
create_table "manifestations", force: true do |t|
|
665
|
+
t.text "original_title", null: false
|
662
666
|
t.text "title_alternative"
|
663
667
|
t.text "title_transcription"
|
664
668
|
t.string "classification_number"
|
665
669
|
t.string "manifestation_identifier"
|
666
670
|
t.datetime "date_of_publication"
|
667
671
|
t.datetime "date_copyrighted"
|
668
|
-
t.datetime "created_at"
|
669
|
-
t.datetime "updated_at"
|
672
|
+
t.datetime "created_at"
|
673
|
+
t.datetime "updated_at"
|
670
674
|
t.datetime "deleted_at"
|
671
675
|
t.string "access_address"
|
672
|
-
t.integer "language_id", :
|
673
|
-
t.integer "carrier_type_id", :
|
676
|
+
t.integer "language_id", default: 1, null: false
|
677
|
+
t.integer "carrier_type_id", default: 1, null: false
|
674
678
|
t.integer "start_page"
|
675
679
|
t.integer "end_page"
|
676
680
|
t.integer "height"
|
@@ -683,12 +687,12 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
683
687
|
t.string "serial_number_string"
|
684
688
|
t.integer "edition"
|
685
689
|
t.text "note"
|
686
|
-
t.boolean "repository_content", :
|
687
|
-
t.integer "lock_version", :
|
688
|
-
t.integer "required_role_id", :
|
689
|
-
t.integer "required_score", :
|
690
|
-
t.integer "frequency_id", :
|
691
|
-
t.boolean "subscription_master", :
|
690
|
+
t.boolean "repository_content", default: false, null: false
|
691
|
+
t.integer "lock_version", default: 0, null: false
|
692
|
+
t.integer "required_role_id", default: 1, null: false
|
693
|
+
t.integer "required_score", default: 0, null: false
|
694
|
+
t.integer "frequency_id", default: 1, null: false
|
695
|
+
t.boolean "subscription_master", default: false, null: false
|
692
696
|
t.string "attachment_file_name"
|
693
697
|
t.string "attachment_content_type"
|
694
698
|
t.integer "attachment_file_size"
|
@@ -706,7 +710,7 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
706
710
|
t.integer "volume_number"
|
707
711
|
t.integer "issue_number"
|
708
712
|
t.integer "serial_number"
|
709
|
-
t.integer "content_type_id", :
|
713
|
+
t.integer "content_type_id", default: 1
|
710
714
|
t.integer "year_of_publication"
|
711
715
|
t.text "attachment_meta"
|
712
716
|
t.integer "month_of_publication"
|
@@ -718,107 +722,107 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
718
722
|
t.text "dimensions"
|
719
723
|
end
|
720
724
|
|
721
|
-
add_index "manifestations", ["access_address"], :
|
722
|
-
add_index "manifestations", ["date_of_publication"], :
|
723
|
-
add_index "manifestations", ["manifestation_identifier"], :
|
724
|
-
add_index "manifestations", ["updated_at"], :
|
725
|
+
add_index "manifestations", ["access_address"], name: "index_manifestations_on_access_address"
|
726
|
+
add_index "manifestations", ["date_of_publication"], name: "index_manifestations_on_date_of_publication"
|
727
|
+
add_index "manifestations", ["manifestation_identifier"], name: "index_manifestations_on_manifestation_identifier"
|
728
|
+
add_index "manifestations", ["updated_at"], name: "index_manifestations_on_updated_at"
|
725
729
|
|
726
|
-
create_table "medium_of_performances", :
|
727
|
-
t.string "name", :
|
730
|
+
create_table "medium_of_performances", force: true do |t|
|
731
|
+
t.string "name", null: false
|
728
732
|
t.text "display_name"
|
729
733
|
t.text "note"
|
730
734
|
t.integer "position"
|
731
|
-
t.datetime "created_at"
|
732
|
-
t.datetime "updated_at"
|
735
|
+
t.datetime "created_at"
|
736
|
+
t.datetime "updated_at"
|
733
737
|
end
|
734
738
|
|
735
|
-
create_table "message_request_transitions", :
|
739
|
+
create_table "message_request_transitions", force: true do |t|
|
736
740
|
t.string "to_state"
|
737
|
-
t.text "metadata", :
|
741
|
+
t.text "metadata", default: "{}"
|
738
742
|
t.integer "sort_key"
|
739
743
|
t.integer "message_request_id"
|
740
|
-
t.datetime "created_at"
|
741
|
-
t.datetime "updated_at"
|
744
|
+
t.datetime "created_at"
|
745
|
+
t.datetime "updated_at"
|
742
746
|
end
|
743
747
|
|
744
|
-
add_index "message_request_transitions", ["message_request_id"], :
|
745
|
-
add_index "message_request_transitions", ["sort_key", "message_request_id"], :
|
748
|
+
add_index "message_request_transitions", ["message_request_id"], name: "index_message_request_transitions_on_message_request_id"
|
749
|
+
add_index "message_request_transitions", ["sort_key", "message_request_id"], name: "index_message_request_transitions_on_sort_key_and_request_id", unique: true
|
746
750
|
|
747
|
-
create_table "message_requests", :
|
751
|
+
create_table "message_requests", force: true do |t|
|
748
752
|
t.integer "sender_id"
|
749
753
|
t.integer "receiver_id"
|
750
754
|
t.integer "message_template_id"
|
751
755
|
t.datetime "sent_at"
|
752
756
|
t.datetime "deleted_at"
|
753
757
|
t.text "body"
|
754
|
-
t.datetime "created_at"
|
755
|
-
t.datetime "updated_at"
|
758
|
+
t.datetime "created_at"
|
759
|
+
t.datetime "updated_at"
|
756
760
|
end
|
757
761
|
|
758
|
-
create_table "message_templates", :
|
759
|
-
t.string "status",
|
760
|
-
t.text "title",
|
761
|
-
t.text "body",
|
762
|
+
create_table "message_templates", force: true do |t|
|
763
|
+
t.string "status", null: false
|
764
|
+
t.text "title", null: false
|
765
|
+
t.text "body", null: false
|
762
766
|
t.integer "position"
|
763
|
-
t.string "locale", :
|
764
|
-
t.datetime "created_at"
|
765
|
-
t.datetime "updated_at"
|
767
|
+
t.string "locale", default: "en"
|
768
|
+
t.datetime "created_at"
|
769
|
+
t.datetime "updated_at"
|
766
770
|
end
|
767
771
|
|
768
|
-
add_index "message_templates", ["status"], :
|
772
|
+
add_index "message_templates", ["status"], name: "index_message_templates_on_status", unique: true
|
769
773
|
|
770
|
-
create_table "message_transitions", :
|
774
|
+
create_table "message_transitions", force: true do |t|
|
771
775
|
t.string "to_state"
|
772
|
-
t.text "metadata", :
|
776
|
+
t.text "metadata", default: "{}"
|
773
777
|
t.integer "sort_key"
|
774
778
|
t.integer "message_id"
|
775
|
-
t.datetime "created_at"
|
776
|
-
t.datetime "updated_at"
|
779
|
+
t.datetime "created_at"
|
780
|
+
t.datetime "updated_at"
|
777
781
|
end
|
778
782
|
|
779
|
-
add_index "message_transitions", ["message_id"], :
|
780
|
-
add_index "message_transitions", ["sort_key", "message_id"], :
|
783
|
+
add_index "message_transitions", ["message_id"], name: "index_message_transitions_on_message_id"
|
784
|
+
add_index "message_transitions", ["sort_key", "message_id"], name: "index_message_transitions_on_sort_key_and_message_id", unique: true
|
781
785
|
|
782
|
-
create_table "messages", :
|
786
|
+
create_table "messages", force: true do |t|
|
783
787
|
t.datetime "read_at"
|
784
788
|
t.integer "receiver_id"
|
785
789
|
t.integer "sender_id"
|
786
|
-
t.string "subject", :
|
790
|
+
t.string "subject", null: false
|
787
791
|
t.text "body"
|
788
792
|
t.integer "message_request_id"
|
789
793
|
t.integer "parent_id"
|
790
|
-
t.datetime "created_at"
|
791
|
-
t.datetime "updated_at"
|
794
|
+
t.datetime "created_at"
|
795
|
+
t.datetime "updated_at"
|
792
796
|
t.integer "lft"
|
793
797
|
t.integer "rgt"
|
794
798
|
t.integer "depth"
|
795
799
|
end
|
796
800
|
|
797
|
-
add_index "messages", ["message_request_id"], :
|
798
|
-
add_index "messages", ["parent_id"], :
|
799
|
-
add_index "messages", ["receiver_id"], :
|
800
|
-
add_index "messages", ["sender_id"], :
|
801
|
+
add_index "messages", ["message_request_id"], name: "index_messages_on_message_request_id"
|
802
|
+
add_index "messages", ["parent_id"], name: "index_messages_on_parent_id"
|
803
|
+
add_index "messages", ["receiver_id"], name: "index_messages_on_receiver_id"
|
804
|
+
add_index "messages", ["sender_id"], name: "index_messages_on_sender_id"
|
801
805
|
|
802
|
-
create_table "owns", :
|
803
|
-
t.integer "agent_id", :
|
804
|
-
t.integer "item_id", :
|
806
|
+
create_table "owns", force: true do |t|
|
807
|
+
t.integer "agent_id", null: false
|
808
|
+
t.integer "item_id", null: false
|
805
809
|
t.integer "position"
|
806
|
-
t.datetime "created_at"
|
807
|
-
t.datetime "updated_at"
|
810
|
+
t.datetime "created_at"
|
811
|
+
t.datetime "updated_at"
|
808
812
|
end
|
809
813
|
|
810
|
-
add_index "owns", ["agent_id"], :
|
811
|
-
add_index "owns", ["item_id"], :
|
814
|
+
add_index "owns", ["agent_id"], name: "index_owns_on_agent_id"
|
815
|
+
add_index "owns", ["item_id"], name: "index_owns_on_item_id"
|
812
816
|
|
813
|
-
create_table "picture_files", :
|
817
|
+
create_table "picture_files", force: true do |t|
|
814
818
|
t.integer "picture_attachable_id"
|
815
819
|
t.string "picture_attachable_type"
|
816
820
|
t.string "content_type"
|
817
821
|
t.text "title"
|
818
822
|
t.string "thumbnail"
|
819
823
|
t.integer "position"
|
820
|
-
t.datetime "created_at"
|
821
|
-
t.datetime "updated_at"
|
824
|
+
t.datetime "created_at"
|
825
|
+
t.datetime "updated_at"
|
822
826
|
t.string "picture_file_name"
|
823
827
|
t.string "picture_content_type"
|
824
828
|
t.integer "picture_file_size"
|
@@ -827,30 +831,30 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
827
831
|
t.string "picture_fingerprint"
|
828
832
|
end
|
829
833
|
|
830
|
-
add_index "picture_files", ["picture_attachable_id", "picture_attachable_type"], :
|
834
|
+
add_index "picture_files", ["picture_attachable_id", "picture_attachable_type"], name: "index_picture_files_on_picture_attachable_id_and_type"
|
831
835
|
|
832
|
-
create_table "produce_types", :
|
836
|
+
create_table "produce_types", force: true do |t|
|
833
837
|
t.string "name"
|
834
838
|
t.text "display_name"
|
835
839
|
t.text "note"
|
836
840
|
t.integer "position"
|
837
|
-
t.datetime "created_at"
|
838
|
-
t.datetime "updated_at"
|
841
|
+
t.datetime "created_at"
|
842
|
+
t.datetime "updated_at"
|
839
843
|
end
|
840
844
|
|
841
|
-
create_table "produces", :
|
842
|
-
t.integer "agent_id", :
|
843
|
-
t.integer "manifestation_id", :
|
845
|
+
create_table "produces", force: true do |t|
|
846
|
+
t.integer "agent_id", null: false
|
847
|
+
t.integer "manifestation_id", null: false
|
844
848
|
t.integer "position"
|
845
|
-
t.datetime "created_at"
|
846
|
-
t.datetime "updated_at"
|
849
|
+
t.datetime "created_at"
|
850
|
+
t.datetime "updated_at"
|
847
851
|
t.integer "produce_type_id"
|
848
852
|
end
|
849
853
|
|
850
|
-
add_index "produces", ["agent_id"], :
|
851
|
-
add_index "produces", ["manifestation_id"], :
|
854
|
+
add_index "produces", ["agent_id"], name: "index_produces_on_agent_id"
|
855
|
+
add_index "produces", ["manifestation_id"], name: "index_produces_on_manifestation_id"
|
852
856
|
|
853
|
-
create_table "profiles", :
|
857
|
+
create_table "profiles", force: true do |t|
|
854
858
|
t.integer "user_id"
|
855
859
|
t.integer "user_group_id"
|
856
860
|
t.integer "library_id"
|
@@ -860,149 +864,151 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
860
864
|
t.text "note"
|
861
865
|
t.text "keyword_list"
|
862
866
|
t.integer "required_role_id"
|
863
|
-
t.datetime "created_at"
|
864
|
-
t.datetime "updated_at"
|
867
|
+
t.datetime "created_at"
|
868
|
+
t.datetime "updated_at"
|
865
869
|
t.string "checkout_icalendar_token"
|
866
|
-
t.boolean "save_checkout_history", :
|
870
|
+
t.boolean "save_checkout_history", default: false, null: false
|
867
871
|
t.datetime "expired_at"
|
868
872
|
end
|
869
873
|
|
870
|
-
add_index "profiles", ["checkout_icalendar_token"], :
|
871
|
-
add_index "profiles", ["user_id"], :
|
872
|
-
add_index "profiles", ["user_number"], :
|
874
|
+
add_index "profiles", ["checkout_icalendar_token"], name: "index_profiles_on_checkout_icalendar_token", unique: true
|
875
|
+
add_index "profiles", ["user_id"], name: "index_profiles_on_user_id"
|
876
|
+
add_index "profiles", ["user_number"], name: "index_profiles_on_user_number"
|
873
877
|
|
874
|
-
create_table "realize_types", :
|
878
|
+
create_table "realize_types", force: true do |t|
|
875
879
|
t.string "name"
|
876
880
|
t.text "display_name"
|
877
881
|
t.text "note"
|
878
882
|
t.integer "position"
|
879
|
-
t.datetime "created_at"
|
880
|
-
t.datetime "updated_at"
|
883
|
+
t.datetime "created_at"
|
884
|
+
t.datetime "updated_at"
|
881
885
|
end
|
882
886
|
|
883
|
-
create_table "realizes", :
|
884
|
-
t.integer "agent_id", :
|
885
|
-
t.integer "expression_id", :
|
887
|
+
create_table "realizes", force: true do |t|
|
888
|
+
t.integer "agent_id", null: false
|
889
|
+
t.integer "expression_id", null: false
|
886
890
|
t.integer "position"
|
887
|
-
t.datetime "created_at"
|
888
|
-
t.datetime "updated_at"
|
891
|
+
t.datetime "created_at"
|
892
|
+
t.datetime "updated_at"
|
889
893
|
t.integer "realize_type_id"
|
890
894
|
end
|
891
895
|
|
892
|
-
add_index "realizes", ["agent_id"], :
|
893
|
-
add_index "realizes", ["expression_id"], :
|
896
|
+
add_index "realizes", ["agent_id"], name: "index_realizes_on_agent_id"
|
897
|
+
add_index "realizes", ["expression_id"], name: "index_realizes_on_expression_id"
|
894
898
|
|
895
|
-
create_table "request_status_types", :
|
896
|
-
t.string "name", :
|
899
|
+
create_table "request_status_types", force: true do |t|
|
900
|
+
t.string "name", null: false
|
897
901
|
t.text "display_name"
|
898
902
|
t.text "note"
|
899
903
|
t.integer "position"
|
900
|
-
t.datetime "created_at"
|
901
|
-
t.datetime "updated_at"
|
904
|
+
t.datetime "created_at"
|
905
|
+
t.datetime "updated_at"
|
902
906
|
end
|
903
907
|
|
904
|
-
create_table "request_types", :
|
905
|
-
t.string "name", :
|
908
|
+
create_table "request_types", force: true do |t|
|
909
|
+
t.string "name", null: false
|
906
910
|
t.text "display_name"
|
907
911
|
t.text "note"
|
908
912
|
t.integer "position"
|
909
|
-
t.datetime "created_at"
|
910
|
-
t.datetime "updated_at"
|
913
|
+
t.datetime "created_at"
|
914
|
+
t.datetime "updated_at"
|
911
915
|
end
|
912
916
|
|
913
|
-
create_table "reserve_stat_has_manifestations", :
|
914
|
-
t.integer "manifestation_reserve_stat_id", :
|
915
|
-
t.integer "manifestation_id", :
|
917
|
+
create_table "reserve_stat_has_manifestations", force: true do |t|
|
918
|
+
t.integer "manifestation_reserve_stat_id", null: false
|
919
|
+
t.integer "manifestation_id", null: false
|
916
920
|
t.integer "reserves_count"
|
917
|
-
t.datetime "created_at"
|
918
|
-
t.datetime "updated_at"
|
921
|
+
t.datetime "created_at"
|
922
|
+
t.datetime "updated_at"
|
919
923
|
end
|
920
924
|
|
921
|
-
add_index "reserve_stat_has_manifestations", ["manifestation_id"], :
|
922
|
-
add_index "reserve_stat_has_manifestations", ["manifestation_reserve_stat_id"], :
|
925
|
+
add_index "reserve_stat_has_manifestations", ["manifestation_id"], name: "index_reserve_stat_has_manifestations_on_manifestation_id"
|
926
|
+
add_index "reserve_stat_has_manifestations", ["manifestation_reserve_stat_id"], name: "index_reserve_stat_has_manifestations_on_m_reserve_stat_id"
|
923
927
|
|
924
|
-
create_table "reserve_stat_has_users", :
|
925
|
-
t.integer "user_reserve_stat_id", :
|
926
|
-
t.integer "user_id", :
|
928
|
+
create_table "reserve_stat_has_users", force: true do |t|
|
929
|
+
t.integer "user_reserve_stat_id", null: false
|
930
|
+
t.integer "user_id", null: false
|
927
931
|
t.integer "reserves_count"
|
928
|
-
t.datetime "created_at"
|
929
|
-
t.datetime "updated_at"
|
932
|
+
t.datetime "created_at"
|
933
|
+
t.datetime "updated_at"
|
930
934
|
end
|
931
935
|
|
932
|
-
add_index "reserve_stat_has_users", ["user_id"], :
|
933
|
-
add_index "reserve_stat_has_users", ["user_reserve_stat_id"], :
|
936
|
+
add_index "reserve_stat_has_users", ["user_id"], name: "index_reserve_stat_has_users_on_user_id"
|
937
|
+
add_index "reserve_stat_has_users", ["user_reserve_stat_id"], name: "index_reserve_stat_has_users_on_user_reserve_stat_id"
|
934
938
|
|
935
|
-
create_table "reserve_transitions", :
|
939
|
+
create_table "reserve_transitions", force: true do |t|
|
936
940
|
t.string "to_state"
|
937
|
-
t.text "metadata", :
|
941
|
+
t.text "metadata", default: "{}"
|
938
942
|
t.integer "sort_key"
|
939
943
|
t.integer "reserve_id"
|
940
|
-
t.datetime "created_at"
|
941
|
-
t.datetime "updated_at"
|
944
|
+
t.datetime "created_at"
|
945
|
+
t.datetime "updated_at"
|
942
946
|
end
|
943
947
|
|
944
|
-
add_index "reserve_transitions", ["reserve_id"], :
|
945
|
-
add_index "reserve_transitions", ["sort_key", "reserve_id"], :
|
948
|
+
add_index "reserve_transitions", ["reserve_id"], name: "index_reserve_transitions_on_reserve_id"
|
949
|
+
add_index "reserve_transitions", ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
|
946
950
|
|
947
|
-
create_table "reserves", :
|
948
|
-
t.integer "user_id",
|
949
|
-
t.integer "manifestation_id",
|
951
|
+
create_table "reserves", force: true do |t|
|
952
|
+
t.integer "user_id", null: false
|
953
|
+
t.integer "manifestation_id", null: false
|
950
954
|
t.integer "item_id"
|
951
|
-
t.integer "request_status_type_id",
|
955
|
+
t.integer "request_status_type_id", null: false
|
952
956
|
t.datetime "checked_out_at"
|
953
|
-
t.datetime "created_at"
|
954
|
-
t.datetime "updated_at"
|
957
|
+
t.datetime "created_at"
|
958
|
+
t.datetime "updated_at"
|
955
959
|
t.datetime "canceled_at"
|
956
960
|
t.datetime "expired_at"
|
957
961
|
t.datetime "deleted_at"
|
958
|
-
t.boolean "expiration_notice_to_patron", :
|
959
|
-
t.boolean "expiration_notice_to_library", :
|
962
|
+
t.boolean "expiration_notice_to_patron", default: false
|
963
|
+
t.boolean "expiration_notice_to_library", default: false
|
964
|
+
t.integer "pickup_location_id"
|
960
965
|
t.datetime "retained_at"
|
961
966
|
t.datetime "postponed_at"
|
962
|
-
t.integer "lock_version", :
|
967
|
+
t.integer "lock_version", default: 0, null: false
|
963
968
|
end
|
964
969
|
|
965
|
-
add_index "reserves", ["item_id"], :
|
966
|
-
add_index "reserves", ["manifestation_id"], :
|
967
|
-
add_index "reserves", ["
|
968
|
-
add_index "reserves", ["
|
970
|
+
add_index "reserves", ["item_id"], name: "index_reserves_on_item_id"
|
971
|
+
add_index "reserves", ["manifestation_id"], name: "index_reserves_on_manifestation_id"
|
972
|
+
add_index "reserves", ["pickup_location_id"], name: "index_reserves_on_pickup_location_id"
|
973
|
+
add_index "reserves", ["request_status_type_id"], name: "index_reserves_on_request_status_type_id"
|
974
|
+
add_index "reserves", ["user_id"], name: "index_reserves_on_user_id"
|
969
975
|
|
970
|
-
create_table "resource_export_file_transitions", :
|
976
|
+
create_table "resource_export_file_transitions", force: true do |t|
|
971
977
|
t.string "to_state"
|
972
|
-
t.text "metadata", :
|
978
|
+
t.text "metadata", default: "{}"
|
973
979
|
t.integer "sort_key"
|
974
980
|
t.integer "resource_export_file_id"
|
975
|
-
t.datetime "created_at"
|
976
|
-
t.datetime "updated_at"
|
981
|
+
t.datetime "created_at"
|
982
|
+
t.datetime "updated_at"
|
977
983
|
end
|
978
984
|
|
979
|
-
add_index "resource_export_file_transitions", ["resource_export_file_id"], :
|
980
|
-
add_index "resource_export_file_transitions", ["sort_key", "resource_export_file_id"], :
|
985
|
+
add_index "resource_export_file_transitions", ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
|
986
|
+
add_index "resource_export_file_transitions", ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
|
981
987
|
|
982
|
-
create_table "resource_export_files", :
|
988
|
+
create_table "resource_export_files", force: true do |t|
|
983
989
|
t.integer "user_id"
|
984
990
|
t.string "resource_export_file_name"
|
985
991
|
t.string "resource_export_content_type"
|
986
992
|
t.integer "resource_export_file_size"
|
987
993
|
t.datetime "resource_export_updated_at"
|
988
994
|
t.datetime "executed_at"
|
989
|
-
t.datetime "created_at"
|
990
|
-
t.datetime "updated_at"
|
995
|
+
t.datetime "created_at"
|
996
|
+
t.datetime "updated_at"
|
991
997
|
end
|
992
998
|
|
993
|
-
create_table "resource_import_file_transitions", :
|
999
|
+
create_table "resource_import_file_transitions", force: true do |t|
|
994
1000
|
t.string "to_state"
|
995
|
-
t.text "metadata", :
|
1001
|
+
t.text "metadata", default: "{}"
|
996
1002
|
t.integer "sort_key"
|
997
1003
|
t.integer "resource_import_file_id"
|
998
|
-
t.datetime "created_at"
|
999
|
-
t.datetime "updated_at"
|
1004
|
+
t.datetime "created_at"
|
1005
|
+
t.datetime "updated_at"
|
1000
1006
|
end
|
1001
1007
|
|
1002
|
-
add_index "resource_import_file_transitions", ["resource_import_file_id"], :
|
1003
|
-
add_index "resource_import_file_transitions", ["sort_key", "resource_import_file_id"], :
|
1008
|
+
add_index "resource_import_file_transitions", ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
|
1009
|
+
add_index "resource_import_file_transitions", ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
|
1004
1010
|
|
1005
|
-
create_table "resource_import_files", :
|
1011
|
+
create_table "resource_import_files", force: true do |t|
|
1006
1012
|
t.integer "parent_id"
|
1007
1013
|
t.string "content_type"
|
1008
1014
|
t.integer "size"
|
@@ -1013,8 +1019,8 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
1013
1019
|
t.string "resource_import_content_type"
|
1014
1020
|
t.integer "resource_import_file_size"
|
1015
1021
|
t.datetime "resource_import_updated_at"
|
1016
|
-
t.datetime "created_at"
|
1017
|
-
t.datetime "updated_at"
|
1022
|
+
t.datetime "created_at"
|
1023
|
+
t.datetime "updated_at"
|
1018
1024
|
t.string "edit_mode"
|
1019
1025
|
t.string "resource_import_fingerprint"
|
1020
1026
|
t.text "error_message"
|
@@ -1022,67 +1028,67 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
1022
1028
|
t.integer "default_shelf_id"
|
1023
1029
|
end
|
1024
1030
|
|
1025
|
-
add_index "resource_import_files", ["parent_id"], :
|
1026
|
-
add_index "resource_import_files", ["user_id"], :
|
1031
|
+
add_index "resource_import_files", ["parent_id"], name: "index_resource_import_files_on_parent_id"
|
1032
|
+
add_index "resource_import_files", ["user_id"], name: "index_resource_import_files_on_user_id"
|
1027
1033
|
|
1028
|
-
create_table "resource_import_results", :
|
1034
|
+
create_table "resource_import_results", force: true do |t|
|
1029
1035
|
t.integer "resource_import_file_id"
|
1030
1036
|
t.integer "manifestation_id"
|
1031
1037
|
t.integer "item_id"
|
1032
1038
|
t.text "body"
|
1033
|
-
t.datetime "created_at"
|
1034
|
-
t.datetime "updated_at"
|
1039
|
+
t.datetime "created_at"
|
1040
|
+
t.datetime "updated_at"
|
1035
1041
|
t.text "error_message"
|
1036
1042
|
end
|
1037
1043
|
|
1038
|
-
add_index "resource_import_results", ["item_id"], :
|
1039
|
-
add_index "resource_import_results", ["manifestation_id"], :
|
1040
|
-
add_index "resource_import_results", ["resource_import_file_id"], :
|
1044
|
+
add_index "resource_import_results", ["item_id"], name: "index_resource_import_results_on_item_id"
|
1045
|
+
add_index "resource_import_results", ["manifestation_id"], name: "index_resource_import_results_on_manifestation_id"
|
1046
|
+
add_index "resource_import_results", ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
|
1041
1047
|
|
1042
|
-
create_table "roles", :
|
1048
|
+
create_table "roles", force: true do |t|
|
1043
1049
|
t.string "name"
|
1044
1050
|
t.text "display_name"
|
1045
1051
|
t.text "note"
|
1046
1052
|
t.integer "position"
|
1047
|
-
t.datetime "created_at"
|
1048
|
-
t.datetime "updated_at"
|
1053
|
+
t.datetime "created_at"
|
1054
|
+
t.datetime "updated_at"
|
1049
1055
|
end
|
1050
1056
|
|
1051
|
-
create_table "series_has_manifestations", :
|
1057
|
+
create_table "series_has_manifestations", force: true do |t|
|
1052
1058
|
t.integer "series_statement_id"
|
1053
1059
|
t.integer "manifestation_id"
|
1054
1060
|
t.integer "position"
|
1055
|
-
t.datetime "created_at"
|
1056
|
-
t.datetime "updated_at"
|
1061
|
+
t.datetime "created_at"
|
1062
|
+
t.datetime "updated_at"
|
1057
1063
|
end
|
1058
1064
|
|
1059
|
-
add_index "series_has_manifestations", ["manifestation_id"], :
|
1060
|
-
add_index "series_has_manifestations", ["series_statement_id"], :
|
1065
|
+
add_index "series_has_manifestations", ["manifestation_id"], name: "index_series_has_manifestations_on_manifestation_id"
|
1066
|
+
add_index "series_has_manifestations", ["series_statement_id"], name: "index_series_has_manifestations_on_series_statement_id"
|
1061
1067
|
|
1062
|
-
create_table "series_statement_merge_lists", :
|
1068
|
+
create_table "series_statement_merge_lists", force: true do |t|
|
1063
1069
|
t.string "title"
|
1064
|
-
t.datetime "created_at"
|
1065
|
-
t.datetime "updated_at"
|
1070
|
+
t.datetime "created_at"
|
1071
|
+
t.datetime "updated_at"
|
1066
1072
|
end
|
1067
1073
|
|
1068
|
-
create_table "series_statement_merges", :
|
1069
|
-
t.integer "series_statement_id", :
|
1070
|
-
t.integer "series_statement_merge_list_id", :
|
1071
|
-
t.datetime "created_at"
|
1072
|
-
t.datetime "updated_at"
|
1074
|
+
create_table "series_statement_merges", force: true do |t|
|
1075
|
+
t.integer "series_statement_id", null: false
|
1076
|
+
t.integer "series_statement_merge_list_id", null: false
|
1077
|
+
t.datetime "created_at"
|
1078
|
+
t.datetime "updated_at"
|
1073
1079
|
end
|
1074
1080
|
|
1075
|
-
add_index "series_statement_merges", ["series_statement_id"], :
|
1076
|
-
add_index "series_statement_merges", ["series_statement_merge_list_id"], :
|
1081
|
+
add_index "series_statement_merges", ["series_statement_id"], name: "index_series_statement_merges_on_series_statement_id"
|
1082
|
+
add_index "series_statement_merges", ["series_statement_merge_list_id"], name: "index_series_statement_merges_on_list_id"
|
1077
1083
|
|
1078
|
-
create_table "series_statements", :
|
1084
|
+
create_table "series_statements", force: true do |t|
|
1079
1085
|
t.text "original_title"
|
1080
1086
|
t.text "numbering"
|
1081
1087
|
t.text "title_subseries"
|
1082
1088
|
t.text "numbering_subseries"
|
1083
1089
|
t.integer "position"
|
1084
|
-
t.datetime "created_at"
|
1085
|
-
t.datetime "updated_at"
|
1090
|
+
t.datetime "created_at"
|
1091
|
+
t.datetime "updated_at"
|
1086
1092
|
t.text "title_transcription"
|
1087
1093
|
t.text "title_alternative"
|
1088
1094
|
t.string "series_statement_identifier"
|
@@ -1098,165 +1104,165 @@ ActiveRecord::Schema.define(:version => 20140823095740) do
|
|
1098
1104
|
t.integer "root_manifestation_id"
|
1099
1105
|
end
|
1100
1106
|
|
1101
|
-
add_index "series_statements", ["manifestation_id"], :
|
1102
|
-
add_index "series_statements", ["root_manifestation_id"], :
|
1103
|
-
add_index "series_statements", ["series_statement_identifier"], :
|
1107
|
+
add_index "series_statements", ["manifestation_id"], name: "index_series_statements_on_manifestation_id"
|
1108
|
+
add_index "series_statements", ["root_manifestation_id"], name: "index_series_statements_on_root_manifestation_id"
|
1109
|
+
add_index "series_statements", ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
|
1104
1110
|
|
1105
|
-
create_table "shelves", :
|
1106
|
-
t.string "name",
|
1111
|
+
create_table "shelves", force: true do |t|
|
1112
|
+
t.string "name", null: false
|
1107
1113
|
t.text "display_name"
|
1108
1114
|
t.text "note"
|
1109
|
-
t.integer "library_id", :
|
1110
|
-
t.integer "items_count", :
|
1115
|
+
t.integer "library_id", default: 1, null: false
|
1116
|
+
t.integer "items_count", default: 0, null: false
|
1111
1117
|
t.integer "position"
|
1112
|
-
t.datetime "created_at"
|
1113
|
-
t.datetime "updated_at"
|
1118
|
+
t.datetime "created_at"
|
1119
|
+
t.datetime "updated_at"
|
1114
1120
|
t.datetime "deleted_at"
|
1115
1121
|
end
|
1116
1122
|
|
1117
|
-
add_index "shelves", ["library_id"], :
|
1123
|
+
add_index "shelves", ["library_id"], name: "index_shelves_on_library_id"
|
1118
1124
|
|
1119
|
-
create_table "use_restrictions", :
|
1120
|
-
t.string "name", :
|
1125
|
+
create_table "use_restrictions", force: true do |t|
|
1126
|
+
t.string "name", null: false
|
1121
1127
|
t.text "display_name"
|
1122
1128
|
t.text "note"
|
1123
1129
|
t.integer "position"
|
1124
|
-
t.datetime "created_at"
|
1125
|
-
t.datetime "updated_at"
|
1130
|
+
t.datetime "created_at"
|
1131
|
+
t.datetime "updated_at"
|
1126
1132
|
end
|
1127
1133
|
|
1128
|
-
create_table "user_checkout_stat_transitions", :
|
1134
|
+
create_table "user_checkout_stat_transitions", force: true do |t|
|
1129
1135
|
t.string "to_state"
|
1130
|
-
t.text "metadata", :
|
1136
|
+
t.text "metadata", default: "{}"
|
1131
1137
|
t.integer "sort_key"
|
1132
1138
|
t.integer "user_checkout_stat_id"
|
1133
|
-
t.datetime "created_at"
|
1134
|
-
t.datetime "updated_at"
|
1139
|
+
t.datetime "created_at"
|
1140
|
+
t.datetime "updated_at"
|
1135
1141
|
end
|
1136
1142
|
|
1137
|
-
add_index "user_checkout_stat_transitions", ["sort_key", "user_checkout_stat_id"], :
|
1138
|
-
add_index "user_checkout_stat_transitions", ["user_checkout_stat_id"], :
|
1143
|
+
add_index "user_checkout_stat_transitions", ["sort_key", "user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_sort_key_and_stat_id", unique: true
|
1144
|
+
add_index "user_checkout_stat_transitions", ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
|
1139
1145
|
|
1140
|
-
create_table "user_checkout_stats", :
|
1146
|
+
create_table "user_checkout_stats", force: true do |t|
|
1141
1147
|
t.datetime "start_date"
|
1142
1148
|
t.datetime "end_date"
|
1143
1149
|
t.text "note"
|
1144
|
-
t.datetime "created_at"
|
1145
|
-
t.datetime "updated_at"
|
1150
|
+
t.datetime "created_at"
|
1151
|
+
t.datetime "updated_at"
|
1146
1152
|
t.datetime "started_at"
|
1147
1153
|
t.datetime "completed_at"
|
1148
1154
|
t.integer "user_id"
|
1149
1155
|
end
|
1150
1156
|
|
1151
|
-
add_index "user_checkout_stats", ["user_id"], :
|
1157
|
+
add_index "user_checkout_stats", ["user_id"], name: "index_user_checkout_stats_on_user_id"
|
1152
1158
|
|
1153
|
-
create_table "user_group_has_checkout_types", :
|
1154
|
-
t.integer "user_group_id",
|
1155
|
-
t.integer "checkout_type_id",
|
1156
|
-
t.integer "checkout_limit", :
|
1157
|
-
t.integer "checkout_period", :
|
1158
|
-
t.integer "checkout_renewal_limit", :
|
1159
|
-
t.integer "reservation_limit", :
|
1160
|
-
t.integer "reservation_expired_period", :
|
1161
|
-
t.boolean "set_due_date_before_closing_day", :
|
1159
|
+
create_table "user_group_has_checkout_types", force: true do |t|
|
1160
|
+
t.integer "user_group_id", null: false
|
1161
|
+
t.integer "checkout_type_id", null: false
|
1162
|
+
t.integer "checkout_limit", default: 0, null: false
|
1163
|
+
t.integer "checkout_period", default: 0, null: false
|
1164
|
+
t.integer "checkout_renewal_limit", default: 0, null: false
|
1165
|
+
t.integer "reservation_limit", default: 0, null: false
|
1166
|
+
t.integer "reservation_expired_period", default: 7, null: false
|
1167
|
+
t.boolean "set_due_date_before_closing_day", default: false, null: false
|
1162
1168
|
t.datetime "fixed_due_date"
|
1163
1169
|
t.text "note"
|
1164
1170
|
t.integer "position"
|
1165
|
-
t.datetime "created_at"
|
1166
|
-
t.datetime "updated_at"
|
1171
|
+
t.datetime "created_at"
|
1172
|
+
t.datetime "updated_at"
|
1167
1173
|
t.integer "current_checkout_count"
|
1168
1174
|
end
|
1169
1175
|
|
1170
|
-
add_index "user_group_has_checkout_types", ["checkout_type_id"], :
|
1171
|
-
add_index "user_group_has_checkout_types", ["user_group_id"], :
|
1176
|
+
add_index "user_group_has_checkout_types", ["checkout_type_id"], name: "index_user_group_has_checkout_types_on_checkout_type_id"
|
1177
|
+
add_index "user_group_has_checkout_types", ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
|
1172
1178
|
|
1173
|
-
create_table "user_groups", :
|
1179
|
+
create_table "user_groups", force: true do |t|
|
1174
1180
|
t.string "name"
|
1175
|
-
t.
|
1181
|
+
t.text "string"
|
1176
1182
|
t.text "display_name"
|
1177
1183
|
t.text "note"
|
1178
1184
|
t.integer "position"
|
1179
|
-
t.datetime "created_at"
|
1180
|
-
t.datetime "updated_at"
|
1185
|
+
t.datetime "created_at"
|
1186
|
+
t.datetime "updated_at"
|
1181
1187
|
t.datetime "deleted_at"
|
1182
|
-
t.integer "valid_period_for_new_user", :
|
1188
|
+
t.integer "valid_period_for_new_user", default: 0, null: false
|
1183
1189
|
t.datetime "expired_at"
|
1184
|
-
t.integer "number_of_day_to_notify_overdue", :
|
1185
|
-
t.integer "number_of_day_to_notify_due_date", :
|
1186
|
-
t.integer "number_of_time_to_notify_overdue", :
|
1190
|
+
t.integer "number_of_day_to_notify_overdue", default: 1, null: false
|
1191
|
+
t.integer "number_of_day_to_notify_due_date", default: 7, null: false
|
1192
|
+
t.integer "number_of_time_to_notify_overdue", default: 3, null: false
|
1187
1193
|
end
|
1188
1194
|
|
1189
|
-
create_table "user_has_roles", :
|
1195
|
+
create_table "user_has_roles", force: true do |t|
|
1190
1196
|
t.integer "user_id"
|
1191
1197
|
t.integer "role_id"
|
1192
|
-
t.datetime "created_at"
|
1193
|
-
t.datetime "updated_at"
|
1198
|
+
t.datetime "created_at"
|
1199
|
+
t.datetime "updated_at"
|
1194
1200
|
end
|
1195
1201
|
|
1196
|
-
create_table "user_reserve_stat_transitions", :
|
1202
|
+
create_table "user_reserve_stat_transitions", force: true do |t|
|
1197
1203
|
t.string "to_state"
|
1198
|
-
t.text "metadata", :
|
1204
|
+
t.text "metadata", default: "{}"
|
1199
1205
|
t.integer "sort_key"
|
1200
1206
|
t.integer "user_reserve_stat_id"
|
1201
|
-
t.datetime "created_at"
|
1202
|
-
t.datetime "updated_at"
|
1207
|
+
t.datetime "created_at"
|
1208
|
+
t.datetime "updated_at"
|
1203
1209
|
end
|
1204
1210
|
|
1205
|
-
add_index "user_reserve_stat_transitions", ["sort_key", "user_reserve_stat_id"], :
|
1206
|
-
add_index "user_reserve_stat_transitions", ["user_reserve_stat_id"], :
|
1211
|
+
add_index "user_reserve_stat_transitions", ["sort_key", "user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_sort_key_and_stat_id", unique: true
|
1212
|
+
add_index "user_reserve_stat_transitions", ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
|
1207
1213
|
|
1208
|
-
create_table "user_reserve_stats", :
|
1214
|
+
create_table "user_reserve_stats", force: true do |t|
|
1209
1215
|
t.datetime "start_date"
|
1210
1216
|
t.datetime "end_date"
|
1211
1217
|
t.text "note"
|
1212
|
-
t.datetime "created_at"
|
1213
|
-
t.datetime "updated_at"
|
1218
|
+
t.datetime "created_at"
|
1219
|
+
t.datetime "updated_at"
|
1214
1220
|
t.datetime "started_at"
|
1215
1221
|
t.datetime "completed_at"
|
1216
1222
|
t.integer "user_id"
|
1217
1223
|
end
|
1218
1224
|
|
1219
|
-
add_index "user_reserve_stats", ["user_id"], :
|
1225
|
+
add_index "user_reserve_stats", ["user_id"], name: "index_user_reserve_stats_on_user_id"
|
1220
1226
|
|
1221
|
-
create_table "users", :
|
1222
|
-
t.string "email", :
|
1223
|
-
t.string "encrypted_password", :
|
1227
|
+
create_table "users", force: true do |t|
|
1228
|
+
t.string "email", default: "", null: false
|
1229
|
+
t.string "encrypted_password", default: "", null: false
|
1224
1230
|
t.string "reset_password_token"
|
1225
1231
|
t.datetime "reset_password_sent_at"
|
1226
1232
|
t.datetime "remember_created_at"
|
1227
|
-
t.integer "sign_in_count", :
|
1233
|
+
t.integer "sign_in_count", default: 0, null: false
|
1228
1234
|
t.datetime "current_sign_in_at"
|
1229
1235
|
t.datetime "last_sign_in_at"
|
1230
1236
|
t.string "current_sign_in_ip"
|
1231
1237
|
t.string "last_sign_in_ip"
|
1232
|
-
t.datetime "created_at"
|
1233
|
-
t.datetime "updated_at"
|
1234
|
-
t.boolean "save_checkout_history", :
|
1238
|
+
t.datetime "created_at"
|
1239
|
+
t.datetime "updated_at"
|
1240
|
+
t.boolean "save_checkout_history", default: false, null: false
|
1235
1241
|
t.string "checkout_icalendar_token"
|
1236
1242
|
t.string "username"
|
1237
1243
|
t.datetime "deleted_at"
|
1238
1244
|
t.datetime "expired_at"
|
1239
|
-
t.integer "failed_attempts", :
|
1245
|
+
t.integer "failed_attempts", default: 0
|
1240
1246
|
t.string "unlock_token"
|
1241
1247
|
t.datetime "locked_at"
|
1242
1248
|
t.datetime "confirmed_at"
|
1243
1249
|
end
|
1244
1250
|
|
1245
|
-
add_index "users", ["checkout_icalendar_token"], :
|
1246
|
-
add_index "users", ["email"], :
|
1247
|
-
add_index "users", ["reset_password_token"], :
|
1248
|
-
add_index "users", ["unlock_token"], :
|
1249
|
-
add_index "users", ["username"], :
|
1251
|
+
add_index "users", ["checkout_icalendar_token"], name: "index_users_on_checkout_icalendar_token", unique: true
|
1252
|
+
add_index "users", ["email"], name: "index_users_on_email"
|
1253
|
+
add_index "users", ["reset_password_token"], name: "index_users_on_reset_password_token", unique: true
|
1254
|
+
add_index "users", ["unlock_token"], name: "index_users_on_unlock_token", unique: true
|
1255
|
+
add_index "users", ["username"], name: "index_users_on_username", unique: true
|
1250
1256
|
|
1251
|
-
create_table "versions", :
|
1252
|
-
t.string "item_type", :
|
1253
|
-
t.integer "item_id", :
|
1254
|
-
t.string "event", :
|
1257
|
+
create_table "versions", force: true do |t|
|
1258
|
+
t.string "item_type", null: false
|
1259
|
+
t.integer "item_id", null: false
|
1260
|
+
t.string "event", null: false
|
1255
1261
|
t.string "whodunnit"
|
1256
1262
|
t.text "object"
|
1257
1263
|
t.datetime "created_at"
|
1258
1264
|
end
|
1259
1265
|
|
1260
|
-
add_index "versions", ["item_type", "item_id"], :
|
1266
|
+
add_index "versions", ["item_type", "item_id"], name: "index_versions_on_item_type_and_item_id"
|
1261
1267
|
|
1262
1268
|
end
|