enju_library 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (217) hide show
  1. data/README.rdoc +2 -2
  2. data/app/controllers/shelves_controller.rb +2 -1
  3. data/app/helpers/shelves_helper.rb +9 -5
  4. data/app/models/library.rb +1 -2
  5. data/app/models/library_group.rb +7 -1
  6. data/app/models/shelf.rb +1 -0
  7. data/app/views/accepts/index.html.erb +2 -2
  8. data/app/views/bookstores/index.html.erb +3 -3
  9. data/app/views/bookstores/show.html.erb +1 -1
  10. data/app/views/budget_types/index.html.erb +2 -2
  11. data/app/views/libraries/_form.html.erb +1 -1
  12. data/app/views/libraries/index.html.erb +3 -3
  13. data/app/views/libraries/show.html.erb +1 -1
  14. data/app/views/library_groups/index.html.erb +1 -1
  15. data/app/views/request_status_types/index.html.erb +2 -2
  16. data/app/views/request_types/index.html.erb +2 -2
  17. data/app/views/search_engines/index.html.erb +2 -2
  18. data/app/views/shelves/_library_facet.html.erb +1 -4
  19. data/app/views/shelves/index.html.erb +2 -2
  20. data/app/views/shelves/show.mobile.erb +33 -0
  21. data/app/views/subscribes/index.html.erb +2 -2
  22. data/app/views/subscriptions/index.html.erb +2 -2
  23. data/app/views/subscriptions/show.html.erb +1 -1
  24. data/lib/enju_library/engine.rb +0 -8
  25. data/lib/enju_library/version.rb +1 -1
  26. data/lib/enju_library.rb +0 -2
  27. data/spec/controllers/bookstores_controller_spec.rb +447 -0
  28. data/spec/controllers/budget_types_controller_spec.rb +167 -0
  29. data/spec/controllers/libraries_controller_spec.rb +517 -0
  30. data/spec/controllers/library_groups_controller_spec.rb +133 -0
  31. data/spec/controllers/request_status_types_controller_spec.rb +447 -0
  32. data/spec/controllers/request_types_controller_spec.rb +447 -0
  33. data/spec/controllers/search_engines_controller_spec.rb +447 -0
  34. data/spec/controllers/shelves_controller_spec.rb +437 -0
  35. data/spec/controllers/subscribes_controller_spec.rb +441 -0
  36. data/spec/controllers/subscriptions_controller_spec.rb +442 -0
  37. data/{test → spec}/dummy/README.rdoc +0 -0
  38. data/{test → spec}/dummy/Rakefile +0 -0
  39. data/{test → spec}/dummy/app/assets/javascripts/application.js +0 -0
  40. data/{test → spec}/dummy/app/assets/stylesheets/application.css +0 -0
  41. data/spec/dummy/app/controllers/application_controller.rb +59 -0
  42. data/spec/dummy/app/helpers/application_helper.rb +13 -0
  43. data/spec/dummy/app/models/ability.rb +51 -0
  44. data/spec/dummy/app/models/picture_file.rb +49 -0
  45. data/spec/dummy/app/models/role.rb +46 -0
  46. data/spec/dummy/app/models/user.rb +94 -0
  47. data/spec/dummy/app/models/user_group.rb +40 -0
  48. data/spec/dummy/app/models/user_has_role.rb +5 -0
  49. data/{test → spec}/dummy/app/views/layouts/application.html.erb +0 -0
  50. data/spec/dummy/app/views/page/403.html.erb +9 -0
  51. data/spec/dummy/app/views/page/403.mobile.erb +5 -0
  52. data/spec/dummy/app/views/page/403.xml.erb +4 -0
  53. data/spec/dummy/app/views/page/404.html.erb +9 -0
  54. data/spec/dummy/app/views/page/404.mobile.erb +5 -0
  55. data/spec/dummy/app/views/page/404.xml.erb +4 -0
  56. data/{test → spec}/dummy/config/application.rb +3 -0
  57. data/{test → spec}/dummy/config/boot.rb +0 -0
  58. data/{test → spec}/dummy/config/database.yml +0 -0
  59. data/{test → spec}/dummy/config/environment.rb +0 -0
  60. data/{test → spec}/dummy/config/environments/development.rb +0 -0
  61. data/{test → spec}/dummy/config/environments/production.rb +0 -0
  62. data/{test → spec}/dummy/config/environments/test.rb +0 -0
  63. data/{test → spec}/dummy/config/initializers/backtrace_silencers.rb +0 -0
  64. data/spec/dummy/config/initializers/devise.rb +205 -0
  65. data/{test → spec}/dummy/config/initializers/inflections.rb +0 -0
  66. data/{test → spec}/dummy/config/initializers/mime_types.rb +0 -0
  67. data/{test → spec}/dummy/config/initializers/secret_token.rb +0 -0
  68. data/{test → spec}/dummy/config/initializers/session_store.rb +0 -0
  69. data/{test → spec}/dummy/config/initializers/wrap_parameters.rb +0 -0
  70. data/{test → spec}/dummy/config/locales/en.yml +0 -0
  71. data/{test → spec}/dummy/config/routes.rb +2 -0
  72. data/{test → spec}/dummy/config.ru +0 -0
  73. data/spec/dummy/db/development.sqlite3 +0 -0
  74. data/spec/dummy/db/migrate/001_create_patrons.rb +58 -0
  75. data/spec/dummy/db/migrate/005_create_manifestations.rb +61 -0
  76. data/spec/dummy/db/migrate/006_create_items.rb +31 -0
  77. data/spec/dummy/db/migrate/012_create_owns.rb +12 -0
  78. data/spec/dummy/db/migrate/015_create_creates.rb +12 -0
  79. data/spec/dummy/db/migrate/047_create_produces.rb +12 -0
  80. data/spec/dummy/db/migrate/073_create_carrier_types.rb +11 -0
  81. data/spec/dummy/db/migrate/077_create_user_groups.rb +16 -0
  82. data/spec/dummy/db/migrate/125_create_donates.rb +12 -0
  83. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +13 -0
  84. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +13 -0
  85. data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +12 -0
  86. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +28 -0
  87. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +23 -0
  88. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +16 -0
  89. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +15 -0
  90. data/spec/dummy/db/migrate/20090812151902_create_patron_relationship_types.rb +12 -0
  91. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +27 -0
  92. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +18 -0
  93. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +13 -0
  94. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +13 -0
  95. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +10 -0
  96. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
  97. data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +13 -0
  98. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
  99. data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +11 -0
  100. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
  101. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +9 -0
  102. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +11 -0
  103. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +13 -0
  104. data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +9 -0
  105. data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +9 -0
  106. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +9 -0
  107. data/{db → spec/dummy/db}/migrate/20110620173525_add_bookstore_id_to_item.rb +0 -0
  108. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
  109. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
  110. data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +13 -0
  111. data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +13 -0
  112. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +13 -0
  113. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +10 -0
  114. data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +13 -0
  115. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +9 -0
  116. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +12 -0
  117. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
  118. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
  119. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
  120. data/spec/dummy/db/migrate/20111201121844_create_roles.rb +12 -0
  121. data/spec/dummy/db/migrate/20111201155456_create_users.rb +16 -0
  122. data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +44 -0
  123. data/spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb +10 -0
  124. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +6 -0
  125. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +5 -0
  126. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +5 -0
  127. data/spec/dummy/db/schema.rb +642 -0
  128. data/spec/dummy/db/test.sqlite3 +0 -0
  129. data/{test → spec}/dummy/public/404.html +0 -0
  130. data/{test → spec}/dummy/public/422.html +0 -0
  131. data/{test → spec}/dummy/public/500.html +0 -0
  132. data/{test → spec}/dummy/public/favicon.ico +0 -0
  133. data/{test → spec}/dummy/script/rails +0 -0
  134. data/spec/dummy/solr/conf/admin-extra.html +31 -0
  135. data/spec/dummy/solr/conf/elevate.xml +36 -0
  136. data/spec/dummy/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
  137. data/spec/dummy/solr/conf/protwords.txt +21 -0
  138. data/spec/dummy/solr/conf/schema.xml +238 -0
  139. data/spec/dummy/solr/conf/scripts.conf +24 -0
  140. data/spec/dummy/solr/conf/solrconfig.xml +934 -0
  141. data/spec/dummy/solr/conf/spellings.txt +2 -0
  142. data/spec/dummy/solr/conf/stopwords.txt +58 -0
  143. data/spec/dummy/solr/conf/synonyms.txt +31 -0
  144. data/spec/dummy/solr/data/test/index/_k.fdt +0 -0
  145. data/spec/dummy/solr/data/test/index/_k.fdx +0 -0
  146. data/spec/dummy/solr/data/test/index/_k.fnm +3 -0
  147. data/spec/dummy/solr/data/test/index/_k.frq +1 -0
  148. data/spec/dummy/solr/data/test/index/_k.nrm +1 -0
  149. data/spec/dummy/solr/data/test/index/_k.prx +0 -0
  150. data/spec/dummy/solr/data/test/index/_k.tii +0 -0
  151. data/spec/dummy/solr/data/test/index/_k.tis +0 -0
  152. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  153. data/spec/dummy/solr/data/test/index/segments_18 +0 -0
  154. data/spec/dummy/solr/data/test/spellchecker/segments.gen +0 -0
  155. data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
  156. data/spec/dummy/tmp/cache/4AD/470/country_all +0 -0
  157. data/spec/factories/bookstore.rb +5 -0
  158. data/spec/factories/budget_types.rb +5 -0
  159. data/spec/factories/carrier_types.yml +51 -0
  160. data/spec/factories/library.rb +13 -0
  161. data/spec/factories/manifestation.rb +6 -0
  162. data/spec/factories/request_status_type.rb +5 -0
  163. data/spec/factories/request_type.rb +5 -0
  164. data/spec/factories/search_engine.rb +9 -0
  165. data/spec/factories/shelf.rb +6 -0
  166. data/spec/factories/subscribe.rb +8 -0
  167. data/spec/factories/subscription.rb +6 -0
  168. data/spec/factories/user.rb +37 -0
  169. data/spec/fixtures/bookstores.yml +107 -0
  170. data/spec/fixtures/budget_types.yml +29 -0
  171. data/spec/fixtures/carrier_types.yml +51 -0
  172. data/spec/fixtures/languages.yml +1901 -0
  173. data/spec/fixtures/libraries.yml +102 -0
  174. data/spec/fixtures/library_groups.yml +33 -0
  175. data/spec/fixtures/manifestations.yml +2022 -0
  176. data/spec/fixtures/request_status_types.yml +63 -0
  177. data/spec/fixtures/request_types.yml +55 -0
  178. data/spec/fixtures/roles.yml +21 -0
  179. data/spec/fixtures/search_engines.yml +41 -0
  180. data/spec/fixtures/shelves.yml +47 -0
  181. data/spec/fixtures/subscribes.yml +45 -0
  182. data/spec/fixtures/subscriptions.yml +27 -0
  183. data/spec/fixtures/user_groups.yml +31 -0
  184. data/spec/fixtures/user_has_roles.yml +41 -0
  185. data/spec/fixtures/users.yml +129 -0
  186. data/spec/models/bookstore_spec.rb +26 -0
  187. data/spec/models/budget_type_spec.rb +22 -0
  188. data/spec/models/library_group_spec.rb +33 -0
  189. data/spec/models/library_spec.rb +47 -0
  190. data/spec/models/request_status_type_spec.rb +21 -0
  191. data/spec/models/request_type_spec.rb +21 -0
  192. data/spec/models/search_engine_spec.rb +29 -0
  193. data/spec/models/shelf_spec.rb +29 -0
  194. data/spec/models/subscribe_spec.rb +21 -0
  195. data/spec/models/subscription_spec.rb +26 -0
  196. data/spec/routing/budget_types_routing_spec.rb +35 -0
  197. data/spec/routing/libraries_routing_spec.rb +35 -0
  198. data/spec/spec_helper.rb +55 -0
  199. data/spec/support/controller_macros.rb +46 -0
  200. data/spec/support/devise.rb +4 -0
  201. data/spec/support/vcr.rb +9 -0
  202. data/spec/views/budget_types/edit.html.erb_spec.rb +23 -0
  203. data/spec/views/budget_types/index.html.erb_spec.rb +28 -0
  204. data/spec/views/budget_types/new.html.erb_spec.rb +23 -0
  205. data/spec/views/budget_types/show.html.erb_spec.rb +24 -0
  206. metadata +372 -198
  207. data/lib/enju_library/master_model.rb +0 -19
  208. data/lib/enju_library/url_validator.rb +0 -10
  209. data/test/dummy/app/controllers/application_controller.rb +0 -3
  210. data/test/dummy/app/helpers/application_helper.rb +0 -2
  211. data/test/dummy/db/development.sqlite3 +0 -0
  212. data/test/dummy/db/test.sqlite3 +0 -0
  213. data/test/dummy/log/development.log +0 -0
  214. data/test/dummy/log/test.log +0 -0
  215. data/test/enju_library_test.rb +0 -7
  216. data/test/integration/navigation_test.rb +0 -10
  217. data/test/test_helper.rb +0 -15
@@ -0,0 +1,16 @@
1
+ class CreateUserGroups < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :user_groups do |t|
4
+ t.string :name, :string, :not_null => true
5
+ t.text :display_name, :string
6
+ t.text :note
7
+ t.integer :position
8
+ t.timestamps
9
+ t.datetime :deleted_at
10
+ end
11
+ end
12
+
13
+ def self.down
14
+ drop_table :user_groups
15
+ end
16
+ end
@@ -0,0 +1,12 @@
1
+ class CreateDonates < ActiveRecord::Migration
2
+ def change
3
+ create_table :donates do |t|
4
+ t.integer :patron_id, :null => false
5
+ t.integer :item_id, :null => false
6
+
7
+ t.timestamps
8
+ end
9
+ add_index :donates, :patron_id
10
+ add_index :donates, :item_id
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ class CreateRealizes < ActiveRecord::Migration
2
+ def change
3
+ create_table :realizes do |t|
4
+ t.references :patron, :null => false
5
+ t.references :expression, :null => false
6
+ t.integer :position
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :realizes, :patron_id
11
+ add_index :realizes, :expression_id
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class CreateExemplifies < ActiveRecord::Migration
2
+ def change
3
+ create_table :exemplifies do |t|
4
+ t.integer :manifestation_id, :null => false
5
+ t.integer :item_id, :null => false
6
+ t.integer :position
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :exemplifies, :manifestation_id
11
+ add_index :exemplifies, :item_id, :unique => true
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ class CreatePatronTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :patron_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
+ end
12
+ end
@@ -0,0 +1,28 @@
1
+ class CreateCountries < ActiveRecord::Migration
2
+
3
+ # ISO 3166 is the International Standard for country codes.
4
+ #
5
+ # ISO 3166-1:2006 Codes for the representation of names of countries and their subdivisions - Part 1:
6
+ # Country codes which is what most users know as ISO's country codes. First published in 1974, it is has since
7
+ # then become one of the world's most popular and most widely used standard solution for coding country names.
8
+ # It contains a two-letter code which is recommended as the general purpose code, a three-letter code which has
9
+ # better mnenomic properties and a numeric-3 code which can be useful if script independence of the codes is important.
10
+ #
11
+ # http://www.iso.org/iso/country_codes/background_on_iso_3166/what_is_iso_3166.htm
12
+
13
+ def change
14
+ create_table :countries do |t|
15
+ t.string :name, :size => 80, :null => false
16
+ t.text :display_name
17
+ t.string :alpha_2, :size => 2
18
+ t.string :alpha_3, :size => 3
19
+ t.string :numeric_3, :size => 3
20
+ t.text :note
21
+ t.integer :position
22
+ end
23
+ add_index :countries, :name
24
+ add_index :countries, :alpha_2
25
+ add_index :countries, :alpha_3
26
+ add_index :countries, :numeric_3
27
+ end
28
+ end
@@ -0,0 +1,23 @@
1
+ class CreateLanguages < ActiveRecord::Migration
2
+
3
+ # ISO 639 is the set of international standards that lists short codes for language names.
4
+ # Note this doesn't include macrolanguages (dialects)
5
+ # Information on macrolanguages http://en.wikipedia.org/wiki/ISO_639_macrolanguage
6
+
7
+ def change
8
+ create_table :languages do |t|
9
+ t.string :name, :null => false
10
+ t.string :native_name
11
+ t.text :display_name
12
+ t.string :iso_639_1, :size => 3
13
+ t.string :iso_639_2, :size => 3
14
+ t.string :iso_639_3, :size => 3
15
+ t.text :note
16
+ t.integer :position
17
+ end
18
+ add_index :languages, :name, :unique => true
19
+ add_index :languages, :iso_639_1
20
+ add_index :languages, :iso_639_2
21
+ add_index :languages, :iso_639_3
22
+ end
23
+ end
@@ -0,0 +1,16 @@
1
+ class CreatePictureFiles < ActiveRecord::Migration
2
+ def change
3
+ create_table :picture_files do |t|
4
+ t.integer :picture_attachable_id
5
+ t.string :picture_attachable_type
6
+ t.string :content_type
7
+ t.text :title
8
+ t.text :filename
9
+ t.string :thumbnail
10
+ t.integer :position
11
+
12
+ t.timestamps
13
+ end
14
+ add_index :picture_files, [:picture_attachable_id, :picture_attachable_type], :name => "index_picture_files_on_picture_attachable_id_and_type"
15
+ end
16
+ end
@@ -0,0 +1,15 @@
1
+ class AddAttachmentsPictureToPictureFile < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :picture_files, :picture_file_name, :string
4
+ add_column :picture_files, :picture_content_type, :string
5
+ add_column :picture_files, :picture_file_size, :integer
6
+ add_column :picture_files, :picture_updated_at, :datetime
7
+ end
8
+
9
+ def self.down
10
+ remove_column :picture_files, :picture_file_name
11
+ remove_column :picture_files, :picture_content_type
12
+ remove_column :picture_files, :picture_file_size
13
+ remove_column :picture_files, :picture_updated_at
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ class CreatePatronRelationshipTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :patron_relationship_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
+ end
12
+ end
@@ -0,0 +1,27 @@
1
+ class AddDcndlSchema < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestations, :title_alternative_transcription, :text
4
+ add_column :patrons, :full_name_alternative_transcription, :text
5
+ add_column :manifestations, :description, :text
6
+ add_column :manifestations, :abstract, :text
7
+ add_column :manifestations, :available_at, :timestamp
8
+ add_column :manifestations, :valid_until, :timestamp
9
+ add_column :manifestations, :date_submitted, :timestamp
10
+ add_column :manifestations, :date_accepted, :timestamp
11
+ add_column :manifestations, :date_caputured, :timestamp
12
+ rename_column :manifestations, :copyright_date, :date_copyrighted
13
+ end
14
+
15
+ def self.down
16
+ remove_column :manifestations, :title_alternative_transcription
17
+ remove_column :patrons, :full_name_alternative_transcription
18
+ remove_column :manifestations, :description
19
+ remove_column :manifestations, :abstract
20
+ remove_column :manifestations, :available_at
21
+ remove_column :manifestations, :valid_until
22
+ remove_column :manifestations, :date_submitted
23
+ remove_column :manifestations, :date_accepted
24
+ remove_column :manifestations, :date_caputured
25
+ rename_column :manifestations, :date_copyrighted, :copyright_date
26
+ end
27
+ end
@@ -0,0 +1,18 @@
1
+ class CreateVersions < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :versions do |t|
4
+ t.string :item_type, :null => false
5
+ t.integer :item_id, :null => false
6
+ t.string :event, :null => false
7
+ t.string :whodunnit
8
+ t.text :object
9
+ t.datetime :created_at
10
+ end
11
+ add_index :versions, [:item_type, :item_id]
12
+ end
13
+
14
+ def self.down
15
+ remove_index :versions, [:item_type, :item_id]
16
+ drop_table :versions
17
+ end
18
+ end
@@ -0,0 +1,13 @@
1
+ class CreateSeriesStatements < ActiveRecord::Migration
2
+ def change
3
+ create_table :series_statements do |t|
4
+ t.text :title
5
+ t.text :numbering
6
+ t.text :title_subseries
7
+ t.text :numbering_subseries
8
+ t.integer :position
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class RenameSeriesStatementTitleToOriginalTitle < ActiveRecord::Migration
2
+ def self.up
3
+ rename_column :series_statements, :title, :original_title
4
+ add_column :series_statements, :title_transcription, :text
5
+ add_column :series_statements, :title_alternative, :text
6
+ end
7
+
8
+ def self.down
9
+ rename_column :series_statements, :original_title, :title
10
+ remove_column :series_statements, :title_transcription
11
+ remove_column :series_statements, :title_alternative
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ class AddSeriesStatementIdentifierToSeriesStatement < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :series_statements, :series_statement_identifier, :string
4
+ add_index :series_statements, :series_statement_identifier
5
+ end
6
+
7
+ def self.down
8
+ remove_column :series_statements, :series_statement_identifier
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ class CreateManifestationRelationships < ActiveRecord::Migration
2
+ def change
3
+ create_table :manifestation_relationships do |t|
4
+ t.integer :parent_id
5
+ t.integer :child_id
6
+ t.integer :manifestation_relationship_type_id
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :manifestation_relationships, :parent_id
11
+ add_index :manifestation_relationships, :child_id
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class CreatePatronRelationships < ActiveRecord::Migration
2
+ def change
3
+ create_table :patron_relationships do |t|
4
+ t.integer :parent_id
5
+ t.integer :child_id
6
+ t.integer :patron_relationship_type_id
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :patron_relationships, :parent_id
11
+ add_index :patron_relationships, :child_id
12
+ end
13
+ end
@@ -0,0 +1,12 @@
1
+ class CreateManifestationRelationshipTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :manifestation_relationship_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
+ end
12
+ end
@@ -0,0 +1,11 @@
1
+ class AddPositionToPatronRelationship < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestation_relationships, :position, :integer
4
+ add_column :patron_relationships, :position, :integer
5
+ end
6
+
7
+ def self.down
8
+ remove_column :patron_relationships, :position
9
+ remove_column :manifestation_relationships, :position
10
+ end
11
+ end
@@ -0,0 +1,9 @@
1
+ class AddAcquiredAtToItem < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :items, :acquired_at, :timestamp
4
+ end
5
+
6
+ def self.down
7
+ remove_column :items, :acquired_at
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddPubDateToManifestation < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestations, :pub_date, :string
4
+ end
5
+
6
+ def self.down
7
+ remove_column :manifestations, :pub_date
8
+ end
9
+ end
@@ -0,0 +1,11 @@
1
+ class AddBirthDateAndDeathDateToPatron < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :patrons, :birth_date, :string
4
+ add_column :patrons, :death_date, :string
5
+ end
6
+
7
+ def self.down
8
+ remove_column :patrons, :death_date
9
+ remove_column :patrons, :birth_date
10
+ end
11
+ end
@@ -0,0 +1,13 @@
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
+ remove_column :library_groups, :valid_period_for_new_user
6
+ end
7
+
8
+ def self.down
9
+ remove_column :user_groups, :valid_period_for_new_user
10
+ remove_column :user_groups, :expired_at
11
+ add_column :library_groups, :valid_period_for_new_user, :integer, :default => 0, :null => false
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ class AddIssnToSeriesStatement < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :series_statements, :issn, :string
4
+ end
5
+
6
+ def self.down
7
+ remove_column :series_statements, :issn
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddPeriodicalToSeriesStatement < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :series_statements, :periodical, :boolean
4
+ end
5
+
6
+ def self.down
7
+ remove_column :series_statements, :periodical
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class AddEditionStringToManifestation < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestations, :edition_string, :string
4
+ end
5
+
6
+ def self.down
7
+ remove_column :manifestations, :edition_string
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class CreateSeriesStatementMergeLists < ActiveRecord::Migration
2
+ def change
3
+ create_table :series_statement_merge_lists do |t|
4
+ t.string :title
5
+
6
+ t.timestamps
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ class CreateSeriesStatementMerges < ActiveRecord::Migration
2
+ def change
3
+ create_table :series_statement_merges do |t|
4
+ t.integer :series_statement_id, :null => false
5
+ t.integer :series_statement_merge_list_id, :null => false
6
+
7
+ t.timestamps
8
+ end
9
+ add_index :series_statement_merges, :series_statement_id
10
+ add_index :series_statement_merges, :series_statement_merge_list_id
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ class CreateSeriesHasManifestations < ActiveRecord::Migration
2
+ def change
3
+ create_table :series_has_manifestations do |t|
4
+ t.integer :series_statement_id
5
+ t.integer :manifestation_id
6
+ t.integer :position
7
+
8
+ t.timestamps
9
+ end
10
+ add_index :series_has_manifestations, :series_statement_id
11
+ add_index :series_has_manifestations, :manifestation_id
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class RenameManifestationNumberListToNumberString < ActiveRecord::Migration
2
+ def self.up
3
+ rename_column :manifestations, :volume_number_list, :volume_number_string
4
+ rename_column :manifestations, :issue_number_list, :issue_number_string
5
+ rename_column :manifestations, :serial_number_list, :serial_number_string
6
+ end
7
+
8
+ def self.down
9
+ rename_column :manifestations, :serial_number_string, :serial_number_list
10
+ rename_column :manifestations, :issue_number_string, :issue_number_list
11
+ rename_column :manifestations, :volume_number_string, :volume_number_list
12
+ end
13
+ end
@@ -0,0 +1,13 @@
1
+ class AddVolumeNumberToManifestation < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestations, :volume_number, :integer
4
+ add_column :manifestations, :issue_number, :integer
5
+ add_column :manifestations, :serial_number, :integer
6
+ end
7
+
8
+ def self.down
9
+ remove_column :manifestations, :serial_number
10
+ remove_column :manifestations, :issue_number
11
+ remove_column :manifestations, :volume_number
12
+ end
13
+ end
@@ -0,0 +1,10 @@
1
+ class AddManifestaitonIdToSeriesStatement < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :series_statements, :manifestation_id, :integer
4
+ add_index :series_statements, :manifestation_id
5
+ end
6
+
7
+ def self.down
8
+ remove_column :series_statements, :manifestation_id
9
+ end
10
+ end
@@ -0,0 +1,13 @@
1
+ class RenameSeriesStatementManifestationIdToRootManifestationId < ActiveRecord::Migration
2
+ def self.up
3
+ remove_index :series_statements, :series_statement_identifier
4
+ rename_column :series_statements, :manifestation_id, :root_manifestation_id
5
+ add_index :series_statements, :series_statement_identifier
6
+ end
7
+
8
+ def self.down
9
+ remove_index :series_statements, :series_statement_identifier
10
+ rename_column :series_statements, :root_manifestation_id, :manifestation_id
11
+ add_index :series_statements, :series_statement_identifier
12
+ end
13
+ end
@@ -0,0 +1,9 @@
1
+ class AddNoteToSeriesStatement < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :series_statements, :note, :text
4
+ end
5
+
6
+ def self.down
7
+ remove_column :series_statements, :note
8
+ end
9
+ end
@@ -0,0 +1,12 @@
1
+ class CreateCreateTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :create_types do |t|
4
+ t.string :name
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateRealizeTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :realize_types do |t|
4
+ t.string :name
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ class CreateProduceTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :produce_types do |t|
4
+ t.string :name
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,7 @@
1
+ class AddCreateTypeToCreate < ActiveRecord::Migration
2
+ def change
3
+ add_column :creates, :create_type_id, :integer
4
+ add_column :realizes, :realize_type_id, :integer
5
+ add_column :produces, :produce_type_id, :integer
6
+ end
7
+ end
@@ -0,0 +1,12 @@
1
+ class CreateRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :roles do |t|
4
+ t.string :name
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :position
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ end
@@ -0,0 +1,16 @@
1
+ class CreateUsers < ActiveRecord::Migration
2
+ def change
3
+ create_table :users do |t|
4
+ t.integer :user_group_id
5
+ t.integer :required_role_id
6
+ t.string :username
7
+ t.text :note
8
+ t.string :locale
9
+ t.string :user_number
10
+ t.integer :library_id
11
+ t.datetime :locked_at
12
+
13
+ t.timestamps
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,44 @@
1
+ class AddDeviseToUsers < ActiveRecord::Migration
2
+ def self.up
3
+ change_table(:users) do |t|
4
+ ## Database authenticatable
5
+ t.string :email, :null => false, :default => ""
6
+ t.string :encrypted_password, :null => false, :default => ""
7
+
8
+ ## Recoverable
9
+ t.string :reset_password_token
10
+ t.datetime :reset_password_sent_at
11
+
12
+ ## Rememberable
13
+ t.datetime :remember_created_at
14
+
15
+ ## Trackable
16
+ t.integer :sign_in_count, :default => 0
17
+ t.datetime :current_sign_in_at
18
+ t.datetime :last_sign_in_at
19
+ t.string :current_sign_in_ip
20
+ t.string :last_sign_in_ip
21
+
22
+ # t.encryptable
23
+ # t.confirmable
24
+ # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
25
+ # t.token_authenticatable
26
+
27
+
28
+ # Uncomment below if timestamps were not included in your original model.
29
+ # t.timestamps
30
+ end
31
+
32
+ add_index :users, :email #, :unique => true
33
+ add_index :users, :reset_password_token, :unique => true
34
+ # add_index :users, :confirmation_token, :unique => true
35
+ # add_index :users, :unlock_token, :unique => true
36
+ # add_index :users, :authentication_token, :unique => true
37
+ end
38
+
39
+ def self.down
40
+ # By default, we don't want to make any assumption about how to roll back a migration when your
41
+ # model already existed. Please edit below which fields you would like to remove in this migration.
42
+ raise ActiveRecord::IrreversibleMigration
43
+ end
44
+ end
@@ -0,0 +1,10 @@
1
+ class CreateUserHasRoles < ActiveRecord::Migration
2
+ def change
3
+ create_table :user_has_roles do |t|
4
+ t.integer :user_id
5
+ t.integer :role_id
6
+
7
+ t.timestamps
8
+ end
9
+ end
10
+ end
@@ -0,0 +1,6 @@
1
+ class AddTitleSubseriesTranscriptionToSeriesStatement < ActiveRecord::Migration
2
+ def change
3
+ add_column :series_statements, :title_subseries_transcription, :text
4
+
5
+ end
6
+ end