enju_oai 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/app/views/manifestations/list_identifiers.oai.builder +1 -1
- data/app/views/manifestations/list_records.oai.builder +1 -1
- data/lib/enju_oai/oai_controller.rb +32 -0
- data/lib/enju_oai/version.rb +1 -1
- data/spec/controllers/manifestations_controller_spec.rb +45 -0
- data/spec/dummy/README.rdoc +261 -0
- data/spec/dummy/Rakefile +7 -0
- data/spec/dummy/app/assets/javascripts/application.js +15 -0
- data/spec/dummy/app/assets/stylesheets/application.css +13 -0
- data/spec/dummy/app/controllers/application_controller.rb +76 -0
- data/spec/dummy/app/controllers/manifestations_controller.rb +519 -0
- data/spec/dummy/app/helpers/application_helper.rb +2 -0
- data/spec/dummy/app/models/ability.rb +29 -0
- data/spec/dummy/app/models/carrier_type.rb +33 -0
- data/spec/dummy/app/models/create.rb +38 -0
- data/spec/dummy/app/models/exemplify.rb +45 -0
- data/spec/dummy/app/models/item.rb +276 -0
- data/spec/dummy/app/models/manifestation.rb +631 -0
- data/spec/dummy/app/models/patron.rb +290 -0
- data/spec/dummy/app/models/produce.rb +39 -0
- data/spec/dummy/app/models/realize.rb +38 -0
- data/spec/dummy/app/models/role.rb +46 -0
- data/spec/dummy/app/models/search_engine.rb +51 -0
- data/spec/dummy/app/models/user.rb +94 -0
- data/spec/dummy/app/models/user_has_role.rb +4 -0
- data/spec/dummy/app/views/layouts/application.html.erb +14 -0
- data/spec/dummy/config/application.rb +57 -0
- data/spec/dummy/config/boot.rb +10 -0
- data/spec/dummy/config/configatron/cucumber.rb +4 -0
- data/spec/dummy/config/configatron/defaults.rb +28 -0
- data/spec/dummy/config/configatron/development.rb +4 -0
- data/spec/dummy/config/configatron/production.rb.sample +12 -0
- data/spec/dummy/config/configatron/test.rb +7 -0
- data/spec/dummy/config/database.yml +25 -0
- data/spec/dummy/config/environment.rb +5 -0
- data/spec/dummy/config/environments/development.rb +37 -0
- data/spec/dummy/config/environments/production.rb +67 -0
- data/spec/dummy/config/environments/test.rb +37 -0
- data/spec/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/dummy/config/initializers/configatron.rb +2 -0
- data/spec/dummy/config/initializers/devise.rb +209 -0
- data/spec/dummy/config/initializers/inflections.rb +15 -0
- data/spec/dummy/config/initializers/mime_types.rb +14 -0
- data/spec/dummy/config/initializers/secret_token.rb +7 -0
- data/spec/dummy/config/initializers/session_store.rb +8 -0
- data/spec/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/spec/dummy/config/locales/en.yml +5 -0
- data/spec/dummy/config/routes.rb +60 -0
- data/spec/dummy/config.ru +4 -0
- data/spec/dummy/db/migrate/001_create_patrons.rb +53 -0
- data/spec/dummy/db/migrate/002_devise_create_users.rb +71 -0
- data/spec/dummy/db/migrate/005_create_manifestations.rb +59 -0
- data/spec/dummy/db/migrate/006_create_items.rb +28 -0
- data/spec/dummy/db/migrate/012_create_owns.rb +14 -0
- data/spec/dummy/db/migrate/015_create_creates.rb +14 -0
- data/spec/dummy/db/migrate/041_create_roles.rb +13 -0
- data/spec/dummy/db/migrate/047_create_produces.rb +14 -0
- data/spec/dummy/db/migrate/059_create_libraries.rb +30 -0
- data/spec/dummy/db/migrate/073_create_carrier_types.rb +11 -0
- data/spec/dummy/db/migrate/077_create_user_groups.rb +12 -0
- data/spec/dummy/db/migrate/080_create_library_groups.rb +21 -0
- data/spec/dummy/db/migrate/112_create_frequencies.rb +12 -0
- data/spec/dummy/db/migrate/117_create_form_of_works.rb +12 -0
- data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +15 -0
- data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +15 -0
- data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +12 -0
- data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +17 -0
- data/spec/dummy/db/migrate/20081025083323_create_countries.rb +28 -0
- data/spec/dummy/db/migrate/20081025083905_create_languages.rb +23 -0
- data/spec/dummy/db/migrate/20090719201843_create_extents.rb +12 -0
- data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +12 -0
- data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +12 -0
- data/spec/dummy/db/migrate/20090812151902_create_patron_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +12 -0
- data/spec/dummy/db/migrate/20091202124834_create_versions.rb +18 -0
- data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20100326024214_add_date_index_to_resource.rb +11 -0
- data/spec/dummy/db/migrate/20100502171926_add_latitude_and_longitude_to_library.rb +11 -0
- data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100606065209_create_user_has_roles.rb +12 -0
- data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +13 -0
- data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
- data/spec/dummy/db/migrate/20100627193848_add_enju_access_key_to_user.rb +10 -0
- data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +11 -0
- data/spec/dummy/db/migrate/20100919121500_drop_user_email_unique_index.rb +11 -0
- data/spec/dummy/db/migrate/20101103090330_add_title_to_patron.rb +9 -0
- data/spec/dummy/db/migrate/20101103090457_rename_manifestation_identifier_to_identifier.rb +9 -0
- data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
- data/spec/dummy/db/migrate/20101228081401_rename_postal_code_to_zip_code.rb +11 -0
- data/spec/dummy/db/migrate/20110115022329_add_position_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +9 -0
- data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +11 -0
- data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +13 -0
- data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +9 -0
- data/spec/dummy/db/migrate/20110627122938_add_number_of_day_to_notify_overdue_to_user_group.rb +13 -0
- data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +13 -0
- data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +13 -0
- data/spec/dummy/db/migrate/20110927135845_add_missing_since_to_item.rb +9 -0
- data/spec/dummy/db/migrate/20111103221239_rename_manifestation_identifier_to_manifestation_identifier.rb +9 -0
- data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
- data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
- data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +5 -0
- data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +6 -0
- data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120413225628_add_fingerprint_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +5 -0
- data/spec/dummy/db/migrate/20120426034355_add_unique_index_to_item_identifier.rb +11 -0
- data/spec/dummy/db/migrate/20120426042730_add_unique_index_to_manifestation_identifier.rb +11 -0
- data/spec/dummy/db/schema.rb +564 -0
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/lib/enju_leaf/calculate_stat.rb +30 -0
- data/spec/dummy/lib/enju_leaf/expire_editable_fragment.rb +30 -0
- data/spec/dummy/lib/enju_leaf/expire_fragment_cache.rb +17 -0
- data/spec/dummy/lib/enju_leaf/import_file.rb +13 -0
- data/spec/dummy/lib/enju_leaf/localized_name.rb +13 -0
- data/spec/dummy/lib/enju_leaf/master_model.rb +19 -0
- data/spec/dummy/lib/enju_leaf/url_validator.rb +10 -0
- data/spec/dummy/lib/enju_leaf.rb +8 -0
- data/spec/dummy/public/404.html +26 -0
- data/spec/dummy/public/422.html +26 -0
- data/spec/dummy/public/500.html +25 -0
- data/spec/dummy/public/favicon.ico +0 -0
- data/spec/dummy/script/rails +6 -0
- data/spec/dummy/tmp/cache/4F7/F90/default_role +0 -0
- data/spec/dummy/tmp/cache/6E4/420/search_engine_all +0 -0
- data/spec/factories/manifestation.rb +6 -0
- data/spec/factories/user.rb +34 -0
- data/spec/fixtures/carrier_types.yml +51 -0
- data/spec/fixtures/creates.yml +66 -0
- data/spec/fixtures/exemplifies.yml +156 -0
- data/spec/fixtures/items.yml +262 -0
- data/spec/fixtures/libraries.yml +109 -0
- data/spec/fixtures/library_groups.yml +36 -0
- data/spec/fixtures/manifestations.yml +2024 -0
- data/spec/fixtures/patron_types.yml +41 -0
- data/spec/fixtures/patrons.yml +338 -0
- data/spec/fixtures/produces.yml +150 -0
- data/spec/fixtures/realizes.yml +87 -0
- data/spec/fixtures/roles.yml +21 -0
- data/spec/fixtures/user_has_roles.yml +41 -0
- data/spec/fixtures/users.yml +93 -0
- data/spec/spec_helper.rb +38 -0
- data/spec/support/controller_macros.rb +48 -0
- data/spec/support/devise.rb +4 -0
- metadata +290 -6
- data/test/enju_oai_test.rb +0 -7
- data/test/test_helper.rb +0 -15
@@ -0,0 +1,71 @@
|
|
1
|
+
class DeviseCreateUsers < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_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
|
+
## Encryptable
|
23
|
+
t.string :password_salt
|
24
|
+
|
25
|
+
## Confirmable
|
26
|
+
t.string :confirmation_token
|
27
|
+
t.datetime :confirmed_at
|
28
|
+
t.datetime :confirmation_sent_at
|
29
|
+
t.string :unconfirmed_email # Only if using reconfirmable
|
30
|
+
|
31
|
+
## Lockable
|
32
|
+
t.integer :failed_attempts, :default => 0 # Only if lock strategy is :failed_attempts
|
33
|
+
t.string :unlock_token # Only if unlock strategy is :email or :both
|
34
|
+
t.datetime :locked_at
|
35
|
+
|
36
|
+
# Token authenticatable
|
37
|
+
t.string :authentication_token
|
38
|
+
|
39
|
+
|
40
|
+
t.timestamps
|
41
|
+
|
42
|
+
t.datetime :deleted_at
|
43
|
+
|
44
|
+
t.string :username, :null => false
|
45
|
+
t.integer :library_id, :default => 1, :null => false
|
46
|
+
t.integer :user_group_id, :default => 1, :null => false
|
47
|
+
t.datetime :expired_at
|
48
|
+
t.integer :required_role_id, :default => 1, :null => false
|
49
|
+
t.text :note
|
50
|
+
t.text :keyword_list
|
51
|
+
t.string :user_number
|
52
|
+
t.string :state
|
53
|
+
#t.integer :required_score, :default => 0, :null => false
|
54
|
+
t.string :locale
|
55
|
+
|
56
|
+
#t.integer :bookmarks_count, :default => 0, :null => false
|
57
|
+
#t.boolean :share_bookmarks, :default => false, :null => false
|
58
|
+
#t.boolean :save_search_history, :default => false, :null => false
|
59
|
+
end
|
60
|
+
add_index :users, :email, :unique => true
|
61
|
+
add_index :users, :reset_password_token, :unique => true
|
62
|
+
add_index :users, :confirmation_token, :unique => true
|
63
|
+
add_index :users, :unlock_token, :unique => true
|
64
|
+
add_index :users, :authentication_token, :unique => true
|
65
|
+
add_index :users, :username, :unique => true
|
66
|
+
add_index :users, :user_group_id
|
67
|
+
add_index :users, :required_role_id
|
68
|
+
add_index :users, :user_number, :unique => true
|
69
|
+
end
|
70
|
+
|
71
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
class CreateManifestations < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :manifestations do |t|
|
4
|
+
t.text :original_title, :null => false
|
5
|
+
t.text :title_alternative
|
6
|
+
t.text :title_transcription
|
7
|
+
t.string :classification_number
|
8
|
+
t.string :manifestation_identifier
|
9
|
+
t.datetime :date_of_publication
|
10
|
+
t.datetime :copyright_date
|
11
|
+
t.timestamps
|
12
|
+
t.datetime :deleted_at
|
13
|
+
t.string :access_address
|
14
|
+
t.integer :language_id, :default => 1, :null => false
|
15
|
+
t.integer :carrier_type_id, :default => 1, :null => false
|
16
|
+
t.integer :extent_id, :default => 1, :null => false
|
17
|
+
t.integer :start_page
|
18
|
+
t.integer :end_page
|
19
|
+
t.integer :height
|
20
|
+
t.integer :width
|
21
|
+
t.integer :depth
|
22
|
+
t.string :isbn
|
23
|
+
t.string :isbn10
|
24
|
+
t.string :wrong_isbn
|
25
|
+
t.string :nbn
|
26
|
+
t.string :lccn
|
27
|
+
t.string :oclc_number
|
28
|
+
t.string :issn
|
29
|
+
t.integer :price # TODO: 通貨単位
|
30
|
+
#t.text :filename
|
31
|
+
#t.string :content_type
|
32
|
+
#t.integer :size
|
33
|
+
t.text :fulltext
|
34
|
+
t.string :volume_number_list
|
35
|
+
t.string :issue_number_list
|
36
|
+
t.string :serial_number_list
|
37
|
+
t.integer :edition
|
38
|
+
t.text :note
|
39
|
+
t.boolean :repository_content, :default => false, :null => false
|
40
|
+
t.integer :lock_version, :default => 0, :null => false
|
41
|
+
t.integer :required_role_id, :default => 1, :null => false
|
42
|
+
t.string :state
|
43
|
+
t.integer :required_score, :default => 0, :null => false
|
44
|
+
t.integer :frequency_id, :default => 1, :null => false
|
45
|
+
t.boolean :subscription_master, :default => false, :null => false
|
46
|
+
end
|
47
|
+
add_index :manifestations, :carrier_type_id
|
48
|
+
add_index :manifestations, :required_role_id
|
49
|
+
add_index :manifestations, :isbn
|
50
|
+
add_index :manifestations, :nbn
|
51
|
+
add_index :manifestations, :lccn
|
52
|
+
add_index :manifestations, :oclc_number
|
53
|
+
add_index :manifestations, :issn
|
54
|
+
add_index :manifestations, :access_address
|
55
|
+
add_index :manifestations, :frequency_id
|
56
|
+
add_index :manifestations, :manifestation_identifier
|
57
|
+
add_index :manifestations, :updated_at
|
58
|
+
end
|
59
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
class CreateItems < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :items do |t|
|
4
|
+
#t.integer :manifestation_id
|
5
|
+
t.string :call_number
|
6
|
+
t.string :item_identifier
|
7
|
+
t.integer :circulation_status_id, :default => 5, :null => false
|
8
|
+
t.integer :checkout_type_id, :default => 1, :null => false
|
9
|
+
t.timestamps
|
10
|
+
t.datetime :deleted_at
|
11
|
+
t.integer :shelf_id, :default => 1, :null => false
|
12
|
+
t.boolean :include_supplements, :default => false, :null => false
|
13
|
+
t.text :note
|
14
|
+
t.string :url
|
15
|
+
t.integer :price
|
16
|
+
t.integer :lock_version, :default => 0, :null => false
|
17
|
+
t.integer :required_role_id, :default => 1, :null => false
|
18
|
+
t.string :state
|
19
|
+
t.integer :required_score, :default => 0, :null => false
|
20
|
+
end
|
21
|
+
#add_index :items, :manifestation_id
|
22
|
+
add_index :items, :circulation_status_id
|
23
|
+
add_index :items, :checkout_type_id
|
24
|
+
add_index :items, :shelf_id
|
25
|
+
add_index :items, :item_identifier
|
26
|
+
add_index :items, :required_role_id
|
27
|
+
end
|
28
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateOwns < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :owns do |t|
|
4
|
+
t.references :patron, :null => false
|
5
|
+
t.references :item, :null => false
|
6
|
+
t.integer :position
|
7
|
+
t.string :type
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
add_index :owns, :patron_id
|
11
|
+
add_index :owns, :item_id
|
12
|
+
add_index :owns, :type
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateCreates < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :creates do |t|
|
4
|
+
t.references :patron, :null => false
|
5
|
+
t.references :work, :null => false
|
6
|
+
t.integer :position
|
7
|
+
t.string :type
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
add_index :creates, :patron_id
|
11
|
+
add_index :creates, :work_id
|
12
|
+
add_index :creates, :type
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
class CreateRoles < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table "roles" do |t|
|
4
|
+
t.column :name, :string, :null => false
|
5
|
+
t.column :display_name, :string
|
6
|
+
t.column :note, :text
|
7
|
+
t.column :created_at, :datetime
|
8
|
+
t.column :updated_at, :datetime
|
9
|
+
t.integer :score, :default => 0, :null => false
|
10
|
+
t.integer :position
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,14 @@
|
|
1
|
+
class CreateProduces < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :produces do |t|
|
4
|
+
t.references :patron, :null => false
|
5
|
+
t.references :manifestation, :null => false
|
6
|
+
t.integer :position
|
7
|
+
t.string :type
|
8
|
+
t.timestamps
|
9
|
+
end
|
10
|
+
add_index :produces, :patron_id
|
11
|
+
add_index :produces, :manifestation_id
|
12
|
+
add_index :produces, :type
|
13
|
+
end
|
14
|
+
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
class CreateLibraries < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :libraries do |t|
|
4
|
+
t.references :patron, :polymorphic => true
|
5
|
+
t.string :name, :null => false
|
6
|
+
t.text :display_name
|
7
|
+
t.string :short_display_name, :null => false
|
8
|
+
t.string :postal_code
|
9
|
+
t.text :street
|
10
|
+
t.text :locality
|
11
|
+
t.text :region
|
12
|
+
t.string :telephone_number_1
|
13
|
+
t.string :telephone_number_2
|
14
|
+
t.string :fax_number
|
15
|
+
t.text :note
|
16
|
+
t.integer :call_number_rows, :default => 1, :null => false
|
17
|
+
t.string :call_number_delimiter, :default => "|", :null => false
|
18
|
+
t.integer :library_group_id, :default => 1, :null => false
|
19
|
+
t.integer :users_count, :default => 0, :null => false
|
20
|
+
t.integer :position
|
21
|
+
t.integer :country_id
|
22
|
+
|
23
|
+
t.timestamps
|
24
|
+
t.datetime :deleted_at
|
25
|
+
end
|
26
|
+
add_index :libraries, :patron_id, :unique => true
|
27
|
+
add_index :libraries, :library_group_id
|
28
|
+
add_index :libraries, :name, :unique => true
|
29
|
+
end
|
30
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
class CreateLibraryGroups < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :library_groups do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.string :short_name, :null => false
|
7
|
+
t.string :email
|
8
|
+
t.text :my_networks
|
9
|
+
t.boolean :use_dsbl, :default => false, :null => false
|
10
|
+
t.text :dsbl_list
|
11
|
+
t.text :login_banner
|
12
|
+
t.text :note
|
13
|
+
t.integer :valid_period_for_new_user, :default => 365, :null => false
|
14
|
+
t.boolean :post_to_union_catalog, :default => false, :null => false
|
15
|
+
t.integer :country_id
|
16
|
+
|
17
|
+
t.timestamps
|
18
|
+
end
|
19
|
+
add_index :library_groups, :short_name
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,15 @@
|
|
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
|
+
t.string :type
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :realizes, :patron_id
|
12
|
+
add_index :realizes, :expression_id
|
13
|
+
add_index :realizes, :type
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,15 @@
|
|
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.string :type
|
7
|
+
t.integer :position
|
8
|
+
|
9
|
+
t.timestamps
|
10
|
+
end
|
11
|
+
add_index :exemplifies, :manifestation_id
|
12
|
+
add_index :exemplifies, :item_id, :unique => true
|
13
|
+
add_index :exemplifies, :type
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
class CreateSearchEngines < ActiveRecord::Migration
|
2
|
+
def change
|
3
|
+
create_table :search_engines do |t|
|
4
|
+
t.string :name, :null => false
|
5
|
+
t.text :display_name
|
6
|
+
t.string :url, :null => false
|
7
|
+
t.text :base_url, :null => false
|
8
|
+
t.text :http_method, :null => false
|
9
|
+
t.text :query_param, :null => false
|
10
|
+
t.text :additional_param
|
11
|
+
t.text :note
|
12
|
+
t.integer :position
|
13
|
+
|
14
|
+
t.timestamps
|
15
|
+
end
|
16
|
+
end
|
17
|
+
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,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,11 @@
|
|
1
|
+
class AddDateIndexToResource < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_index :manifestations, :created_at
|
4
|
+
add_index :manifestations, :deleted_at
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_index :manifestations, :created_at
|
9
|
+
remove_index :manifestations, :deleted_at
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,11 @@
|
|
1
|
+
class AddLatitudeAndLongitudeToLibrary < ActiveRecord::Migration
|
2
|
+
def self.up
|
3
|
+
add_column :libraries, :latitude, :float
|
4
|
+
add_column :libraries, :longitude, :float
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.down
|
8
|
+
remove_column :libraries, :longitude
|
9
|
+
remove_column :libraries, :latitude
|
10
|
+
end
|
11
|
+
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,12 @@
|
|
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
|
+
add_index :user_has_roles, :user_id
|
10
|
+
add_index :user_has_roles, :role_id
|
11
|
+
end
|
12
|
+
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
|