enju_oai 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (161) hide show
  1. data/lib/enju_oai/engine.rb +1 -8
  2. data/lib/enju_oai/version.rb +1 -1
  3. data/spec/controllers/manifestations_controller_spec.rb +4 -0
  4. data/spec/dummy/app/controllers/application_controller.rb +1 -1
  5. data/spec/dummy/config/application.rb +3 -1
  6. data/spec/dummy/config/initializers/devise.rb +0 -4
  7. data/spec/dummy/config/routes.rb +2 -0
  8. data/spec/dummy/db/migrate/001_create_patrons.rb +0 -1
  9. data/spec/dummy/db/migrate/005_create_manifestations.rb +0 -3
  10. data/spec/dummy/db/migrate/012_create_owns.rb +0 -2
  11. data/spec/dummy/db/migrate/015_create_creates.rb +0 -2
  12. data/spec/dummy/db/migrate/047_create_produces.rb +0 -2
  13. data/spec/dummy/db/migrate/059_create_libraries.rb +1 -3
  14. data/spec/dummy/db/migrate/069_create_shelves.rb +15 -0
  15. data/spec/dummy/db/migrate/080_create_library_groups.rb +0 -1
  16. data/spec/dummy/db/migrate/124_create_bookstores.rb +17 -0
  17. data/spec/dummy/db/migrate/125_create_donates.rb +12 -0
  18. data/spec/dummy/db/migrate/130_create_request_status_types.rb +12 -0
  19. data/spec/dummy/db/migrate/131_create_request_types.rb +12 -0
  20. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +0 -2
  21. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +0 -2
  22. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +17 -0
  23. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +14 -0
  24. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +15 -0
  25. data/spec/dummy/db/migrate/20081028083142_create_patron_import_files.rb +22 -0
  26. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +22 -0
  27. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +15 -0
  28. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
  29. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +27 -0
  30. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +13 -0
  31. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +15 -0
  32. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +13 -0
  33. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +10 -0
  34. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +15 -0
  35. data/spec/dummy/db/migrate/20100925074559_create_patron_import_results.rb +12 -0
  36. data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +9 -0
  37. data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +9 -0
  38. data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +9 -0
  39. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +11 -0
  40. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
  41. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
  42. data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +13 -0
  43. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +10 -0
  44. data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +13 -0
  45. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +9 -0
  46. data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +9 -0
  47. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +6 -0
  48. data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +12 -0
  49. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +6 -0
  50. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +5 -0
  51. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +5 -0
  52. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +5 -0
  53. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +5 -0
  54. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +5 -0
  55. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +5 -0
  56. data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +9 -0
  57. data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +9 -0
  58. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +5 -0
  59. data/spec/dummy/db/migrate/20120511072422_add_patron_identifier_to_patron.rb +6 -0
  60. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +5 -0
  61. data/spec/dummy/db/schema.rb +288 -43
  62. data/spec/dummy/db/test.sqlite3 +0 -0
  63. data/spec/dummy/solr/conf/admin-extra.html +31 -0
  64. data/spec/dummy/solr/conf/elevate.xml +36 -0
  65. data/spec/dummy/solr/conf/mapping-ISOLatin1Accent.txt +246 -0
  66. data/spec/dummy/solr/conf/protwords.txt +21 -0
  67. data/spec/dummy/solr/conf/schema.xml +250 -0
  68. data/spec/dummy/solr/conf/scripts.conf +24 -0
  69. data/spec/dummy/solr/conf/solrconfig.xml +934 -0
  70. data/spec/dummy/solr/conf/spellings.txt +2 -0
  71. data/spec/dummy/solr/conf/stopwords.txt +58 -0
  72. data/spec/dummy/solr/conf/synonyms.txt +31 -0
  73. data/spec/dummy/solr/data/test/index/_c.fdt +0 -0
  74. data/spec/dummy/solr/data/test/index/_c.fdx +0 -0
  75. data/spec/dummy/solr/data/test/index/_c.fnm +7 -0
  76. data/spec/dummy/solr/data/test/index/_c.frq +0 -0
  77. data/spec/dummy/solr/data/test/index/_c.nrm +1 -0
  78. data/spec/dummy/solr/data/test/index/_c.prx +0 -0
  79. data/spec/dummy/solr/data/test/index/_c.tii +0 -0
  80. data/spec/dummy/solr/data/test/index/_c.tis +0 -0
  81. data/spec/dummy/solr/data/test/index/_d.fdt +0 -0
  82. data/spec/dummy/solr/data/test/index/_d.fdx +0 -0
  83. data/spec/dummy/solr/data/test/index/_d.fnm +7 -0
  84. data/spec/dummy/solr/data/test/index/_d.frq +0 -0
  85. data/spec/dummy/solr/data/test/index/_d.nrm +1 -0
  86. data/spec/dummy/solr/data/test/index/_d.prx +0 -0
  87. data/spec/dummy/solr/data/test/index/_d.tii +0 -0
  88. data/spec/dummy/solr/data/test/index/_d.tis +0 -0
  89. data/spec/dummy/solr/data/test/index/_e.fdt +0 -0
  90. data/spec/dummy/solr/data/test/index/_e.fdx +0 -0
  91. data/spec/dummy/solr/data/test/index/_e.fnm +7 -0
  92. data/spec/dummy/solr/data/test/index/_e.frq +0 -0
  93. data/spec/dummy/solr/data/test/index/_e.nrm +1 -0
  94. data/spec/dummy/solr/data/test/index/_e.prx +0 -0
  95. data/spec/dummy/solr/data/test/index/_e.tii +0 -0
  96. data/spec/dummy/solr/data/test/index/_e.tis +0 -0
  97. data/spec/dummy/solr/data/test/index/segments.gen +0 -0
  98. data/spec/dummy/solr/data/test/index/segments_1p +0 -0
  99. data/spec/dummy/solr/data/test/spellchecker/segments.gen +0 -0
  100. data/spec/dummy/solr/data/test/spellchecker/segments_1 +0 -0
  101. data/spec/factories/user.rb +6 -3
  102. data/spec/fixtures/bookstores.yml +107 -0
  103. data/spec/fixtures/budget_types.yml +29 -0
  104. data/spec/fixtures/content_types.yml +36 -0
  105. data/spec/fixtures/countries.yml +2059 -0
  106. data/spec/fixtures/create_types.yml +47 -0
  107. data/spec/fixtures/creates.yml +2 -3
  108. data/spec/fixtures/donates.yml +31 -0
  109. data/spec/fixtures/exemplifies.yml +8 -3
  110. data/spec/fixtures/extents.yml +29 -0
  111. data/spec/fixtures/form_of_works.yml +39 -0
  112. data/spec/fixtures/frequencies.yml +85 -0
  113. data/spec/fixtures/import_requests.yml +27 -0
  114. data/spec/fixtures/items.yml +0 -5
  115. data/spec/fixtures/languages.yml +1901 -0
  116. data/spec/fixtures/libraries.yml +25 -32
  117. data/spec/fixtures/library_groups.yml +2 -5
  118. data/spec/fixtures/licenses.yml +29 -0
  119. data/spec/fixtures/manifestation_relationship_types.yml +29 -0
  120. data/spec/fixtures/manifestation_relationships.yml +30 -0
  121. data/spec/fixtures/manifestations.yml +9 -13
  122. data/spec/fixtures/medium_of_performances.yml +29 -0
  123. data/spec/fixtures/owns.yml +26 -0
  124. data/spec/fixtures/patron_import_files.yml +47 -0
  125. data/spec/fixtures/patron_import_results.yml +29 -0
  126. data/spec/fixtures/patron_relationship_types.yml +34 -0
  127. data/spec/fixtures/patron_relationships.yml +25 -0
  128. data/spec/fixtures/patron_types.yml +0 -6
  129. data/spec/fixtures/patrons.yml +3 -3
  130. data/spec/fixtures/picture_files.yml +63 -0
  131. data/spec/fixtures/produce_types.yml +31 -0
  132. data/spec/fixtures/produces.yml +2 -3
  133. data/spec/fixtures/realize_types.yml +39 -0
  134. data/spec/fixtures/realizes.yml +2 -3
  135. data/spec/fixtures/request_status_types.yml +63 -0
  136. data/spec/fixtures/request_types.yml +55 -0
  137. data/spec/fixtures/resource_import_files.yml +47 -0
  138. data/spec/fixtures/resource_import_results.yml +29 -0
  139. data/spec/fixtures/series_has_manifestations.yml +35 -0
  140. data/spec/fixtures/series_statements.yml +45 -0
  141. data/spec/fixtures/shelves.yml +47 -0
  142. data/spec/fixtures/user_groups.yml +51 -0
  143. data/spec/spec_helper.rb +13 -0
  144. metadata +244 -116
  145. data/spec/dummy/app/models/carrier_type.rb +0 -33
  146. data/spec/dummy/app/models/create.rb +0 -38
  147. data/spec/dummy/app/models/exemplify.rb +0 -45
  148. data/spec/dummy/app/models/item.rb +0 -276
  149. data/spec/dummy/app/models/manifestation.rb +0 -631
  150. data/spec/dummy/app/models/patron.rb +0 -290
  151. data/spec/dummy/app/models/produce.rb +0 -39
  152. data/spec/dummy/app/models/realize.rb +0 -38
  153. data/spec/dummy/app/models/search_engine.rb +0 -51
  154. data/spec/dummy/db/migrate/20101228081401_rename_postal_code_to_zip_code.rb +0 -11
  155. data/spec/dummy/lib/enju_leaf/calculate_stat.rb +0 -30
  156. data/spec/dummy/lib/enju_leaf/expire_editable_fragment.rb +0 -30
  157. data/spec/dummy/lib/enju_leaf/expire_fragment_cache.rb +0 -17
  158. data/spec/dummy/lib/enju_leaf/import_file.rb +0 -13
  159. data/spec/dummy/lib/enju_leaf/localized_name.rb +0 -13
  160. data/spec/dummy/lib/enju_leaf/master_model.rb +0 -19
  161. data/spec/dummy/lib/enju_leaf/url_validator.rb +0 -10
@@ -1,11 +1,4 @@
1
- require 'devise'
2
- require 'cancan'
3
- require 'sunspot_rails'
4
- require 'acts_as_list'
5
- require 'attribute_normalizer'
6
- require 'friendly_id'
7
- require 'configatron'
8
- require 'will_paginate'
1
+ require 'enju_core'
9
2
  require 'mobile-fu'
10
3
 
11
4
  module EnjuOai
@@ -1,3 +1,3 @@
1
1
  module EnjuOai
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
@@ -8,6 +8,10 @@ describe ManifestationsController do
8
8
  end
9
9
 
10
10
  describe "GET index", :solr => true do
11
+ before do
12
+ Manifestation.reindex
13
+ end
14
+
11
15
  describe "When not logged in" do
12
16
  it "assigns all manifestations as @manifestations in oai format without verb" do
13
17
  get :index, :format => 'oai'
@@ -11,7 +11,7 @@ class ApplicationController < ActionController::Base
11
11
  def set_role_query(user, search)
12
12
  role = user.try(:role) || Role.default_role
13
13
  search.build do
14
- with(:required_role_id).less_than role.id
14
+ with(:required_role_id).less_than_or_equal_to role.id
15
15
  end
16
16
  end
17
17
 
@@ -54,4 +54,6 @@ module Dummy
54
54
  end
55
55
  end
56
56
 
57
- require 'enju_leaf'
57
+ require 'enju_biblio'
58
+ require 'enju_library'
59
+ require 'enju_manifestation_viewer'
@@ -92,10 +92,6 @@ Devise.setup do |config|
92
92
  # If true, extends the user's remember period when remembered via cookie.
93
93
  # config.extend_remember_period = false
94
94
 
95
- # If true, uses the password salt as remember token. This should be turned
96
- # to false if you are not using database authenticatable.
97
- config.use_salt_as_remember_token = true
98
-
99
95
  # Options to be passed to the created cookie. For instance, you can set
100
96
  # :secure => true in order to force SSL only cookies.
101
97
  # config.cookie_options = {}
@@ -1,6 +1,8 @@
1
1
  Dummy::Application.routes.draw do
2
2
  devise_for :users
3
3
 
4
+ resources :manifestations
5
+
4
6
  # The priority is based upon order of creation:
5
7
  # first created -> highest priority.
6
8
 
@@ -27,7 +27,6 @@ class CreatePatrons < ActiveRecord::Migration
27
27
  t.string :fax_number_2
28
28
  t.text :other_designation
29
29
  t.text :place
30
- t.string :postal_code
31
30
  t.text :street
32
31
  t.text :locality
33
32
  t.text :region
@@ -27,9 +27,6 @@ class CreateManifestations < ActiveRecord::Migration
27
27
  t.string :oclc_number
28
28
  t.string :issn
29
29
  t.integer :price # TODO: 通貨単位
30
- #t.text :filename
31
- #t.string :content_type
32
- #t.integer :size
33
30
  t.text :fulltext
34
31
  t.string :volume_number_list
35
32
  t.string :issue_number_list
@@ -4,11 +4,9 @@ class CreateOwns < ActiveRecord::Migration
4
4
  t.references :patron, :null => false
5
5
  t.references :item, :null => false
6
6
  t.integer :position
7
- t.string :type
8
7
  t.timestamps
9
8
  end
10
9
  add_index :owns, :patron_id
11
10
  add_index :owns, :item_id
12
- add_index :owns, :type
13
11
  end
14
12
  end
@@ -4,11 +4,9 @@ class CreateCreates < ActiveRecord::Migration
4
4
  t.references :patron, :null => false
5
5
  t.references :work, :null => false
6
6
  t.integer :position
7
- t.string :type
8
7
  t.timestamps
9
8
  end
10
9
  add_index :creates, :patron_id
11
10
  add_index :creates, :work_id
12
- add_index :creates, :type
13
11
  end
14
12
  end
@@ -4,11 +4,9 @@ class CreateProduces < ActiveRecord::Migration
4
4
  t.references :patron, :null => false
5
5
  t.references :manifestation, :null => false
6
6
  t.integer :position
7
- t.string :type
8
7
  t.timestamps
9
8
  end
10
9
  add_index :produces, :patron_id
11
10
  add_index :produces, :manifestation_id
12
- add_index :produces, :type
13
11
  end
14
12
  end
@@ -1,11 +1,10 @@
1
1
  class CreateLibraries < ActiveRecord::Migration
2
2
  def change
3
3
  create_table :libraries do |t|
4
- t.references :patron, :polymorphic => true
5
4
  t.string :name, :null => false
6
5
  t.text :display_name
7
6
  t.string :short_display_name, :null => false
8
- t.string :postal_code
7
+ t.string :zip_code
9
8
  t.text :street
10
9
  t.text :locality
11
10
  t.text :region
@@ -23,7 +22,6 @@ class CreateLibraries < ActiveRecord::Migration
23
22
  t.timestamps
24
23
  t.datetime :deleted_at
25
24
  end
26
- add_index :libraries, :patron_id, :unique => true
27
25
  add_index :libraries, :library_group_id
28
26
  add_index :libraries, :name, :unique => true
29
27
  end
@@ -0,0 +1,15 @@
1
+ class CreateShelves < ActiveRecord::Migration
2
+ def change
3
+ create_table :shelves do |t|
4
+ t.string :name, :null => false
5
+ t.text :display_name
6
+ t.text :note
7
+ t.integer :library_id, :default => 1, :null => false
8
+ t.integer :items_count, :default => 0, :null => false
9
+ t.integer :position
10
+ t.timestamps
11
+ t.datetime :deleted_at
12
+ end
13
+ add_index :shelves, :library_id
14
+ end
15
+ end
@@ -11,7 +11,6 @@ class CreateLibraryGroups < ActiveRecord::Migration
11
11
  t.text :login_banner
12
12
  t.text :note
13
13
  t.integer :valid_period_for_new_user, :default => 365, :null => false
14
- t.boolean :post_to_union_catalog, :default => false, :null => false
15
14
  t.integer :country_id
16
15
 
17
16
  t.timestamps
@@ -0,0 +1,17 @@
1
+ class CreateBookstores < ActiveRecord::Migration
2
+ def change
3
+ create_table :bookstores do |t|
4
+ t.text :name, :null => false
5
+ t.string :zip_code
6
+ t.text :address
7
+ t.text :note
8
+ t.string :telephone_number
9
+ t.string :fax_number
10
+ t.string :url
11
+ t.integer :position
12
+ t.datetime :deleted_at
13
+
14
+ t.timestamps
15
+ end
16
+ end
17
+ 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,12 @@
1
+ class CreateRequestStatusTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :request_status_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,12 @@
1
+ class CreateRequestTypes < ActiveRecord::Migration
2
+ def change
3
+ create_table :request_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
@@ -4,12 +4,10 @@ class CreateRealizes < ActiveRecord::Migration
4
4
  t.references :patron, :null => false
5
5
  t.references :expression, :null => false
6
6
  t.integer :position
7
- t.string :type
8
7
 
9
8
  t.timestamps
10
9
  end
11
10
  add_index :realizes, :patron_id
12
11
  add_index :realizes, :expression_id
13
- add_index :realizes, :type
14
12
  end
15
13
  end
@@ -3,13 +3,11 @@ class CreateExemplifies < ActiveRecord::Migration
3
3
  create_table :exemplifies do |t|
4
4
  t.integer :manifestation_id, :null => false
5
5
  t.integer :item_id, :null => false
6
- t.string :type
7
6
  t.integer :position
8
7
 
9
8
  t.timestamps
10
9
  end
11
10
  add_index :exemplifies, :manifestation_id
12
11
  add_index :exemplifies, :item_id, :unique => true
13
- add_index :exemplifies, :type
14
12
  end
15
13
  end
@@ -0,0 +1,17 @@
1
+ class CreateSubscriptions < ActiveRecord::Migration
2
+ def change
3
+ create_table :subscriptions do |t|
4
+ t.text :title, :null => false
5
+ t.text :note
6
+ #t.integer :subscription_list_id, :integer
7
+ t.integer :user_id
8
+ t.integer :order_list_id
9
+ t.datetime :deleted_at
10
+ t.integer :subscribes_count, :default => 0, :null => false
11
+
12
+ t.timestamps
13
+ end
14
+ add_index :subscriptions, :user_id
15
+ add_index :subscriptions, :order_list_id
16
+ end
17
+ end
@@ -0,0 +1,14 @@
1
+ class CreateSubscribes < ActiveRecord::Migration
2
+ def change
3
+ create_table :subscribes do |t|
4
+ t.integer :subscription_id, :null => false
5
+ t.integer :work_id, :null => false
6
+ t.datetime :start_at, :null => false
7
+ t.datetime :end_at, :null => false
8
+
9
+ t.timestamps
10
+ end
11
+ add_index :subscribes, :subscription_id
12
+ add_index :subscribes, :work_id
13
+ end
14
+ end
@@ -0,0 +1,15 @@
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.string :thumbnail
9
+ t.integer :position
10
+
11
+ t.timestamps
12
+ end
13
+ add_index :picture_files, [:picture_attachable_id, :picture_attachable_type], :name => "index_picture_files_on_picture_attachable_id_and_type"
14
+ end
15
+ end
@@ -0,0 +1,22 @@
1
+ class CreatePatronImportFiles < ActiveRecord::Migration
2
+ def change
3
+ create_table :patron_import_files do |t|
4
+ t.integer :parent_id
5
+ t.string :content_type
6
+ t.integer :size
7
+ t.integer :user_id
8
+ t.text :note
9
+ t.datetime :imported_at
10
+ t.string :state
11
+ t.string :patron_import_file_name
12
+ t.string :patron_import_content_type
13
+ t.integer :patron_import_file_size
14
+ t.datetime :patron_import_updated_at
15
+
16
+ t.timestamps
17
+ end
18
+ add_index :patron_import_files, :parent_id
19
+ add_index :patron_import_files, :user_id
20
+ add_index :patron_import_files, :state
21
+ end
22
+ end
@@ -0,0 +1,22 @@
1
+ class CreateResourceImportFiles < ActiveRecord::Migration
2
+ def change
3
+ create_table :resource_import_files do |t|
4
+ t.integer :parent_id
5
+ t.string :content_type
6
+ t.integer :size
7
+ t.integer :user_id
8
+ t.text :note
9
+ t.datetime :imported_at
10
+ t.string :state
11
+ t.string :resource_import_file_name
12
+ t.string :resource_import_content_type
13
+ t.integer :resource_import_file_size
14
+ t.datetime :resource_import_updated_at
15
+
16
+ t.timestamps
17
+ end
18
+ add_index :resource_import_files, :parent_id
19
+ add_index :resource_import_files, :user_id
20
+ add_index :resource_import_files, :state
21
+ end
22
+ 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,15 @@
1
+ class AddAttachmentsAttachmentToManifestation < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestations, :attachment_file_name, :string
4
+ add_column :manifestations, :attachment_content_type, :string
5
+ add_column :manifestations, :attachment_file_size, :integer
6
+ add_column :manifestations, :attachment_updated_at, :datetime
7
+ end
8
+
9
+ def self.down
10
+ remove_column :manifestations, :attachment_file_name
11
+ remove_column :manifestations, :attachment_content_type
12
+ remove_column :manifestations, :attachment_file_size
13
+ remove_column :manifestations, :attachment_updated_at
14
+ end
15
+ 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,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,15 @@
1
+ class CreateImportRequests < ActiveRecord::Migration
2
+ def change
3
+ create_table :import_requests do |t|
4
+ t.string :isbn
5
+ t.string :state
6
+ t.integer :manifestation_id
7
+ t.integer :user_id
8
+
9
+ t.timestamps
10
+ end
11
+ add_index :import_requests, :isbn
12
+ add_index :import_requests, :manifestation_id
13
+ add_index :import_requests, :user_id
14
+ end
15
+ 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,15 @@
1
+ class CreateResourceImportResults < ActiveRecord::Migration
2
+ def change
3
+ create_table :resource_import_results do |t|
4
+ t.integer :resource_import_file_id
5
+ t.integer :manifestation_id
6
+ t.integer :item_id
7
+ t.text :body
8
+
9
+ t.timestamps
10
+ end
11
+ add_index :resource_import_results, :resource_import_file_id
12
+ add_index :resource_import_results, :manifestation_id
13
+ add_index :resource_import_results, :item_id
14
+ end
15
+ end
@@ -0,0 +1,12 @@
1
+ class CreatePatronImportResults < ActiveRecord::Migration
2
+ def change
3
+ create_table :patron_import_results do |t|
4
+ t.integer :patron_import_file_id
5
+ t.integer :patron_id
6
+ t.integer :user_id
7
+ t.text :body
8
+
9
+ t.timestamps
10
+ end
11
+ end
12
+ 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 AddEditModeToResourceImportFile < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :resource_import_files, :edit_mode, :string
4
+ end
5
+
6
+ def self.down
7
+ remove_column :resource_import_files, :edit_mode
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,11 @@
1
+ class AddBookstoreIdToItem < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :items, :bookstore_id, :integer
4
+ add_index :items, :bookstore_id
5
+ end
6
+
7
+ def self.down
8
+ remove_index :items, :bookstore_id
9
+ remove_column :items, :bookstore_id
10
+ end
11
+ 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,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,9 @@
1
+ class AddNdcToManifestation < ActiveRecord::Migration
2
+ def self.up
3
+ add_column :manifestations, :ndc, :string
4
+ end
5
+
6
+ def self.down
7
+ remove_column :manifestations, :ndc
8
+ end
9
+ 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