enju_library 0.3.3 → 0.3.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/accepts_controller.rb +1 -1
- data/app/controllers/bookstores_controller.rb +1 -1
- data/app/controllers/budget_types_controller.rb +1 -1
- data/app/controllers/libraries_controller.rb +1 -1
- data/app/controllers/library_groups_controller.rb +1 -1
- data/app/controllers/request_status_types_controller.rb +1 -1
- data/app/controllers/request_types_controller.rb +1 -1
- data/app/controllers/search_engines_controller.rb +1 -1
- data/app/controllers/shelves_controller.rb +2 -2
- data/app/controllers/subscribes_controller.rb +1 -1
- data/app/controllers/user_export_files_controller.rb +1 -1
- data/app/controllers/user_groups_controller.rb +1 -1
- data/app/controllers/user_import_files_controller.rb +1 -1
- data/app/controllers/withdraws_controller.rb +1 -1
- data/app/jobs/user_export_file_job.rb +1 -1
- data/app/jobs/user_import_file_job.rb +1 -1
- data/app/models/accept.rb +1 -1
- data/app/models/basket.rb +1 -1
- data/app/models/bookstore.rb +1 -1
- data/app/models/budget_type.rb +1 -1
- data/app/models/color.rb +1 -1
- data/app/models/library.rb +1 -1
- data/app/models/library_group.rb +1 -1
- data/app/models/request_status_type.rb +1 -1
- data/app/models/request_type.rb +1 -1
- data/app/models/search_engine.rb +1 -1
- data/app/models/shelf.rb +4 -2
- data/app/models/subscribe.rb +1 -1
- data/app/models/subscription.rb +1 -1
- data/app/models/user_export_file.rb +1 -1
- data/app/models/user_export_file_transition.rb +1 -1
- data/app/models/user_group.rb +3 -3
- data/app/models/user_import_file.rb +2 -2
- data/app/models/user_import_file_transition.rb +1 -1
- data/app/models/user_import_result.rb +1 -1
- data/app/models/withdraw.rb +1 -1
- data/app/views/libraries/_map.html+phone.erb +1 -1
- data/app/views/libraries/_map.html.erb +1 -1
- data/lib/enju_library/version.rb +1 -1
- data/lib/generators/enju_library/setup/templates/db/fixtures/user_groups.yml +6 -0
- data/lib/tasks/enju_library_tasks.rake +2 -0
- data/spec/controllers/budget_types_controller_spec.rb +2 -2
- data/spec/dummy/app/jobs/application_job.rb +7 -0
- data/spec/dummy/app/models/application_record.rb +3 -0
- data/spec/dummy/app/models/user.rb +2 -1
- data/spec/dummy/db/migrate/032_create_checkins.rb +3 -6
- data/spec/dummy/db/migrate/033_create_checkouts.rb +5 -10
- data/spec/dummy/db/migrate/035_create_reserves.rb +4 -9
- data/spec/dummy/db/migrate/121_create_checked_items.rb +3 -4
- data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +2 -4
- data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +2 -4
- data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +2 -3
- data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +2 -2
- data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +2 -4
- data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +2 -2
- data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +2 -4
- data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +2 -2
- data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +2 -4
- data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +2 -2
- data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +1 -1
- data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +4 -5
- data/spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb +4 -8
- data/spec/dummy/db/migrate/20141014065831_add_shelf_id_to_checkout.rb +1 -2
- data/spec/dummy/db/migrate/20141020120523_add_library_id_to_checkout.rb +1 -2
- data/spec/dummy/db/migrate/20150106001709_create_demands.rb +3 -6
- data/spec/dummy/db/migrate/20150421023923_create_identities.rb +1 -2
- data/spec/dummy/db/migrate/20180107161035_add_constraints_to_most_recent_for_reserve_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107161951_add_constraints_to_most_recent_for_user_checkout_stat_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107162009_add_constraints_to_most_recent_for_user_reserve_stat_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107162029_add_constraints_to_most_recent_for_manifestation_checkout_stat_transitions.rb +13 -0
- data/spec/dummy/db/migrate/20180107162048_add_constraints_to_most_recent_for_manifestation_reserve_stat_transitions.rb +13 -0
- data/spec/dummy/db/schema.rb +29 -16
- data/spec/fixtures/items.yml +1 -1
- data/spec/fixtures/reserve_transitions.yml +15 -0
- data/spec/fixtures/user_groups.yml +2 -2
- data/spec/models/user_group_spec.rb +2 -2
- metadata +421 -370
- data/app/views/libraries/_map.html+phone.slim +0 -4
- data/lib/generators/enju_library/setup/templates/db/fixtures/shelves.yml +0 -15
- data/spec/libraries_spec.rb +0 -46
- data/spec/shelves_spec.rb +0 -46
@@ -1,10 +1,10 @@
|
|
1
1
|
class CreateReserves < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :reserves do |t|
|
4
|
-
t.
|
5
|
-
t.
|
6
|
-
t.
|
7
|
-
t.
|
4
|
+
t.references :user, index: true, foreign_key: true, null: false
|
5
|
+
t.references :manifestation, index: true, null: false
|
6
|
+
t.references :item, index: true
|
7
|
+
t.references :request_status_type, null: false
|
8
8
|
t.datetime :checked_out_at
|
9
9
|
t.timestamps
|
10
10
|
t.datetime :canceled_at
|
@@ -13,11 +13,6 @@ class CreateReserves < ActiveRecord::Migration[4.2]
|
|
13
13
|
t.boolean :expiration_notice_to_patron, default: false
|
14
14
|
t.boolean :expiration_notice_to_library, default: false
|
15
15
|
end
|
16
|
-
|
17
|
-
add_index :reserves, :user_id
|
18
|
-
add_index :reserves, :manifestation_id
|
19
|
-
add_index :reserves, :item_id
|
20
|
-
add_index :reserves, :request_status_type_id
|
21
16
|
end
|
22
17
|
|
23
18
|
def self.down
|
@@ -1,14 +1,13 @@
|
|
1
1
|
class CreateCheckedItems < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :checked_items do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :item, index: true, foreign_key: true, null: false
|
5
|
+
t.references :basket, index: true, foreign_key: true, null: false
|
6
|
+
t.references :librarian, index: true
|
6
7
|
t.datetime :due_date, null: false
|
7
8
|
|
8
9
|
t.timestamps
|
9
10
|
end
|
10
|
-
add_index :checked_items, :item_id
|
11
|
-
add_index :checked_items, :basket_id
|
12
11
|
end
|
13
12
|
|
14
13
|
def self.down
|
@@ -1,13 +1,11 @@
|
|
1
1
|
class CreateItemHasUseRestrictions < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :item_has_use_restrictions do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :item, index: true, foreign_key: true, null: false
|
5
|
+
t.references :use_restriction, index: true, foreign_key: true, null: false
|
6
6
|
|
7
7
|
t.timestamps
|
8
8
|
end
|
9
|
-
add_index :item_has_use_restrictions, :item_id
|
10
|
-
add_index :item_has_use_restrictions, :use_restriction_id
|
11
9
|
end
|
12
10
|
|
13
11
|
def self.down
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateUserGroupHasCheckoutTypes < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :user_group_has_checkout_types do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :user_group, index: true, foreign_key: true, null: false
|
5
|
+
t.references :checkout_type, index: true, foreign_key: true, null: false
|
6
6
|
t.integer :checkout_limit, default: 0, null: false
|
7
7
|
t.integer :checkout_period, default: 0, null: false
|
8
8
|
t.integer :checkout_renewal_limit, default: 0, null: false
|
@@ -15,8 +15,6 @@ class CreateUserGroupHasCheckoutTypes < ActiveRecord::Migration[4.2]
|
|
15
15
|
|
16
16
|
t.timestamps
|
17
17
|
end
|
18
|
-
add_index :user_group_has_checkout_types, :user_group_id
|
19
|
-
add_index :user_group_has_checkout_types, :checkout_type_id
|
20
18
|
end
|
21
19
|
|
22
20
|
def self.down
|
@@ -1,15 +1,14 @@
|
|
1
1
|
class CreateCarrierTypeHasCheckoutTypes < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :carrier_type_has_checkout_types do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :carrier_type, index: false, foreign_key: true, null: false
|
5
|
+
t.references :checkout_type, index: true, foreign_key: true, null: false
|
6
6
|
t.text :note
|
7
7
|
t.integer :position
|
8
8
|
|
9
9
|
t.timestamps
|
10
10
|
end
|
11
11
|
add_index :carrier_type_has_checkout_types, :carrier_type_id, name: 'index_carrier_type_has_checkout_types_on_m_form_id'
|
12
|
-
add_index :carrier_type_has_checkout_types, :checkout_type_id
|
13
12
|
end
|
14
13
|
|
15
14
|
def self.down
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateCheckoutStatHasManifestations < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :checkout_stat_has_manifestations do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :manifestation_checkout_stat, index: false, null: false
|
5
|
+
t.references :manifestation, index: false, foreign_key: true, null: false
|
6
6
|
t.integer :checkouts_count
|
7
7
|
|
8
8
|
t.timestamps
|
@@ -1,14 +1,12 @@
|
|
1
1
|
class CreateCheckoutStatHasUsers < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :checkout_stat_has_users do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :user_checkout_stat, index: true, foreign_key: true, null: false
|
5
|
+
t.references :user, index: true, foreign_key: true, null: false
|
6
6
|
t.integer :checkouts_count, default: 0, null: false
|
7
7
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
|
-
add_index :checkout_stat_has_users, :user_checkout_stat_id
|
11
|
-
add_index :checkout_stat_has_users, :user_id
|
12
10
|
end
|
13
11
|
|
14
12
|
def self.down
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateReserveStatHasManifestations < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :reserve_stat_has_manifestations do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :manifestation_reserve_stat, index: false, null: false
|
5
|
+
t.references :manifestation, index: false, foreign_key: true, null: false
|
6
6
|
t.integer :reserves_count
|
7
7
|
|
8
8
|
t.timestamps
|
@@ -1,14 +1,12 @@
|
|
1
1
|
class CreateReserveStatHasUsers < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :reserve_stat_has_users do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :user_reserve_stat, index: true, foreign_key: true, null: false
|
5
|
+
t.references :user, index: true, foreign_key: true, null: false
|
6
6
|
t.integer :reserves_count
|
7
7
|
|
8
8
|
t.timestamps
|
9
9
|
end
|
10
|
-
add_index :reserve_stat_has_users, :user_reserve_stat_id
|
11
|
-
add_index :reserve_stat_has_users, :user_id
|
12
10
|
end
|
13
11
|
|
14
12
|
def self.down
|
@@ -1,8 +1,8 @@
|
|
1
1
|
class CreateLendingPolicies < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
3
|
create_table :lending_policies do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :item, index: false, foreign_key: true, null: false
|
5
|
+
t.references :user_group, index: false, foreign_key: true, null: false
|
6
6
|
t.integer :loan_period, default: 0, null: false
|
7
7
|
t.datetime :fixed_due_date
|
8
8
|
t.integer :renewal, default: 0, null: false
|
@@ -1,12 +1,10 @@
|
|
1
1
|
class CreateUserHasRoles < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :user_has_roles do |t|
|
4
|
-
t.
|
5
|
-
t.
|
4
|
+
t.references :user, index: true, foreign_key: true, null: false
|
5
|
+
t.references :role, index: true, foreign_key: true, null: false
|
6
6
|
|
7
7
|
t.timestamps
|
8
8
|
end
|
9
|
-
add_index :user_has_roles, :user_id
|
10
|
-
add_index :user_has_roles, :role_id
|
11
9
|
end
|
12
10
|
end
|
data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
class AddNumberOfDayToNotifyOverdueToUserGroup < ActiveRecord::Migration[4.2]
|
2
2
|
def self.up
|
3
|
-
add_column :user_groups, :number_of_day_to_notify_overdue, :integer, default:
|
4
|
-
add_column :user_groups, :number_of_day_to_notify_due_date, :integer, default:
|
3
|
+
add_column :user_groups, :number_of_day_to_notify_overdue, :integer, default: 7, null: false
|
4
|
+
add_column :user_groups, :number_of_day_to_notify_due_date, :integer, default: 3, null: false
|
5
5
|
add_column :user_groups, :number_of_time_to_notify_overdue, :integer, default: 3, null: false
|
6
6
|
end
|
7
7
|
|
@@ -1,20 +1,19 @@
|
|
1
1
|
class CreateProfiles < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :profiles do |t|
|
4
|
-
t.
|
5
|
-
t.
|
6
|
-
t.
|
4
|
+
t.references :user, index: true, foreign_key: true
|
5
|
+
t.references :user_group, index: true
|
6
|
+
t.references :library, index: true
|
7
7
|
t.string :locale
|
8
8
|
t.string :user_number
|
9
9
|
t.text :full_name
|
10
10
|
t.text :note
|
11
11
|
t.text :keyword_list
|
12
|
-
t.
|
12
|
+
t.references :required_role, index: false
|
13
13
|
|
14
14
|
t.timestamps
|
15
15
|
end
|
16
16
|
|
17
|
-
add_index :profiles, :user_id
|
18
17
|
add_index :profiles, :user_number, unique: true
|
19
18
|
end
|
20
19
|
end
|
@@ -1,12 +1,8 @@
|
|
1
1
|
class AddUserIdToUserCheckoutStat < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
add_index :user_checkout_stats, :user_id
|
8
|
-
add_index :user_reserve_stats, :user_id
|
9
|
-
add_index :manifestation_checkout_stats, :user_id
|
10
|
-
add_index :manifestation_reserve_stats, :user_id
|
3
|
+
add_reference :user_checkout_stats, :user, index: true, foreign_key: true
|
4
|
+
add_reference :user_reserve_stats, :user, index: true, foreign_key: true
|
5
|
+
add_reference :manifestation_checkout_stats, :user, index: true, foreign_key: true
|
6
|
+
add_reference :manifestation_reserve_stats, :user, index: true, foreign_key: true
|
11
7
|
end
|
12
8
|
end
|
@@ -1,14 +1,11 @@
|
|
1
1
|
class CreateDemands < ActiveRecord::Migration[4.2]
|
2
2
|
def change
|
3
3
|
create_table :demands do |t|
|
4
|
-
t.
|
5
|
-
t.
|
6
|
-
t.
|
4
|
+
t.references :user, index: true, foreign_key: true
|
5
|
+
t.references :item, index: true, foreign_key: true
|
6
|
+
t.references :message, index: true, foreign_key: true
|
7
7
|
|
8
8
|
t.timestamps null: false
|
9
9
|
end
|
10
|
-
add_index :demands, :user_id
|
11
|
-
add_index :demands, :item_id
|
12
|
-
add_index :demands, :message_id
|
13
10
|
end
|
14
11
|
end
|
@@ -4,12 +4,11 @@ class CreateIdentities < ActiveRecord::Migration[4.2]
|
|
4
4
|
t.string :name
|
5
5
|
t.string :email
|
6
6
|
t.string :password_digest
|
7
|
-
t.
|
7
|
+
t.references :profile, index: true
|
8
8
|
|
9
9
|
t.timestamps null: false
|
10
10
|
end
|
11
11
|
add_index :identities, :name
|
12
12
|
add_index :identities, :email
|
13
|
-
add_index :identities, :profile_id
|
14
13
|
end
|
15
14
|
end
|
data/spec/dummy/db/migrate/20180107161035_add_constraints_to_most_recent_for_reserve_transitions.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForReserveTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :reserve_transitions, [:reserve_id, :most_recent], unique: true, where: "most_recent", name: "index_reserve_transitions_parent_most_recent" # , algorithm: :concurrently
|
6
|
+
change_column_null :reserve_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :reserve_transitions, name: "index_reserve_transitions_parent_most_recent"
|
11
|
+
change_column_null :reserve_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForAgentImportFileTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :agent_import_file_transitions, [:agent_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_agent_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
|
6
|
+
change_column_null :agent_import_file_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :agent_import_file_transitions, name: "index_agent_import_file_transitions_parent_most_recent"
|
11
|
+
change_column_null :agent_import_file_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForResourceImportFileTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :resource_import_file_transitions, [:resource_import_file_id, :most_recent], unique: true, where: "most_recent", name: "index_resource_import_file_transitions_parent_most_recent" #, algorithm: :concurrently
|
6
|
+
change_column_null :resource_import_file_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :resource_import_file_transitions, name: "index_resource_import_file_transitions_parent_most_recent"
|
11
|
+
change_column_null :resource_import_file_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForResourceExportFileTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :resource_export_file_transitions, [:resource_export_file_id, :most_recent], unique: true, where: "most_recent", name: "index_resource_export_file_transitions_parent_most_recent" #, algorithm: :concurrently
|
6
|
+
change_column_null :resource_export_file_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :resource_export_file_transitions, name: "index_resource_export_file_transitions_parent_most_recent"
|
11
|
+
change_column_null :resource_export_file_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForImportRequestTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :import_request_transitions, [:import_request_id, :most_recent], unique: true, where: "most_recent", name: "index_import_request_transitions_parent_most_recent" #, algorithm: :concurrently
|
6
|
+
change_column_null :import_request_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :import_request_transitions, name: "index_import_request_transitions_parent_most_recent"
|
11
|
+
change_column_null :import_request_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForUserCheckoutStatTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :user_checkout_stat_transitions, [:user_checkout_stat_id, :most_recent], unique: true, where: "most_recent", name: "index_user_checkout_stat_transitions_parent_most_recent" # , algorithm: :concurrently
|
6
|
+
change_column_null :user_checkout_stat_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :user_checkout_stat_transitions, name: "index_user_checkout_stat_transitions_parent_most_recent"
|
11
|
+
change_column_null :user_checkout_stat_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForUserReserveStatTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :user_reserve_stat_transitions, [:user_reserve_stat_id, :most_recent], unique: true, where: "most_recent", name: "index_user_reserve_stat_transitions_parent_most_recent" # , algorithm: :concurrently
|
6
|
+
change_column_null :user_reserve_stat_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :user_reserve_stat_transitions, name: "index_user_reserve_stat_transitions_parent_most_recent"
|
11
|
+
change_column_null :user_reserve_stat_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForManifestationCheckoutStatTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :manifestation_checkout_stat_transitions, [:manifestation_checkout_stat_id, :most_recent], unique: true, where: "most_recent", name: "index_manifestation_checkout_stat_transitions_parent_most_rece" # , algorithm: :concurrently
|
6
|
+
change_column_null :manifestation_checkout_stat_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :manifestation_checkout_stat_transitions, name: "index_manifestation_checkout_stat_transitions_parent_most_rece"
|
11
|
+
change_column_null :manifestation_checkout_stat_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class AddConstraintsToMostRecentForManifestationReserveStatTransitions < ActiveRecord::Migration[4.2]
|
2
|
+
disable_ddl_transaction!
|
3
|
+
|
4
|
+
def up
|
5
|
+
add_index :manifestation_reserve_stat_transitions, [:manifestation_reserve_stat_id, :most_recent], unique: true, where: "most_recent", name: "index_manifestation_reserve_stat_transitions_parent_most_recen" # , algorithm: :concurrently
|
6
|
+
change_column_null :manifestation_reserve_stat_transitions, :most_recent, false
|
7
|
+
end
|
8
|
+
|
9
|
+
def down
|
10
|
+
remove_index :manifestation_reserve_stat_transitions, name: "index_manifestation_reserve_stat_transitions_parent_most_recen"
|
11
|
+
change_column_null :manifestation_reserve_stat_transitions, :most_recent, true
|
12
|
+
end
|
13
|
+
end
|
data/spec/dummy/db/schema.rb
CHANGED
@@ -10,7 +10,7 @@
|
|
10
10
|
#
|
11
11
|
# It's strongly recommended that you check this file into your version control system.
|
12
12
|
|
13
|
-
ActiveRecord::Schema.define(version:
|
13
|
+
ActiveRecord::Schema.define(version: 2018_01_07_162048) do
|
14
14
|
|
15
15
|
create_table "accepts", force: :cascade do |t|
|
16
16
|
t.integer "basket_id"
|
@@ -30,7 +30,8 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
30
30
|
t.integer "agent_import_file_id"
|
31
31
|
t.datetime "created_at"
|
32
32
|
t.datetime "updated_at"
|
33
|
-
t.boolean "most_recent"
|
33
|
+
t.boolean "most_recent", null: false
|
34
|
+
t.index ["agent_import_file_id", "most_recent"], name: "index_agent_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
|
34
35
|
t.index ["agent_import_file_id"], name: "index_agent_import_file_transitions_on_agent_import_file_id"
|
35
36
|
t.index ["sort_key", "agent_import_file_id"], name: "index_agent_import_file_transitions_on_sort_key_and_file_id", unique: true
|
36
37
|
end
|
@@ -267,12 +268,15 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
267
268
|
create_table "checked_items", force: :cascade do |t|
|
268
269
|
t.integer "item_id", null: false
|
269
270
|
t.integer "basket_id", null: false
|
271
|
+
t.integer "librarian_id"
|
270
272
|
t.datetime "due_date", null: false
|
271
273
|
t.datetime "created_at"
|
272
274
|
t.datetime "updated_at"
|
273
|
-
t.integer "
|
275
|
+
t.integer "user_id"
|
274
276
|
t.index ["basket_id"], name: "index_checked_items_on_basket_id"
|
275
277
|
t.index ["item_id"], name: "index_checked_items_on_item_id"
|
278
|
+
t.index ["librarian_id"], name: "index_checked_items_on_librarian_id"
|
279
|
+
t.index ["user_id"], name: "index_checked_items_on_user_id"
|
276
280
|
end
|
277
281
|
|
278
282
|
create_table "checkins", force: :cascade do |t|
|
@@ -616,7 +620,8 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
616
620
|
t.integer "import_request_id"
|
617
621
|
t.datetime "created_at"
|
618
622
|
t.datetime "updated_at"
|
619
|
-
t.boolean "most_recent"
|
623
|
+
t.boolean "most_recent", null: false
|
624
|
+
t.index ["import_request_id", "most_recent"], name: "index_import_request_transitions_parent_most_recent", unique: true, where: "most_recent"
|
620
625
|
t.index ["import_request_id"], name: "index_import_request_transitions_on_import_request_id"
|
621
626
|
t.index ["sort_key", "import_request_id"], name: "index_import_request_transitions_on_sort_key_and_request_id", unique: true
|
622
627
|
end
|
@@ -791,7 +796,8 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
791
796
|
t.integer "manifestation_checkout_stat_id"
|
792
797
|
t.datetime "created_at"
|
793
798
|
t.datetime "updated_at"
|
794
|
-
t.boolean "most_recent"
|
799
|
+
t.boolean "most_recent", null: false
|
800
|
+
t.index ["manifestation_checkout_stat_id", "most_recent"], name: "index_manifestation_checkout_stat_transitions_parent_most_rece", unique: true, where: "most_recent"
|
795
801
|
t.index ["manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_stat_id"
|
796
802
|
t.index ["sort_key", "manifestation_checkout_stat_id"], name: "index_manifestation_checkout_stat_transitions_on_transition", unique: true
|
797
803
|
end
|
@@ -835,7 +841,8 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
835
841
|
t.integer "manifestation_reserve_stat_id"
|
836
842
|
t.datetime "created_at"
|
837
843
|
t.datetime "updated_at"
|
838
|
-
t.boolean "most_recent"
|
844
|
+
t.boolean "most_recent", null: false
|
845
|
+
t.index ["manifestation_reserve_stat_id", "most_recent"], name: "index_manifestation_reserve_stat_transitions_parent_most_recen", unique: true, where: "most_recent"
|
839
846
|
t.index ["manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_stat_id"
|
840
847
|
t.index ["sort_key", "manifestation_reserve_stat_id"], name: "index_manifestation_reserve_stat_transitions_on_transition", unique: true
|
841
848
|
end
|
@@ -1073,6 +1080,8 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
1073
1080
|
t.text "full_name_transcription"
|
1074
1081
|
t.datetime "date_of_birth"
|
1075
1082
|
t.index ["checkout_icalendar_token"], name: "index_profiles_on_checkout_icalendar_token", unique: true
|
1083
|
+
t.index ["library_id"], name: "index_profiles_on_library_id"
|
1084
|
+
t.index ["user_group_id"], name: "index_profiles_on_user_group_id"
|
1076
1085
|
t.index ["user_id"], name: "index_profiles_on_user_id"
|
1077
1086
|
t.index ["user_number"], name: "index_profiles_on_user_number", unique: true
|
1078
1087
|
end
|
@@ -1142,7 +1151,8 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
1142
1151
|
t.integer "reserve_id"
|
1143
1152
|
t.datetime "created_at"
|
1144
1153
|
t.datetime "updated_at"
|
1145
|
-
t.boolean "most_recent"
|
1154
|
+
t.boolean "most_recent", null: false
|
1155
|
+
t.index ["reserve_id", "most_recent"], name: "index_reserve_transitions_parent_most_recent", unique: true, where: "most_recent"
|
1146
1156
|
t.index ["reserve_id"], name: "index_reserve_transitions_on_reserve_id"
|
1147
1157
|
t.index ["sort_key", "reserve_id"], name: "index_reserve_transitions_on_sort_key_and_reserve_id", unique: true
|
1148
1158
|
end
|
@@ -1167,7 +1177,6 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
1167
1177
|
t.index ["item_id"], name: "index_reserves_on_item_id"
|
1168
1178
|
t.index ["manifestation_id"], name: "index_reserves_on_manifestation_id"
|
1169
1179
|
t.index ["pickup_location_id"], name: "index_reserves_on_pickup_location_id"
|
1170
|
-
t.index ["request_status_type_id"], name: "index_reserves_on_request_status_type_id"
|
1171
1180
|
t.index ["user_id"], name: "index_reserves_on_user_id"
|
1172
1181
|
end
|
1173
1182
|
|
@@ -1178,7 +1187,8 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
1178
1187
|
t.integer "resource_export_file_id"
|
1179
1188
|
t.datetime "created_at"
|
1180
1189
|
t.datetime "updated_at"
|
1181
|
-
t.boolean "most_recent"
|
1190
|
+
t.boolean "most_recent", null: false
|
1191
|
+
t.index ["resource_export_file_id", "most_recent"], name: "index_resource_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
|
1182
1192
|
t.index ["resource_export_file_id"], name: "index_resource_export_file_transitions_on_file_id"
|
1183
1193
|
t.index ["sort_key", "resource_export_file_id"], name: "index_resource_export_file_transitions_on_sort_key_and_file_id", unique: true
|
1184
1194
|
end
|
@@ -1201,7 +1211,8 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
1201
1211
|
t.integer "resource_import_file_id"
|
1202
1212
|
t.datetime "created_at"
|
1203
1213
|
t.datetime "updated_at"
|
1204
|
-
t.boolean "most_recent"
|
1214
|
+
t.boolean "most_recent", null: false
|
1215
|
+
t.index ["resource_import_file_id", "most_recent"], name: "index_resource_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
|
1205
1216
|
t.index ["resource_import_file_id"], name: "index_resource_import_file_transitions_on_file_id"
|
1206
1217
|
t.index ["sort_key", "resource_import_file_id"], name: "index_resource_import_file_transitions_on_sort_key_and_file_id", unique: true
|
1207
1218
|
end
|
@@ -1444,8 +1455,9 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
1444
1455
|
t.integer "user_checkout_stat_id"
|
1445
1456
|
t.datetime "created_at"
|
1446
1457
|
t.datetime "updated_at"
|
1447
|
-
t.boolean "most_recent"
|
1458
|
+
t.boolean "most_recent", null: false
|
1448
1459
|
t.index ["sort_key", "user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_sort_key_and_stat_id", unique: true
|
1460
|
+
t.index ["user_checkout_stat_id", "most_recent"], name: "index_user_checkout_stat_transitions_parent_most_recent", unique: true, where: "most_recent"
|
1449
1461
|
t.index ["user_checkout_stat_id"], name: "index_user_checkout_stat_transitions_on_user_checkout_stat_id"
|
1450
1462
|
end
|
1451
1463
|
|
@@ -1516,14 +1528,14 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
1516
1528
|
t.datetime "deleted_at"
|
1517
1529
|
t.integer "valid_period_for_new_user", default: 0, null: false
|
1518
1530
|
t.datetime "expired_at"
|
1519
|
-
t.integer "number_of_day_to_notify_overdue", default:
|
1520
|
-
t.integer "number_of_day_to_notify_due_date", default:
|
1531
|
+
t.integer "number_of_day_to_notify_overdue", default: 7, null: false
|
1532
|
+
t.integer "number_of_day_to_notify_due_date", default: 3, null: false
|
1521
1533
|
t.integer "number_of_time_to_notify_overdue", default: 3, null: false
|
1522
1534
|
end
|
1523
1535
|
|
1524
1536
|
create_table "user_has_roles", force: :cascade do |t|
|
1525
|
-
t.integer "user_id"
|
1526
|
-
t.integer "role_id"
|
1537
|
+
t.integer "user_id", null: false
|
1538
|
+
t.integer "role_id", null: false
|
1527
1539
|
t.datetime "created_at"
|
1528
1540
|
t.datetime "updated_at"
|
1529
1541
|
t.index ["role_id"], name: "index_user_has_roles_on_role_id"
|
@@ -1580,8 +1592,9 @@ ActiveRecord::Schema.define(version: 2018_01_07_160740) do
|
|
1580
1592
|
t.integer "user_reserve_stat_id"
|
1581
1593
|
t.datetime "created_at"
|
1582
1594
|
t.datetime "updated_at"
|
1583
|
-
t.boolean "most_recent"
|
1595
|
+
t.boolean "most_recent", null: false
|
1584
1596
|
t.index ["sort_key", "user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_sort_key_and_stat_id", unique: true
|
1597
|
+
t.index ["user_reserve_stat_id", "most_recent"], name: "index_user_reserve_stat_transitions_parent_most_recent", unique: true, where: "most_recent"
|
1585
1598
|
t.index ["user_reserve_stat_id"], name: "index_user_reserve_stat_transitions_on_user_reserve_stat_id"
|
1586
1599
|
end
|
1587
1600
|
|