enju_nii 0.0.4 → 0.1.0.pre

Sign up to get free protection for your applications and to get access to all the features.
Files changed (130) hide show
  1. data/Rakefile +1 -1
  2. data/app/controllers/cinii_books_controller.rb +48 -0
  3. data/app/helpers/cinii_books_helper.rb +15 -0
  4. data/app/models/cinii_book.rb +66 -0
  5. data/app/views/cinii_books/index.html.erb +49 -0
  6. data/app/views/layouts/cinii_books.html.erb +23 -0
  7. data/app/views/nii_types/index.html.erb +2 -2
  8. data/config/locales/en.yml +10 -0
  9. data/config/locales/ja.yml +8 -0
  10. data/config/routes.rb +1 -1
  11. data/db/migrate/20121113163717_add_ncid_to_manifestation.rb +6 -0
  12. data/lib/enju_nii.rb +22 -0
  13. data/lib/enju_nii/cinii_book.rb +156 -0
  14. data/lib/enju_nii/engine.rb +7 -3
  15. data/lib/enju_nii/version.rb +1 -1
  16. data/lib/generators/enju_nii/views_generator.rb +17 -0
  17. data/spec/cassette_library/enju_nii/search.yml +876 -0
  18. data/spec/controllers/cinii_books_controller_spec.rb +24 -0
  19. data/spec/dummy/app/models/role.rb +47 -0
  20. data/spec/dummy/app/models/setting.rb +4 -0
  21. data/spec/dummy/app/models/user.rb +28 -0
  22. data/spec/dummy/app/models/user_has_role.rb +4 -0
  23. data/spec/dummy/config/application.yml +38 -0
  24. data/spec/dummy/config/initializers/devise.rb +205 -0
  25. data/spec/dummy/config/routes.rb +2 -0
  26. data/spec/dummy/db/development.sqlite3 +0 -0
  27. data/spec/dummy/db/migrate/001_create_patrons.rb +53 -0
  28. data/spec/dummy/db/migrate/005_create_manifestations.rb +56 -0
  29. data/spec/dummy/db/migrate/006_create_items.rb +28 -0
  30. data/spec/dummy/db/migrate/012_create_owns.rb +12 -0
  31. data/spec/dummy/db/migrate/015_create_creates.rb +12 -0
  32. data/spec/dummy/db/migrate/029_create_subjects.rb +27 -0
  33. data/spec/dummy/db/migrate/047_create_produces.rb +12 -0
  34. data/spec/dummy/db/migrate/073_create_carrier_types.rb +11 -0
  35. data/spec/dummy/db/migrate/112_create_frequencies.rb +12 -0
  36. data/spec/dummy/db/migrate/117_create_form_of_works.rb +12 -0
  37. data/spec/dummy/db/migrate/125_create_donates.rb +12 -0
  38. data/spec/dummy/db/migrate/142_create_classifications.rb +19 -0
  39. data/spec/dummy/db/migrate/143_create_subject_has_classifications.rb +16 -0
  40. data/spec/dummy/db/migrate/144_create_classification_types.rb +16 -0
  41. data/spec/dummy/db/migrate/145_create_subject_heading_types.rb +16 -0
  42. data/spec/dummy/db/migrate/146_create_subject_types.rb +16 -0
  43. data/spec/dummy/db/migrate/20080606052544_create_work_has_subjects.rb +18 -0
  44. data/spec/dummy/db/migrate/20080830154109_create_realizes.rb +13 -0
  45. data/spec/dummy/db/migrate/20080830172106_create_exemplifies.rb +13 -0
  46. data/spec/dummy/db/migrate/20080905191442_create_patron_types.rb +12 -0
  47. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +28 -0
  48. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +23 -0
  49. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +15 -0
  50. data/spec/dummy/db/migrate/20081028083142_create_patron_import_files.rb +22 -0
  51. data/spec/dummy/db/migrate/20081028083208_create_resource_import_files.rb +22 -0
  52. data/spec/dummy/db/migrate/20090208044541_create_subject_heading_type_has_subjects.rb +16 -0
  53. data/spec/dummy/db/migrate/20090705133942_add_attachments_picture_to_picture_file.rb +15 -0
  54. data/spec/dummy/db/migrate/20090705212043_add_attachments_attachment_to_manifestation.rb +15 -0
  55. data/spec/dummy/db/migrate/20090719201843_create_extents.rb +12 -0
  56. data/spec/dummy/db/migrate/20090720091106_create_medium_of_performances.rb +12 -0
  57. data/spec/dummy/db/migrate/20090720091429_create_content_types.rb +12 -0
  58. data/spec/dummy/db/migrate/20090812151902_create_patron_relationship_types.rb +12 -0
  59. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +27 -0
  60. data/spec/dummy/db/migrate/20091025080447_create_licenses.rb +12 -0
  61. data/spec/dummy/db/migrate/20091202124834_create_versions.rb +18 -0
  62. data/spec/dummy/db/migrate/20091214131723_create_series_statements.rb +13 -0
  63. data/spec/dummy/db/migrate/20100129142347_create_import_requests.rb +15 -0
  64. data/spec/dummy/db/migrate/20100223121519_rename_series_statement_title_to_original_title.rb +13 -0
  65. data/spec/dummy/db/migrate/20100321235924_add_series_statement_identifier_to_series_statement.rb +10 -0
  66. data/spec/dummy/db/migrate/20100525124311_create_manifestation_relationships.rb +13 -0
  67. data/spec/dummy/db/migrate/20100606073747_create_patron_relationships.rb +13 -0
  68. data/spec/dummy/db/migrate/20100607044753_create_manifestation_relationship_types.rb +12 -0
  69. data/spec/dummy/db/migrate/20100814091104_add_position_to_patron_relationship.rb +11 -0
  70. data/spec/dummy/db/migrate/20100925043847_create_resource_import_results.rb +15 -0
  71. data/spec/dummy/db/migrate/20100925074559_create_patron_import_results.rb +12 -0
  72. data/spec/dummy/db/migrate/20101212070145_add_acquired_at_to_item.rb +9 -0
  73. data/spec/dummy/db/migrate/20110301035123_add_pub_date_to_manifestation.rb +9 -0
  74. data/spec/dummy/db/migrate/20110301121550_add_birth_date_and_death_date_to_patron.rb +11 -0
  75. data/spec/dummy/db/migrate/20110425133109_add_issn_to_series_statement.rb +9 -0
  76. data/spec/dummy/db/migrate/20110603184217_add_edit_mode_to_resource_import_file.rb +9 -0
  77. data/spec/dummy/db/migrate/20110618091240_add_periodical_to_series_statement.rb +9 -0
  78. data/spec/dummy/db/migrate/20110619064807_add_edition_string_to_manifestation.rb +9 -0
  79. data/spec/dummy/db/migrate/20110620173525_add_bookstore_id_to_item.rb +11 -0
  80. data/spec/dummy/db/migrate/20110627034940_create_series_statement_merge_lists.rb +9 -0
  81. data/spec/dummy/db/migrate/20110627035057_create_series_statement_merges.rb +12 -0
  82. data/spec/dummy/db/migrate/20110820131417_create_series_has_manifestations.rb +13 -0
  83. data/spec/dummy/db/migrate/20110913120629_add_lft_and_rgt_to_classification.rb +11 -0
  84. data/spec/dummy/db/migrate/20110916053430_rename_manifestation_number_list_to_number_string.rb +13 -0
  85. data/spec/dummy/db/migrate/20110916091020_add_volume_number_to_manifestation.rb +13 -0
  86. data/spec/dummy/db/migrate/20110916103953_add_manifestaiton_id_to_series_statement.rb +10 -0
  87. data/spec/dummy/db/migrate/20110918161853_rename_series_statement_manifestation_id_to_root_manifestation_id.rb +13 -0
  88. data/spec/dummy/db/migrate/20110918162329_add_note_to_series_statement.rb +9 -0
  89. data/spec/dummy/db/migrate/20111009183423_add_ndc_to_manifestation.rb +9 -0
  90. data/spec/dummy/db/migrate/20111124110059_create_create_types.rb +12 -0
  91. data/spec/dummy/db/migrate/20111124110319_create_realize_types.rb +12 -0
  92. data/spec/dummy/db/migrate/20111124110355_create_produce_types.rb +12 -0
  93. data/spec/dummy/db/migrate/20111124112131_add_create_type_to_create.rb +7 -0
  94. data/spec/dummy/db/migrate/20111201121844_create_roles.rb +12 -0
  95. data/spec/dummy/db/migrate/20111201155456_create_users.rb +13 -0
  96. data/spec/dummy/db/migrate/20111201155513_add_devise_to_users.rb +52 -0
  97. data/spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb +10 -0
  98. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +6 -0
  99. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +6 -0
  100. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +6 -0
  101. data/spec/dummy/db/migrate/20120406020752_add_url_to_subject.rb +5 -0
  102. data/spec/dummy/db/migrate/20120410104851_add_year_of_publication_to_manifestation.rb +5 -0
  103. data/spec/dummy/db/migrate/20120413072700_add_picture_meta_to_picture_file.rb +5 -0
  104. data/spec/dummy/db/migrate/20120413100352_add_fingerprint_to_picture_file.rb +5 -0
  105. data/spec/dummy/db/migrate/20120413161340_add_fingerprint_to_resource_import_file.rb +5 -0
  106. data/spec/dummy/db/migrate/20120413161403_add_fingerprint_to_patron_import_file.rb +5 -0
  107. data/spec/dummy/db/migrate/20120413170705_add_error_message_to_resource_import_file.rb +5 -0
  108. data/spec/dummy/db/migrate/20120413170720_add_error_message_to_patron_import_file.rb +5 -0
  109. data/spec/dummy/db/migrate/20120415060308_rename_resource_import_file_imported_at_to_executed_at.rb +9 -0
  110. data/spec/dummy/db/migrate/20120415060323_rename_patron_import_file_imported_at_to_executed_at.rb +9 -0
  111. data/spec/dummy/db/migrate/20120415164821_add_attachment_meta_to_manifestation.rb +5 -0
  112. data/spec/dummy/db/migrate/20120418081407_add_month_of_publication_to_manifestation.rb +5 -0
  113. data/spec/dummy/db/migrate/20120511072422_add_patron_identifier_to_patron.rb +6 -0
  114. data/spec/dummy/db/migrate/20120602141129_add_edit_mode_to_patron_import_file.rb +5 -0
  115. data/spec/dummy/db/schema.rb +738 -0
  116. data/spec/dummy/db/test.sqlite3 +0 -0
  117. data/spec/fixtures/carrier_types.yml +51 -0
  118. data/spec/fixtures/content_types.yml +19 -0
  119. data/spec/fixtures/countries.yml +2059 -0
  120. data/spec/fixtures/languages.yml +1901 -0
  121. data/spec/fixtures/patron_types.yml +35 -0
  122. data/spec/fixtures/roles.yml +21 -0
  123. data/spec/fixtures/subject_types.yml +28 -0
  124. data/spec/fixtures/user_has_roles.yml +41 -0
  125. data/spec/fixtures/users.yml +79 -0
  126. data/spec/models/cinii_book_spec.rb +18 -0
  127. data/spec/spec_helper.rb +12 -11
  128. data/spec/support/controller_macros.rb +1 -24
  129. data/spec/support/vcr.rb +4 -0
  130. metadata +309 -12
@@ -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,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,13 @@
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
+
10
+ t.timestamps
11
+ end
12
+ end
13
+ end
@@ -0,0 +1,52 @@
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
+ ## 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
+ end
39
+
40
+ add_index :users, :email #, :unique => true
41
+ add_index :users, :reset_password_token, :unique => true
42
+ # add_index :users, :confirmation_token, :unique => true
43
+ # add_index :users, :unlock_token, :unique => true
44
+ # add_index :users, :authentication_token, :unique => true
45
+ end
46
+
47
+ def self.down
48
+ # By default, we don't want to make any assumption about how to roll back a migration when your
49
+ # model already existed. Please edit below which fields you would like to remove in this migration.
50
+ raise ActiveRecord::IrreversibleMigration
51
+ end
52
+ 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
@@ -0,0 +1,6 @@
1
+ class AddBudgetTypeIdToItem < ActiveRecord::Migration
2
+ def change
3
+ add_column :items, :budget_type_id, :integer
4
+
5
+ end
6
+ end
@@ -0,0 +1,6 @@
1
+ class AddContentTypeIdToManifestation < ActiveRecord::Migration
2
+ def change
3
+ add_column :manifestations, :content_type_id, :integer, :default => 1
4
+
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddUrlToSubject < ActiveRecord::Migration
2
+ def change
3
+ add_column :subjects, :url, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddYearOfPublicationToManifestation < ActiveRecord::Migration
2
+ def change
3
+ add_column :manifestations, :year_of_publication, :integer
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddPictureMetaToPictureFile < ActiveRecord::Migration
2
+ def change
3
+ add_column :picture_files, :picture_meta, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddFingerprintToPictureFile < ActiveRecord::Migration
2
+ def change
3
+ add_column :picture_files, :picture_fingerprint, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddFingerprintToResourceImportFile < ActiveRecord::Migration
2
+ def change
3
+ add_column :resource_import_files, :resource_import_fingerprint, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddFingerprintToPatronImportFile < ActiveRecord::Migration
2
+ def change
3
+ add_column :patron_import_files, :patron_import_fingerprint, :string
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddErrorMessageToResourceImportFile < ActiveRecord::Migration
2
+ def change
3
+ add_column :resource_import_files, :error_message, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddErrorMessageToPatronImportFile < ActiveRecord::Migration
2
+ def change
3
+ add_column :patron_import_files, :error_message, :text
4
+ end
5
+ end
@@ -0,0 +1,9 @@
1
+ class RenameResourceImportFileImportedAtToExecutedAt < ActiveRecord::Migration
2
+ def up
3
+ rename_column :resource_import_files, :imported_at, :executed_at
4
+ end
5
+
6
+ def down
7
+ rename_column :resource_import_files, :executed_at, :imported_at
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class RenamePatronImportFileImportedAtToExecutedAt < ActiveRecord::Migration
2
+ def up
3
+ rename_column :patron_import_files, :imported_at, :executed_at
4
+ end
5
+
6
+ def down
7
+ rename_column :patron_import_files, :executed_at, :imported_at
8
+ end
9
+ end
@@ -0,0 +1,5 @@
1
+ class AddAttachmentMetaToManifestation < ActiveRecord::Migration
2
+ def change
3
+ add_column :manifestations, :attachment_meta, :text
4
+ end
5
+ end
@@ -0,0 +1,5 @@
1
+ class AddMonthOfPublicationToManifestation < ActiveRecord::Migration
2
+ def change
3
+ add_column :manifestations, :month_of_publication, :integer
4
+ end
5
+ end
@@ -0,0 +1,6 @@
1
+ class AddPatronIdentifierToPatron < ActiveRecord::Migration
2
+ def change
3
+ add_column :patrons, :patron_identifier, :string
4
+ add_index :patrons, :patron_identifier
5
+ end
6
+ end
@@ -0,0 +1,5 @@
1
+ class AddEditModeToPatronImportFile < ActiveRecord::Migration
2
+ def change
3
+ add_column :patron_import_files, :edit_mode, :string
4
+ end
5
+ end
@@ -0,0 +1,738 @@
1
+ # encoding: UTF-8
2
+ # This file is auto-generated from the current state of the database. Instead
3
+ # of editing this file, please use the migrations feature of Active Record to
4
+ # incrementally modify your database, and then regenerate this schema definition.
5
+ #
6
+ # Note that this schema.rb definition is the authoritative source for your
7
+ # database schema. If you need to create the application database on another
8
+ # system, you should be using db:schema:load, not running all the migrations
9
+ # from scratch. The latter is a flawed and unsustainable approach (the more migrations
10
+ # you'll amass, the slower it'll run and the greater likelihood for issues).
11
+ #
12
+ # It's strongly recommended to check this file into your version control system.
13
+
14
+ ActiveRecord::Schema.define(:version => 20121113163717) do
15
+
16
+ create_table "carrier_types", :force => true do |t|
17
+ t.string "name", :null => false
18
+ t.text "display_name"
19
+ t.text "note"
20
+ t.integer "position"
21
+ t.datetime "created_at", :null => false
22
+ t.datetime "updated_at", :null => false
23
+ end
24
+
25
+ create_table "classification_types", :force => true do |t|
26
+ t.string "name", :null => false
27
+ t.text "display_name"
28
+ t.text "note"
29
+ t.integer "position"
30
+ t.datetime "created_at", :null => false
31
+ t.datetime "updated_at", :null => false
32
+ end
33
+
34
+ create_table "classifications", :force => true do |t|
35
+ t.integer "parent_id"
36
+ t.string "category", :null => false
37
+ t.text "note"
38
+ t.integer "classification_type_id", :null => false
39
+ t.datetime "created_at", :null => false
40
+ t.datetime "updated_at", :null => false
41
+ t.integer "lft"
42
+ t.integer "rgt"
43
+ end
44
+
45
+ add_index "classifications", ["category"], :name => "index_classifications_on_category"
46
+ add_index "classifications", ["classification_type_id"], :name => "index_classifications_on_classification_type_id"
47
+ add_index "classifications", ["parent_id"], :name => "index_classifications_on_parent_id"
48
+
49
+ create_table "content_types", :force => true do |t|
50
+ t.string "name", :null => false
51
+ t.text "display_name"
52
+ t.text "note"
53
+ t.integer "position"
54
+ t.datetime "created_at", :null => false
55
+ t.datetime "updated_at", :null => false
56
+ end
57
+
58
+ create_table "countries", :force => true do |t|
59
+ t.string "name", :null => false
60
+ t.text "display_name"
61
+ t.string "alpha_2"
62
+ t.string "alpha_3"
63
+ t.string "numeric_3"
64
+ t.text "note"
65
+ t.integer "position"
66
+ end
67
+
68
+ add_index "countries", ["alpha_2"], :name => "index_countries_on_alpha_2"
69
+ add_index "countries", ["alpha_3"], :name => "index_countries_on_alpha_3"
70
+ add_index "countries", ["name"], :name => "index_countries_on_name"
71
+ add_index "countries", ["numeric_3"], :name => "index_countries_on_numeric_3"
72
+
73
+ create_table "create_types", :force => true do |t|
74
+ t.string "name"
75
+ t.text "display_name"
76
+ t.text "note"
77
+ t.integer "position"
78
+ t.datetime "created_at", :null => false
79
+ t.datetime "updated_at", :null => false
80
+ end
81
+
82
+ create_table "creates", :force => true do |t|
83
+ t.integer "patron_id", :null => false
84
+ t.integer "work_id", :null => false
85
+ t.integer "position"
86
+ t.datetime "created_at", :null => false
87
+ t.datetime "updated_at", :null => false
88
+ t.integer "create_type_id"
89
+ end
90
+
91
+ add_index "creates", ["patron_id"], :name => "index_creates_on_patron_id"
92
+ add_index "creates", ["work_id"], :name => "index_creates_on_work_id"
93
+
94
+ create_table "donates", :force => true do |t|
95
+ t.integer "patron_id", :null => false
96
+ t.integer "item_id", :null => false
97
+ t.datetime "created_at", :null => false
98
+ t.datetime "updated_at", :null => false
99
+ end
100
+
101
+ add_index "donates", ["item_id"], :name => "index_donates_on_item_id"
102
+ add_index "donates", ["patron_id"], :name => "index_donates_on_patron_id"
103
+
104
+ create_table "exemplifies", :force => true do |t|
105
+ t.integer "manifestation_id", :null => false
106
+ t.integer "item_id", :null => false
107
+ t.integer "position"
108
+ t.datetime "created_at", :null => false
109
+ t.datetime "updated_at", :null => false
110
+ end
111
+
112
+ add_index "exemplifies", ["item_id"], :name => "index_exemplifies_on_item_id", :unique => true
113
+ add_index "exemplifies", ["manifestation_id"], :name => "index_exemplifies_on_manifestation_id"
114
+
115
+ create_table "extents", :force => true do |t|
116
+ t.string "name", :null => false
117
+ t.text "display_name"
118
+ t.text "note"
119
+ t.integer "position"
120
+ t.datetime "created_at", :null => false
121
+ t.datetime "updated_at", :null => false
122
+ end
123
+
124
+ create_table "form_of_works", :force => true do |t|
125
+ t.string "name", :null => false
126
+ t.text "display_name"
127
+ t.text "note"
128
+ t.integer "position"
129
+ t.datetime "created_at", :null => false
130
+ t.datetime "updated_at", :null => false
131
+ end
132
+
133
+ create_table "frequencies", :force => true do |t|
134
+ t.string "name", :null => false
135
+ t.text "display_name"
136
+ t.text "note"
137
+ t.integer "position"
138
+ t.datetime "created_at", :null => false
139
+ t.datetime "updated_at", :null => false
140
+ end
141
+
142
+ create_table "import_requests", :force => true do |t|
143
+ t.string "isbn"
144
+ t.string "state"
145
+ t.integer "manifestation_id"
146
+ t.integer "user_id"
147
+ t.datetime "created_at", :null => false
148
+ t.datetime "updated_at", :null => false
149
+ end
150
+
151
+ add_index "import_requests", ["isbn"], :name => "index_import_requests_on_isbn"
152
+ add_index "import_requests", ["manifestation_id"], :name => "index_import_requests_on_manifestation_id"
153
+ add_index "import_requests", ["user_id"], :name => "index_import_requests_on_user_id"
154
+
155
+ create_table "items", :force => true do |t|
156
+ t.string "call_number"
157
+ t.string "item_identifier"
158
+ t.integer "circulation_status_id", :default => 5, :null => false
159
+ t.integer "checkout_type_id", :default => 1, :null => false
160
+ t.datetime "created_at", :null => false
161
+ t.datetime "updated_at", :null => false
162
+ t.datetime "deleted_at"
163
+ t.integer "shelf_id", :default => 1, :null => false
164
+ t.boolean "include_supplements", :default => false, :null => false
165
+ t.text "note"
166
+ t.string "url"
167
+ t.integer "price"
168
+ t.integer "lock_version", :default => 0, :null => false
169
+ t.integer "required_role_id", :default => 1, :null => false
170
+ t.string "state"
171
+ t.integer "required_score", :default => 0, :null => false
172
+ t.datetime "acquired_at"
173
+ t.integer "bookstore_id"
174
+ t.integer "budget_type_id"
175
+ end
176
+
177
+ add_index "items", ["bookstore_id"], :name => "index_items_on_bookstore_id"
178
+ add_index "items", ["checkout_type_id"], :name => "index_items_on_checkout_type_id"
179
+ add_index "items", ["circulation_status_id"], :name => "index_items_on_circulation_status_id"
180
+ add_index "items", ["item_identifier"], :name => "index_items_on_item_identifier"
181
+ add_index "items", ["required_role_id"], :name => "index_items_on_required_role_id"
182
+ add_index "items", ["shelf_id"], :name => "index_items_on_shelf_id"
183
+
184
+ create_table "languages", :force => true do |t|
185
+ t.string "name", :null => false
186
+ t.string "native_name"
187
+ t.text "display_name"
188
+ t.string "iso_639_1"
189
+ t.string "iso_639_2"
190
+ t.string "iso_639_3"
191
+ t.text "note"
192
+ t.integer "position"
193
+ end
194
+
195
+ add_index "languages", ["iso_639_1"], :name => "index_languages_on_iso_639_1"
196
+ add_index "languages", ["iso_639_2"], :name => "index_languages_on_iso_639_2"
197
+ add_index "languages", ["iso_639_3"], :name => "index_languages_on_iso_639_3"
198
+ add_index "languages", ["name"], :name => "index_languages_on_name", :unique => true
199
+
200
+ create_table "licenses", :force => true do |t|
201
+ t.string "name", :null => false
202
+ t.string "display_name"
203
+ t.text "note"
204
+ t.integer "position"
205
+ t.datetime "created_at", :null => false
206
+ t.datetime "updated_at", :null => false
207
+ end
208
+
209
+ create_table "manifestation_relationship_types", :force => true do |t|
210
+ t.string "name", :null => false
211
+ t.text "display_name"
212
+ t.text "note"
213
+ t.integer "position"
214
+ t.datetime "created_at", :null => false
215
+ t.datetime "updated_at", :null => false
216
+ end
217
+
218
+ create_table "manifestation_relationships", :force => true do |t|
219
+ t.integer "parent_id"
220
+ t.integer "child_id"
221
+ t.integer "manifestation_relationship_type_id"
222
+ t.datetime "created_at", :null => false
223
+ t.datetime "updated_at", :null => false
224
+ t.integer "position"
225
+ end
226
+
227
+ add_index "manifestation_relationships", ["child_id"], :name => "index_manifestation_relationships_on_child_id"
228
+ add_index "manifestation_relationships", ["parent_id"], :name => "index_manifestation_relationships_on_parent_id"
229
+
230
+ create_table "manifestations", :force => true do |t|
231
+ t.text "original_title", :null => false
232
+ t.text "title_alternative"
233
+ t.text "title_transcription"
234
+ t.string "classification_number"
235
+ t.string "manifestation_identifier"
236
+ t.datetime "date_of_publication"
237
+ t.datetime "date_copyrighted"
238
+ t.datetime "created_at", :null => false
239
+ t.datetime "updated_at", :null => false
240
+ t.datetime "deleted_at"
241
+ t.string "access_address"
242
+ t.integer "language_id", :default => 1, :null => false
243
+ t.integer "carrier_type_id", :default => 1, :null => false
244
+ t.integer "extent_id", :default => 1, :null => false
245
+ t.integer "start_page"
246
+ t.integer "end_page"
247
+ t.integer "height"
248
+ t.integer "width"
249
+ t.integer "depth"
250
+ t.string "isbn"
251
+ t.string "isbn10"
252
+ t.string "wrong_isbn"
253
+ t.string "nbn"
254
+ t.string "lccn"
255
+ t.string "oclc_number"
256
+ t.string "issn"
257
+ t.integer "price"
258
+ t.text "fulltext"
259
+ t.string "volume_number_string"
260
+ t.string "issue_number_string"
261
+ t.string "serial_number_string"
262
+ t.integer "edition"
263
+ t.text "note"
264
+ t.boolean "repository_content", :default => false, :null => false
265
+ t.integer "lock_version", :default => 0, :null => false
266
+ t.integer "required_role_id", :default => 1, :null => false
267
+ t.string "state"
268
+ t.integer "required_score", :default => 0, :null => false
269
+ t.integer "frequency_id", :default => 1, :null => false
270
+ t.boolean "subscription_master", :default => false, :null => false
271
+ t.string "attachment_file_name"
272
+ t.string "attachment_content_type"
273
+ t.integer "attachment_file_size"
274
+ t.datetime "attachment_updated_at"
275
+ t.integer "nii_type_id"
276
+ t.text "title_alternative_transcription"
277
+ t.text "description"
278
+ t.text "abstract"
279
+ t.datetime "available_at"
280
+ t.datetime "valid_until"
281
+ t.datetime "date_submitted"
282
+ t.datetime "date_accepted"
283
+ t.datetime "date_caputured"
284
+ t.string "pub_date"
285
+ t.string "edition_string"
286
+ t.integer "volume_number"
287
+ t.integer "issue_number"
288
+ t.integer "serial_number"
289
+ t.string "ndc"
290
+ t.integer "content_type_id", :default => 1
291
+ t.integer "year_of_publication"
292
+ t.text "attachment_meta"
293
+ t.integer "month_of_publication"
294
+ t.string "ncid"
295
+ end
296
+
297
+ add_index "manifestations", ["access_address"], :name => "index_manifestations_on_access_address"
298
+ add_index "manifestations", ["carrier_type_id"], :name => "index_manifestations_on_carrier_type_id"
299
+ add_index "manifestations", ["frequency_id"], :name => "index_manifestations_on_frequency_id"
300
+ add_index "manifestations", ["isbn"], :name => "index_manifestations_on_isbn"
301
+ add_index "manifestations", ["issn"], :name => "index_manifestations_on_issn"
302
+ add_index "manifestations", ["lccn"], :name => "index_manifestations_on_lccn"
303
+ add_index "manifestations", ["manifestation_identifier"], :name => "index_manifestations_on_manifestation_identifier"
304
+ add_index "manifestations", ["nbn"], :name => "index_manifestations_on_nbn"
305
+ add_index "manifestations", ["ncid"], :name => "index_manifestations_on_ncid"
306
+ add_index "manifestations", ["nii_type_id"], :name => "index_manifestations_on_nii_type_id"
307
+ add_index "manifestations", ["oclc_number"], :name => "index_manifestations_on_oclc_number"
308
+ add_index "manifestations", ["required_role_id"], :name => "index_manifestations_on_required_role_id"
309
+ add_index "manifestations", ["updated_at"], :name => "index_manifestations_on_updated_at"
310
+
311
+ create_table "medium_of_performances", :force => true do |t|
312
+ t.string "name", :null => false
313
+ t.text "display_name"
314
+ t.text "note"
315
+ t.integer "position"
316
+ t.datetime "created_at", :null => false
317
+ t.datetime "updated_at", :null => false
318
+ end
319
+
320
+ create_table "nii_types", :force => true do |t|
321
+ t.string "name", :null => false
322
+ t.text "display_name"
323
+ t.text "note"
324
+ t.integer "position"
325
+ t.datetime "created_at", :null => false
326
+ t.datetime "updated_at", :null => false
327
+ end
328
+
329
+ add_index "nii_types", ["name"], :name => "index_nii_types_on_name", :unique => true
330
+
331
+ create_table "owns", :force => true do |t|
332
+ t.integer "patron_id", :null => false
333
+ t.integer "item_id", :null => false
334
+ t.integer "position"
335
+ t.datetime "created_at", :null => false
336
+ t.datetime "updated_at", :null => false
337
+ end
338
+
339
+ add_index "owns", ["item_id"], :name => "index_owns_on_item_id"
340
+ add_index "owns", ["patron_id"], :name => "index_owns_on_patron_id"
341
+
342
+ create_table "patron_import_files", :force => true do |t|
343
+ t.integer "parent_id"
344
+ t.string "content_type"
345
+ t.integer "size"
346
+ t.integer "user_id"
347
+ t.text "note"
348
+ t.datetime "executed_at"
349
+ t.string "state"
350
+ t.string "patron_import_file_name"
351
+ t.string "patron_import_content_type"
352
+ t.integer "patron_import_file_size"
353
+ t.datetime "patron_import_updated_at"
354
+ t.datetime "created_at", :null => false
355
+ t.datetime "updated_at", :null => false
356
+ t.string "patron_import_fingerprint"
357
+ t.text "error_message"
358
+ t.string "edit_mode"
359
+ end
360
+
361
+ add_index "patron_import_files", ["parent_id"], :name => "index_patron_import_files_on_parent_id"
362
+ add_index "patron_import_files", ["state"], :name => "index_patron_import_files_on_state"
363
+ add_index "patron_import_files", ["user_id"], :name => "index_patron_import_files_on_user_id"
364
+
365
+ create_table "patron_import_results", :force => true do |t|
366
+ t.integer "patron_import_file_id"
367
+ t.integer "patron_id"
368
+ t.integer "user_id"
369
+ t.text "body"
370
+ t.datetime "created_at", :null => false
371
+ t.datetime "updated_at", :null => false
372
+ end
373
+
374
+ create_table "patron_relationship_types", :force => true do |t|
375
+ t.string "name", :null => false
376
+ t.text "display_name"
377
+ t.text "note"
378
+ t.integer "position"
379
+ t.datetime "created_at", :null => false
380
+ t.datetime "updated_at", :null => false
381
+ end
382
+
383
+ create_table "patron_relationships", :force => true do |t|
384
+ t.integer "parent_id"
385
+ t.integer "child_id"
386
+ t.integer "patron_relationship_type_id"
387
+ t.datetime "created_at", :null => false
388
+ t.datetime "updated_at", :null => false
389
+ t.integer "position"
390
+ end
391
+
392
+ add_index "patron_relationships", ["child_id"], :name => "index_patron_relationships_on_child_id"
393
+ add_index "patron_relationships", ["parent_id"], :name => "index_patron_relationships_on_parent_id"
394
+
395
+ create_table "patron_types", :force => true do |t|
396
+ t.string "name", :null => false
397
+ t.text "display_name"
398
+ t.text "note"
399
+ t.integer "position"
400
+ t.datetime "created_at", :null => false
401
+ t.datetime "updated_at", :null => false
402
+ end
403
+
404
+ create_table "patrons", :force => true do |t|
405
+ t.integer "user_id"
406
+ t.string "last_name"
407
+ t.string "middle_name"
408
+ t.string "first_name"
409
+ t.string "last_name_transcription"
410
+ t.string "middle_name_transcription"
411
+ t.string "first_name_transcription"
412
+ t.string "corporate_name"
413
+ t.string "corporate_name_transcription"
414
+ t.string "full_name"
415
+ t.text "full_name_transcription"
416
+ t.text "full_name_alternative"
417
+ t.datetime "created_at", :null => false
418
+ t.datetime "updated_at", :null => false
419
+ t.datetime "deleted_at"
420
+ t.string "zip_code_1"
421
+ t.string "zip_code_2"
422
+ t.text "address_1"
423
+ t.text "address_2"
424
+ t.text "address_1_note"
425
+ t.text "address_2_note"
426
+ t.string "telephone_number_1"
427
+ t.string "telephone_number_2"
428
+ t.string "fax_number_1"
429
+ t.string "fax_number_2"
430
+ t.text "other_designation"
431
+ t.text "place"
432
+ t.string "postal_code"
433
+ t.text "street"
434
+ t.text "locality"
435
+ t.text "region"
436
+ t.datetime "date_of_birth"
437
+ t.datetime "date_of_death"
438
+ t.integer "language_id", :default => 1, :null => false
439
+ t.integer "country_id", :default => 1, :null => false
440
+ t.integer "patron_type_id", :default => 1, :null => false
441
+ t.integer "lock_version", :default => 0, :null => false
442
+ t.text "note"
443
+ t.integer "required_role_id", :default => 1, :null => false
444
+ t.integer "required_score", :default => 0, :null => false
445
+ t.string "state"
446
+ t.text "email"
447
+ t.text "url"
448
+ t.text "full_name_alternative_transcription"
449
+ t.string "birth_date"
450
+ t.string "death_date"
451
+ t.string "patron_identifier"
452
+ end
453
+
454
+ add_index "patrons", ["country_id"], :name => "index_patrons_on_country_id"
455
+ add_index "patrons", ["full_name"], :name => "index_patrons_on_full_name"
456
+ add_index "patrons", ["language_id"], :name => "index_patrons_on_language_id"
457
+ add_index "patrons", ["patron_identifier"], :name => "index_patrons_on_patron_identifier"
458
+ add_index "patrons", ["required_role_id"], :name => "index_patrons_on_required_role_id"
459
+ add_index "patrons", ["user_id"], :name => "index_patrons_on_user_id", :unique => true
460
+
461
+ create_table "picture_files", :force => true do |t|
462
+ t.integer "picture_attachable_id"
463
+ t.string "picture_attachable_type"
464
+ t.string "content_type"
465
+ t.text "title"
466
+ t.string "thumbnail"
467
+ t.integer "position"
468
+ t.datetime "created_at", :null => false
469
+ t.datetime "updated_at", :null => false
470
+ t.string "picture_file_name"
471
+ t.string "picture_content_type"
472
+ t.integer "picture_file_size"
473
+ t.datetime "picture_updated_at"
474
+ t.text "picture_meta"
475
+ t.string "picture_fingerprint"
476
+ end
477
+
478
+ add_index "picture_files", ["picture_attachable_id", "picture_attachable_type"], :name => "index_picture_files_on_picture_attachable_id_and_type"
479
+
480
+ create_table "produce_types", :force => true do |t|
481
+ t.string "name"
482
+ t.text "display_name"
483
+ t.text "note"
484
+ t.integer "position"
485
+ t.datetime "created_at", :null => false
486
+ t.datetime "updated_at", :null => false
487
+ end
488
+
489
+ create_table "produces", :force => true do |t|
490
+ t.integer "patron_id", :null => false
491
+ t.integer "manifestation_id", :null => false
492
+ t.integer "position"
493
+ t.datetime "created_at", :null => false
494
+ t.datetime "updated_at", :null => false
495
+ t.integer "produce_type_id"
496
+ end
497
+
498
+ add_index "produces", ["manifestation_id"], :name => "index_produces_on_manifestation_id"
499
+ add_index "produces", ["patron_id"], :name => "index_produces_on_patron_id"
500
+
501
+ create_table "realize_types", :force => true do |t|
502
+ t.string "name"
503
+ t.text "display_name"
504
+ t.text "note"
505
+ t.integer "position"
506
+ t.datetime "created_at", :null => false
507
+ t.datetime "updated_at", :null => false
508
+ end
509
+
510
+ create_table "realizes", :force => true do |t|
511
+ t.integer "patron_id", :null => false
512
+ t.integer "expression_id", :null => false
513
+ t.integer "position"
514
+ t.datetime "created_at", :null => false
515
+ t.datetime "updated_at", :null => false
516
+ t.integer "realize_type_id"
517
+ end
518
+
519
+ add_index "realizes", ["expression_id"], :name => "index_realizes_on_expression_id"
520
+ add_index "realizes", ["patron_id"], :name => "index_realizes_on_patron_id"
521
+
522
+ create_table "resource_import_files", :force => true do |t|
523
+ t.integer "parent_id"
524
+ t.string "content_type"
525
+ t.integer "size"
526
+ t.integer "user_id"
527
+ t.text "note"
528
+ t.datetime "executed_at"
529
+ t.string "state"
530
+ t.string "resource_import_file_name"
531
+ t.string "resource_import_content_type"
532
+ t.integer "resource_import_file_size"
533
+ t.datetime "resource_import_updated_at"
534
+ t.datetime "created_at", :null => false
535
+ t.datetime "updated_at", :null => false
536
+ t.string "edit_mode"
537
+ t.string "resource_import_fingerprint"
538
+ t.text "error_message"
539
+ end
540
+
541
+ add_index "resource_import_files", ["parent_id"], :name => "index_resource_import_files_on_parent_id"
542
+ add_index "resource_import_files", ["state"], :name => "index_resource_import_files_on_state"
543
+ add_index "resource_import_files", ["user_id"], :name => "index_resource_import_files_on_user_id"
544
+
545
+ create_table "resource_import_results", :force => true do |t|
546
+ t.integer "resource_import_file_id"
547
+ t.integer "manifestation_id"
548
+ t.integer "item_id"
549
+ t.text "body"
550
+ t.datetime "created_at", :null => false
551
+ t.datetime "updated_at", :null => false
552
+ end
553
+
554
+ add_index "resource_import_results", ["item_id"], :name => "index_resource_import_results_on_item_id"
555
+ add_index "resource_import_results", ["manifestation_id"], :name => "index_resource_import_results_on_manifestation_id"
556
+ add_index "resource_import_results", ["resource_import_file_id"], :name => "index_resource_import_results_on_resource_import_file_id"
557
+
558
+ create_table "roles", :force => true do |t|
559
+ t.string "name"
560
+ t.text "display_name"
561
+ t.text "note"
562
+ t.integer "position"
563
+ t.datetime "created_at", :null => false
564
+ t.datetime "updated_at", :null => false
565
+ end
566
+
567
+ create_table "series_has_manifestations", :force => true do |t|
568
+ t.integer "series_statement_id"
569
+ t.integer "manifestation_id"
570
+ t.integer "position"
571
+ t.datetime "created_at", :null => false
572
+ t.datetime "updated_at", :null => false
573
+ end
574
+
575
+ add_index "series_has_manifestations", ["manifestation_id"], :name => "index_series_has_manifestations_on_manifestation_id"
576
+ add_index "series_has_manifestations", ["series_statement_id"], :name => "index_series_has_manifestations_on_series_statement_id"
577
+
578
+ create_table "series_statement_merge_lists", :force => true do |t|
579
+ t.string "title"
580
+ t.datetime "created_at", :null => false
581
+ t.datetime "updated_at", :null => false
582
+ end
583
+
584
+ create_table "series_statement_merges", :force => true do |t|
585
+ t.integer "series_statement_id", :null => false
586
+ t.integer "series_statement_merge_list_id", :null => false
587
+ t.datetime "created_at", :null => false
588
+ t.datetime "updated_at", :null => false
589
+ end
590
+
591
+ add_index "series_statement_merges", ["series_statement_id"], :name => "index_series_statement_merges_on_series_statement_id"
592
+ add_index "series_statement_merges", ["series_statement_merge_list_id"], :name => "index_series_statement_merges_on_series_statement_merge_list_id"
593
+
594
+ create_table "series_statements", :force => true do |t|
595
+ t.text "original_title"
596
+ t.text "numbering"
597
+ t.text "title_subseries"
598
+ t.text "numbering_subseries"
599
+ t.integer "position"
600
+ t.datetime "created_at", :null => false
601
+ t.datetime "updated_at", :null => false
602
+ t.text "title_transcription"
603
+ t.text "title_alternative"
604
+ t.string "series_statement_identifier"
605
+ t.string "issn"
606
+ t.boolean "periodical"
607
+ t.integer "root_manifestation_id"
608
+ t.text "note"
609
+ t.text "title_subseries_transcription"
610
+ end
611
+
612
+ add_index "series_statements", ["root_manifestation_id"], :name => "index_series_statements_on_manifestation_id"
613
+ add_index "series_statements", ["series_statement_identifier"], :name => "index_series_statements_on_series_statement_identifier"
614
+
615
+ create_table "subject_has_classifications", :force => true do |t|
616
+ t.integer "subject_id"
617
+ t.string "subject_type"
618
+ t.integer "classification_id", :null => false
619
+ t.datetime "created_at", :null => false
620
+ t.datetime "updated_at", :null => false
621
+ end
622
+
623
+ add_index "subject_has_classifications", ["classification_id"], :name => "index_subject_has_classifications_on_classification_id"
624
+ add_index "subject_has_classifications", ["subject_id"], :name => "index_subject_has_classifications_on_subject_id"
625
+
626
+ create_table "subject_heading_type_has_subjects", :force => true do |t|
627
+ t.integer "subject_id", :null => false
628
+ t.string "subject_type"
629
+ t.integer "subject_heading_type_id", :null => false
630
+ t.datetime "created_at", :null => false
631
+ t.datetime "updated_at", :null => false
632
+ end
633
+
634
+ add_index "subject_heading_type_has_subjects", ["subject_id"], :name => "index_subject_heading_type_has_subjects_on_subject_id"
635
+
636
+ create_table "subject_heading_types", :force => true do |t|
637
+ t.string "name", :null => false
638
+ t.text "display_name"
639
+ t.text "note"
640
+ t.integer "position"
641
+ t.datetime "created_at", :null => false
642
+ t.datetime "updated_at", :null => false
643
+ end
644
+
645
+ create_table "subject_types", :force => true do |t|
646
+ t.string "name", :null => false
647
+ t.text "display_name"
648
+ t.text "note"
649
+ t.integer "position"
650
+ t.datetime "created_at", :null => false
651
+ t.datetime "updated_at", :null => false
652
+ end
653
+
654
+ create_table "subjects", :force => true do |t|
655
+ t.integer "parent_id"
656
+ t.integer "use_term_id"
657
+ t.string "term"
658
+ t.text "term_transcription"
659
+ t.integer "subject_type_id", :null => false
660
+ t.text "scope_note"
661
+ t.text "note"
662
+ t.integer "required_role_id", :default => 1, :null => false
663
+ t.integer "lock_version", :default => 0, :null => false
664
+ t.datetime "created_at"
665
+ t.datetime "updated_at"
666
+ t.datetime "deleted_at"
667
+ t.string "url"
668
+ end
669
+
670
+ add_index "subjects", ["parent_id"], :name => "index_subjects_on_parent_id"
671
+ add_index "subjects", ["required_role_id"], :name => "index_subjects_on_required_role_id"
672
+ add_index "subjects", ["subject_type_id"], :name => "index_subjects_on_subject_type_id"
673
+ add_index "subjects", ["term"], :name => "index_subjects_on_term"
674
+ add_index "subjects", ["use_term_id"], :name => "index_subjects_on_use_term_id"
675
+
676
+ create_table "user_has_roles", :force => true do |t|
677
+ t.integer "user_id"
678
+ t.integer "role_id"
679
+ t.datetime "created_at", :null => false
680
+ t.datetime "updated_at", :null => false
681
+ end
682
+
683
+ create_table "users", :force => true do |t|
684
+ t.integer "user_group_id"
685
+ t.integer "required_role_id"
686
+ t.string "username"
687
+ t.text "note"
688
+ t.string "locale"
689
+ t.datetime "created_at", :null => false
690
+ t.datetime "updated_at", :null => false
691
+ t.string "email", :default => "", :null => false
692
+ t.string "encrypted_password", :default => "", :null => false
693
+ t.string "reset_password_token"
694
+ t.datetime "reset_password_sent_at"
695
+ t.datetime "remember_created_at"
696
+ t.integer "sign_in_count", :default => 0
697
+ t.datetime "current_sign_in_at"
698
+ t.datetime "last_sign_in_at"
699
+ t.string "current_sign_in_ip"
700
+ t.string "last_sign_in_ip"
701
+ t.string "password_salt"
702
+ t.string "confirmation_token"
703
+ t.datetime "confirmed_at"
704
+ t.datetime "confirmation_sent_at"
705
+ t.string "unconfirmed_email"
706
+ t.integer "failed_attempts", :default => 0
707
+ t.string "unlock_token"
708
+ t.datetime "locked_at"
709
+ t.string "authentication_token"
710
+ end
711
+
712
+ add_index "users", ["email"], :name => "index_users_on_email"
713
+ add_index "users", ["reset_password_token"], :name => "index_users_on_reset_password_token", :unique => true
714
+
715
+ create_table "versions", :force => true do |t|
716
+ t.string "item_type", :null => false
717
+ t.integer "item_id", :null => false
718
+ t.string "event", :null => false
719
+ t.string "whodunnit"
720
+ t.text "object"
721
+ t.datetime "created_at"
722
+ end
723
+
724
+ add_index "versions", ["item_type", "item_id"], :name => "index_versions_on_item_type_and_item_id"
725
+
726
+ create_table "work_has_subjects", :force => true do |t|
727
+ t.integer "subject_id"
728
+ t.string "subject_type"
729
+ t.integer "work_id"
730
+ t.integer "position"
731
+ t.datetime "created_at", :null => false
732
+ t.datetime "updated_at", :null => false
733
+ end
734
+
735
+ add_index "work_has_subjects", ["subject_id"], :name => "index_work_has_subjects_on_subject_id"
736
+ add_index "work_has_subjects", ["work_id"], :name => "index_work_has_subjects_on_work_id"
737
+
738
+ end