enju_ndl 0.1.0.pre32 → 0.1.0.pre33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (142) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/ndl_books_controller.rb +3 -5
  3. data/app/models/ndl_book.rb +1 -1
  4. data/app/views/ndl_books/index.html.erb +2 -2
  5. data/lib/enju_ndl/ndl_search.rb +3 -1
  6. data/lib/enju_ndl/version.rb +1 -1
  7. data/spec/cassette_library/ImportRequest/should_import_isbn.yml +292 -253
  8. data/spec/cassette_library/Manifestation/should_imporrt_a_bibliographic_record.yml +760 -741
  9. data/spec/cassette_library/Manifestation/should_import_isbn.yml +294 -255
  10. data/spec/cassette_library/NdlBook/import/should_get_series_title.yml +18 -13
  11. data/spec/cassette_library/NdlBook/import/should_get_volume_number.yml +18 -13
  12. data/spec/cassette_library/NdlBook/import/should_import_audio_cd.yml +7 -7
  13. data/spec/cassette_library/NdlBook/import/should_import_bibliographic_record.yml +134 -134
  14. data/spec/cassette_library/NdlBook/import/should_import_bibliographic_record_that_does_not_have_any_classifications.yml +126 -124
  15. data/spec/cassette_library/NdlBook/import/should_import_publication_place.yml +239 -0
  16. data/spec/cassette_library/NdlBook/import/should_import_pud_date_is_nil.yml +8 -8
  17. data/spec/cassette_library/NdlBook/import/should_import_series_statement.yml +154 -152
  18. data/spec/cassette_library/NdlBook/import/should_import_series_statement_if_the_resource_is_periodical.yml +129 -122
  19. data/spec/cassette_library/NdlBook/import/should_import_title_alternative.yml +155 -154
  20. data/spec/cassette_library/NdlBook/import/should_import_url_contain_whitespace.yml +135 -138
  21. data/spec/cassette_library/NdlBook/import/should_import_video_dvd.yml +7 -7
  22. data/spec/cassette_library/NdlBook/import/should_import_volume_number_string.yml +152 -154
  23. data/spec/cassette_library/NdlBook/import/should_not_get_series_title_if_book_has_not_series_title.yml +23 -13
  24. data/spec/cassette_library/NdlBook/import/should_not_get_volume_number_if_book_has_not_volume.yml +20 -12
  25. data/spec/cassette_library/NdlBook/search/should_not_distinguish_double_byte_space_from_one-byte_space_in_a_query.yml +189 -145
  26. data/spec/cassette_library/NdlBook/search/should_search_bibliographic_record.yml +42 -40
  27. data/spec/cassette_library/NdlBooksController/GET_index/should_get_index.yml +302 -272
  28. data/spec/cassette_library/NdlBooksController/POST_create/should_create_a_bibliographic_record_if_jpno_is_set.yml +173 -174
  29. data/spec/cassette_library/NdlBooksController/POST_create/should_not_create_a_bibliographic_record_if_jpno_is_not_set.yml +8 -8
  30. data/spec/cassette_library/Question/should_respond_to_search_crd.yml +310 -265
  31. data/spec/dummy/db/migrate/001_create_agents.rb +0 -3
  32. data/spec/dummy/db/migrate/002_devise_create_users.rb +46 -0
  33. data/spec/dummy/db/migrate/005_create_manifestations.rb +7 -7
  34. data/spec/dummy/db/migrate/006_create_items.rb +0 -3
  35. data/spec/dummy/db/migrate/032_create_checkins.rb +17 -0
  36. data/spec/dummy/db/migrate/033_create_checkouts.rb +25 -0
  37. data/spec/dummy/db/migrate/035_create_reserves.rb +27 -0
  38. data/spec/dummy/db/migrate/041_create_roles.rb +13 -0
  39. data/spec/dummy/db/migrate/077_create_user_groups.rb +12 -0
  40. data/spec/dummy/db/migrate/113_create_events.rb +23 -0
  41. data/spec/dummy/db/migrate/114_create_event_categories.rb +16 -0
  42. data/spec/dummy/db/migrate/121_create_checked_items.rb +17 -0
  43. data/spec/dummy/db/migrate/127_create_use_restrictions.rb +16 -0
  44. data/spec/dummy/db/migrate/129_create_item_has_use_restrictions.rb +16 -0
  45. data/spec/dummy/db/migrate/132_create_circulation_statuses.rb +16 -0
  46. data/spec/dummy/db/migrate/149_create_message_templates.rb +18 -0
  47. data/spec/dummy/db/migrate/154_create_messages.rb +23 -0
  48. data/spec/dummy/db/migrate/20080819181903_create_message_requests.rb +18 -0
  49. data/spec/dummy/db/migrate/20081028083142_create_agent_import_files.rb +0 -2
  50. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +1 -3
  51. data/spec/dummy/db/migrate/20081028093607_create_event_import_files.rb +25 -0
  52. data/spec/dummy/db/migrate/20081030023412_create_checkout_types.rb +17 -0
  53. data/spec/dummy/db/migrate/20081030023518_create_user_group_has_checkout_types.rb +25 -0
  54. data/spec/dummy/db/migrate/20081030023615_create_carrier_type_has_checkout_types.rb +18 -0
  55. data/spec/dummy/db/migrate/20081212075554_create_checkout_stat_has_manifestations.rb +17 -0
  56. data/spec/dummy/db/migrate/20081212080038_create_manifestation_checkout_stats.rb +15 -0
  57. data/spec/dummy/db/migrate/20081215094302_create_user_checkout_stats.rb +15 -0
  58. data/spec/dummy/db/migrate/20081215094955_create_checkout_stat_has_users.rb +17 -0
  59. data/spec/dummy/db/migrate/20081216190517_create_reserve_stat_has_manifestations.rb +17 -0
  60. data/spec/dummy/db/migrate/20081216190724_create_manifestation_reserve_stats.rb +15 -0
  61. data/spec/dummy/db/migrate/20081220023628_create_user_reserve_stats.rb +15 -0
  62. data/spec/dummy/db/migrate/20081220034117_create_reserve_stat_has_users.rb +17 -0
  63. data/spec/dummy/db/migrate/20090321130448_add_completed_at_to_user_checkout_stat.rb +23 -0
  64. data/spec/dummy/db/migrate/20090519203307_create_participates.rb +17 -0
  65. data/spec/dummy/db/migrate/20090831220301_create_lending_policies.rb +21 -0
  66. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +0 -1
  67. data/spec/dummy/db/migrate/{20111201163718_create_user_has_roles.rb → 20100606065209_create_user_has_roles.rb} +2 -0
  68. data/spec/dummy/db/migrate/20100925074639_create_event_import_results.rb +15 -0
  69. data/spec/dummy/db/migrate/20110301134521_add_expire_date_to_reserve.rb +9 -0
  70. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +11 -0
  71. data/spec/dummy/db/migrate/20110328130826_add_current_checkout_count_to_user_group_has_checkout_type.rb +9 -0
  72. data/spec/dummy/db/migrate/20110621093332_remove_expire_date_from_reserve.rb +9 -0
  73. data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +13 -0
  74. data/spec/dummy/db/migrate/20110913115320_add_lft_and_rgt_to_message.rb +11 -0
  75. data/spec/dummy/db/migrate/20111217234412_add_save_checkout_history_to_user.rb +5 -0
  76. data/spec/dummy/db/migrate/20111218002349_add_checkout_icalendar_token_to_user.rb +6 -0
  77. data/spec/dummy/db/migrate/20120125050502_add_depth_to_message.rb +6 -0
  78. data/spec/dummy/db/migrate/20120413051535_add_event_import_fingerprint_to_event_import_file.rb +5 -0
  79. data/spec/dummy/db/migrate/20120413170734_add_error_message_to_event_import_file.rb +5 -0
  80. data/spec/dummy/db/migrate/20120415060342_rename_event_import_file_imported_at_to_executed_at.rb +9 -0
  81. data/spec/dummy/db/migrate/20120424103932_add_librarian_id_to_checked_item.rb +5 -0
  82. data/spec/dummy/db/migrate/20121116031206_add_fulltext_content_to_manifestation.rb +5 -0
  83. data/spec/dummy/db/migrate/20130221154434_add_additional_attributes_to_user.rb +16 -0
  84. data/spec/dummy/db/migrate/20130303104849_add_state_index_to_reserve.rb +5 -0
  85. data/spec/dummy/db/migrate/20130303124821_add_retained_at_to_reserve.rb +5 -0
  86. data/spec/dummy/db/migrate/20130304015019_add_postponed_at_to_reserve.rb +5 -0
  87. data/spec/dummy/db/migrate/20130416054135_add_circulation_status_id_to_item.rb +8 -0
  88. data/spec/dummy/db/migrate/20130519065638_add_lock_version_to_reserve.rb +5 -0
  89. data/spec/dummy/db/migrate/20130519065837_add_lock_version_to_checkin.rb +5 -0
  90. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +18 -0
  91. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +11 -0
  92. data/spec/dummy/db/migrate/20140122054321_create_profiles.rb +20 -0
  93. data/spec/dummy/db/migrate/20140518050147_create_reserve_transitions.rb +14 -0
  94. data/spec/dummy/db/migrate/20140518111006_create_message_transitions.rb +14 -0
  95. data/spec/dummy/db/migrate/20140518135713_create_message_request_transitions.rb +14 -0
  96. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +14 -0
  97. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +14 -0
  98. data/spec/dummy/db/migrate/20140523171309_create_event_import_file_transitions.rb +14 -0
  99. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +14 -0
  100. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +14 -0
  101. data/spec/dummy/db/migrate/20140528045518_create_user_checkout_stat_transitions.rb +14 -0
  102. data/spec/dummy/db/migrate/20140528045539_create_user_reserve_stat_transitions.rb +14 -0
  103. data/spec/dummy/db/migrate/20140528045600_create_manifestation_checkout_stat_transitions.rb +14 -0
  104. data/spec/dummy/db/migrate/20140528045617_create_manifestation_reserve_stat_transitions.rb +14 -0
  105. data/spec/dummy/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +11 -0
  106. data/spec/dummy/db/migrate/20140614065404_create_resource_export_files.rb +11 -0
  107. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +14 -0
  108. data/spec/dummy/db/migrate/20140628071719_add_user_encoding_to_event_import_file.rb +5 -0
  109. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +5 -0
  110. data/spec/dummy/db/migrate/20140628073524_add_user_encoding_to_agent_import_file.rb +5 -0
  111. data/spec/dummy/db/migrate/20140628073535_add_user_encoding_to_resource_import_file.rb +5 -0
  112. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +11 -0
  113. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +14 -0
  114. data/spec/dummy/db/migrate/20140720140916_add_binding_item_identifier_to_item.rb +8 -0
  115. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +5 -0
  116. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +5 -0
  117. data/spec/dummy/db/migrate/20140720192418_add_default_library_id_to_event_import_file.rb +5 -0
  118. data/spec/dummy/db/migrate/20140721151416_add_default_shelf_id_to_resource_import_file.rb +5 -0
  119. data/spec/dummy/db/migrate/20140802082007_add_manifestation_id_to_item.rb +6 -0
  120. data/spec/dummy/db/migrate/20140810061942_add_user_id_to_user_checkout_stat.rb +12 -0
  121. data/spec/dummy/db/migrate/20140810091231_add_checkout_icalendar_token_to_profile.rb +6 -0
  122. data/spec/dummy/db/migrate/20140810091417_add_save_checkout_history_to_profile.rb +5 -0
  123. data/spec/dummy/db/migrate/20140811031145_add_expired_at_to_profile.rb +5 -0
  124. data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +5 -0
  125. data/spec/dummy/db/schema.rb +660 -87
  126. data/spec/dummy/db/test.sqlite3 +0 -0
  127. data/spec/fixtures/profiles.yml +98 -0
  128. data/spec/fixtures/users.yml +0 -28
  129. data/spec/models/ndl_book_spec.rb +6 -2
  130. metadata +188 -34
  131. data/spec/dummy/db/migrate/143_create_subject_has_classifications.rb +0 -16
  132. data/spec/dummy/db/migrate/20080606052544_create_work_has_subjects.rb +0 -18
  133. data/spec/dummy/db/migrate/20090208044541_create_subject_heading_type_has_subjects.rb +0 -16
  134. data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +0 -9
  135. data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +0 -9
  136. data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +0 -13
  137. data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +0 -13
  138. data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +0 -9
  139. data/spec/dummy/db/migrate/20111201121844_create_roles.rb +0 -12
  140. data/spec/dummy/db/migrate/20111201155456_create_users.rb +0 -13
  141. data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +0 -52
  142. data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +0 -9
@@ -0,0 +1,17 @@
1
+ class CreateCheckoutTypes < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :checkout_types do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ add_index :checkout_types, :name
12
+ end
13
+
14
+ def self.down
15
+ drop_table :checkout_types
16
+ end
17
+ end
@@ -0,0 +1,25 @@
1
+ class CreateUserGroupHasCheckoutTypes < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :user_group_has_checkout_types do |t|
4
+ t.integer :user_group_id, :null => false
5
+ t.integer :checkout_type_id, :null => false
6
+ t.integer :checkout_limit, :default => 0, :null => false
7
+ t.integer :checkout_period, :default => 0, :null => false
8
+ t.integer :checkout_renewal_limit, :default => 0, :null => false
9
+ t.integer :reservation_limit, :default => 0, :null => false
10
+ t.integer :reservation_expired_period, :default => 7, :null => false
11
+ t.boolean :set_due_date_before_closing_day, :default => false, :null => false
12
+ t.datetime :fixed_due_date
13
+ t.text :note
14
+ t.integer :position
15
+
16
+ t.timestamps
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
+ end
21
+
22
+ def self.down
23
+ drop_table :user_group_has_checkout_types
24
+ end
25
+ end
@@ -0,0 +1,18 @@
1
+ class CreateCarrierTypeHasCheckoutTypes < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :carrier_type_has_checkout_types do |t|
4
+ t.integer :carrier_type_id, :null => false
5
+ t.integer :checkout_type_id, :null => false
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
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
+ end
14
+
15
+ def self.down
16
+ drop_table :carrier_type_has_checkout_types
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ class CreateCheckoutStatHasManifestations < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :checkout_stat_has_manifestations do |t|
4
+ t.integer :manifestation_checkout_stat_id, :null => false
5
+ t.integer :manifestation_id, :null => false
6
+ t.integer :checkouts_count
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :checkout_stat_has_manifestations, :manifestation_checkout_stat_id, :name => 'index_checkout_stat_has_manifestations_on_checkout_stat_id'
11
+ add_index :checkout_stat_has_manifestations, :manifestation_id, :name => 'index_checkout_stat_has_manifestations_on_manifestation_id'
12
+ end
13
+
14
+ def self.down
15
+ drop_table :checkout_stat_has_manifestations
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ class CreateManifestationCheckoutStats < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :manifestation_checkout_stats do |t|
4
+ t.datetime :start_date
5
+ t.datetime :end_date
6
+ t.text :note
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :manifestation_checkout_stats
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ class CreateUserCheckoutStats < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :user_checkout_stats do |t|
4
+ t.datetime :start_date
5
+ t.datetime :end_date
6
+ t.text :note
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :user_checkout_stats
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ class CreateCheckoutStatHasUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :checkout_stat_has_users do |t|
4
+ t.integer :user_checkout_stat_id, :null => false
5
+ t.integer :user_id, :null => false
6
+ t.integer :checkouts_count, :default => 0, :null => false
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :checkout_stat_has_users, :user_checkout_stat_id
11
+ add_index :checkout_stat_has_users, :user_id
12
+ end
13
+
14
+ def self.down
15
+ drop_table :checkout_stat_has_users
16
+ end
17
+ end
@@ -0,0 +1,17 @@
1
+ class CreateReserveStatHasManifestations < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :reserve_stat_has_manifestations do |t|
4
+ t.integer :manifestation_reserve_stat_id, :null => false
5
+ t.integer :manifestation_id, :null => false
6
+ t.integer :reserves_count
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :reserve_stat_has_manifestations, :manifestation_reserve_stat_id, :name => 'index_reserve_stat_has_manifestations_on_m_reserve_stat_id'
11
+ add_index :reserve_stat_has_manifestations, :manifestation_id
12
+ end
13
+
14
+ def self.down
15
+ drop_table :reserve_stat_has_manifestations
16
+ end
17
+ end
@@ -0,0 +1,15 @@
1
+ class CreateManifestationReserveStats < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :manifestation_reserve_stats do |t|
4
+ t.datetime :start_date
5
+ t.datetime :end_date
6
+ t.text :note
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :manifestation_reserve_stats
14
+ end
15
+ end
@@ -0,0 +1,15 @@
1
+ class CreateUserReserveStats < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :user_reserve_stats do |t|
4
+ t.datetime :start_date
5
+ t.datetime :end_date
6
+ t.text :note
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :user_reserve_stats
14
+ end
15
+ end
@@ -0,0 +1,17 @@
1
+ class CreateReserveStatHasUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :reserve_stat_has_users do |t|
4
+ t.integer :user_reserve_stat_id, :null => false
5
+ t.integer :user_id, :null => false
6
+ t.integer :reserves_count
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :reserve_stat_has_users, :user_reserve_stat_id
11
+ add_index :reserve_stat_has_users, :user_id
12
+ end
13
+
14
+ def self.down
15
+ drop_table :reserve_stat_has_users
16
+ end
17
+ end
@@ -0,0 +1,23 @@
1
+ class AddCompletedAtToUserCheckoutStat < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :user_checkout_stats, :started_at, :datetime
4
+ add_column :user_checkout_stats, :completed_at, :datetime
5
+ add_column :user_reserve_stats, :started_at, :datetime
6
+ add_column :user_reserve_stats, :completed_at, :datetime
7
+ add_column :manifestation_checkout_stats, :started_at, :datetime
8
+ add_column :manifestation_checkout_stats, :completed_at, :datetime
9
+ add_column :manifestation_reserve_stats, :started_at, :datetime
10
+ add_column :manifestation_reserve_stats, :completed_at, :datetime
11
+ end
12
+
13
+ def self.down
14
+ remove_column :user_checkout_stats, :started_at
15
+ remove_column :user_checkout_stats, :completed_at
16
+ remove_column :user_reserve_stats, :started_at
17
+ remove_column :user_reserve_stats, :completed_at
18
+ remove_column :manifestation_checkout_stats, :started_at
19
+ remove_column :manifestation_checkout_stats, :completed_at
20
+ remove_column :manifestation_reserve_stats, :started_at
21
+ remove_column :manifestation_reserve_stats, :completed_at
22
+ end
23
+ end
@@ -0,0 +1,17 @@
1
+ class CreateParticipates < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :participates do |t|
4
+ t.integer :agent_id, :null => false
5
+ t.integer :event_id, :null => false
6
+ t.integer :position
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :participates, :event_id
11
+ add_index :participates, :agent_id
12
+ end
13
+
14
+ def self.down
15
+ drop_table :participates
16
+ end
17
+ end
@@ -0,0 +1,21 @@
1
+ class CreateLendingPolicies < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :lending_policies do |t|
4
+ t.integer :item_id, :null => false
5
+ t.integer :user_group_id, :null => false
6
+ t.integer :loan_period, :default => 0, :null => false
7
+ t.datetime :fixed_due_date
8
+ t.integer :renewal, :default => 0, :null => false
9
+ t.integer :fine, :default => 0, :null => false
10
+ t.text :note
11
+ t.integer :position
12
+
13
+ t.timestamps
14
+ end
15
+ add_index :lending_policies, [:item_id, :user_group_id], :unique => true
16
+ end
17
+
18
+ def self.down
19
+ drop_table :lending_policies
20
+ end
21
+ end
@@ -2,7 +2,6 @@ class CreateImportRequests < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :import_requests do |t|
4
4
  t.string :isbn
5
- t.string :state
6
5
  t.integer :manifestation_id
7
6
  t.integer :user_id
8
7
 
@@ -6,5 +6,7 @@ class CreateUserHasRoles < ActiveRecord::Migration
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
9
11
  end
10
12
  end
@@ -0,0 +1,15 @@
1
+ class CreateEventImportResults < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :event_import_results do |t|
4
+ t.integer :event_import_file_id
5
+ t.integer :event_id
6
+ t.text :body
7
+
8
+ t.timestamps
9
+ end
10
+ end
11
+
12
+ def self.down
13
+ drop_table :event_import_results
14
+ end
15
+ end
@@ -0,0 +1,9 @@
1
+ class AddExpireDateToReserve < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :reserves, :expire_date, :string
4
+ end
5
+
6
+ def self.down
7
+ remove_column :reserves, :expire_date
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class AddValidPeriodForNewUserToUserGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :user_groups, :valid_period_for_new_user, :integer, :default => 0, :null => false
4
+ add_column :user_groups, :expired_at, :timestamp
5
+ end
6
+
7
+ def self.down
8
+ remove_column :user_groups, :valid_period_for_new_user
9
+ remove_column :user_groups, :expired_at
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ class AddCurrentCheckoutCountToUserGroupHasCheckoutType < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :user_group_has_checkout_types, :current_checkout_count, :integer
4
+ end
5
+
6
+ def self.down
7
+ remove_column :user_group_has_checkout_types, :current_checkout_count
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class RemoveExpireDateFromReserve < ActiveRecord::Migration
2
+ def self.up
3
+ remove_column :reserves, :expire_date
4
+ end
5
+
6
+ def self.down
7
+ add_column :reserves, :expire_date, :string
8
+ end
9
+ end
@@ -0,0 +1,13 @@
1
+ class AddNumberOfDayToNotifyOverdueToUserGroup < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :user_groups, :number_of_day_to_notify_overdue, :integer, :default => 1, :null => false
4
+ add_column :user_groups, :number_of_day_to_notify_due_date, :integer, :default => 7, :null => false
5
+ add_column :user_groups, :number_of_time_to_notify_overdue, :integer, :default => 3, :null => false
6
+ end
7
+
8
+ def self.down
9
+ remove_column :user_groups, :number_of_time_to_notify_overdue
10
+ remove_column :user_groups, :number_of_day_to_notify_due_date
11
+ remove_column :user_groups, :number_of_day_to_notify_overdue
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+ class AddLftAndRgtToMessage < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :messages, :lft, :integer
4
+ add_column :messages, :rgt, :integer
5
+ end
6
+
7
+ def self.down
8
+ remove_column :messages, :rgt
9
+ remove_column :messages, :lft
10
+ end
11
+ end
@@ -0,0 +1,5 @@
1
+ class AddSaveCheckoutHistoryToUser < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :save_checkout_history, :boolean, :default => false, :null => false
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddCheckoutIcalendarTokenToUser < ActiveRecord::Migration
2
+ def change
3
+ add_column :users, :checkout_icalendar_token, :string
4
+ add_index :users, :checkout_icalendar_token, :unique => true
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ class AddDepthToMessage < ActiveRecord::Migration
2
+ def change
3
+ add_column :messages, :depth, :integer
4
+
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddEventImportFingerprintToEventImportFile < ActiveRecord::Migration
2
+ def change
3
+ add_column :event_import_files, :event_import_fingerprint, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddErrorMessageToEventImportFile < ActiveRecord::Migration
2
+ def change
3
+ add_column :event_import_files, :error_message, :text
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class RenameEventImportFileImportedAtToExecutedAt < ActiveRecord::Migration
2
+ def up
3
+ rename_column :event_import_files, :imported_at, :executed_at
4
+ end
5
+
6
+ def down
7
+ rename_column :event_import_files, :executed_at, :impored_at
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddLibrarianIdToCheckedItem < ActiveRecord::Migration
2
+ def change
3
+ add_column :checked_items, :librarian_id, :integer
4
+ end
5
+ end