enju_seed 0.4.0.rc.2 → 0.5.0.beta.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (83) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +2 -2
  3. data/app/controllers/profiles_controller.rb +3 -3
  4. data/app/controllers/roles_controller.rb +1 -1
  5. data/app/models/concerns/enju_seed/enju_user.rb +4 -14
  6. data/app/models/profile.rb +10 -12
  7. data/app/models/role.rb +2 -2
  8. data/app/models/user_has_role.rb +17 -6
  9. data/app/views/roles/_form.html.erb +1 -1
  10. data/db/migrate/041_create_roles.rb +1 -1
  11. data/db/migrate/20100606065209_create_user_has_roles.rb +1 -1
  12. data/db/migrate/20130221154434_add_additional_attributes_to_user.rb +2 -1
  13. data/db/migrate/20140122054321_create_profiles.rb +1 -1
  14. data/db/migrate/20140610123439_drop_email_unique_constraint_enju_leaf_rc10.rb +1 -1
  15. data/db/migrate/20140811031145_add_expired_at_to_profile.rb +1 -1
  16. data/db/migrate/20141003181336_add_full_name_transcription_to_profile.rb +1 -1
  17. data/db/migrate/20141003182825_add_date_of_birth_to_profile.rb +1 -1
  18. data/lib/enju_seed/engine.rb +0 -1
  19. data/lib/enju_seed/version.rb +1 -1
  20. data/lib/tasks/enju_seed_tasks.rake +0 -19
  21. data/spec/controllers/my_accounts_controller_spec.rb +0 -12
  22. data/spec/controllers/profiles_controller_spec.rb +20 -15
  23. data/spec/dummy/app/models/user.rb +1 -1
  24. data/spec/dummy/db/migrate/059_create_libraries.rb +2 -1
  25. data/spec/dummy/db/migrate/069_create_shelves.rb +2 -1
  26. data/spec/dummy/db/migrate/077_create_user_groups.rb +2 -1
  27. data/spec/dummy/db/migrate/080_create_library_groups.rb +1 -1
  28. data/spec/dummy/db/migrate/120_create_baskets.rb +1 -1
  29. data/spec/dummy/db/migrate/124_create_bookstores.rb +2 -1
  30. data/spec/dummy/db/migrate/130_create_request_status_types.rb +1 -1
  31. data/spec/dummy/db/migrate/131_create_request_types.rb +1 -1
  32. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +2 -1
  33. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +1 -1
  34. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +1 -1
  35. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +1 -1
  36. data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
  37. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +1 -1
  38. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +1 -1
  39. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
  40. data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +1 -1
  41. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +1 -1
  42. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +1 -1
  43. data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
  44. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
  45. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +1 -1
  46. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +6 -2
  47. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
  48. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +1 -1
  49. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +6 -2
  50. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
  51. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
  52. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +1 -1
  53. data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +1 -1
  54. data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +1 -1
  55. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +1 -1
  56. data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
  57. data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
  58. data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
  59. data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +1 -1
  60. data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +1 -1
  61. data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +1 -1
  62. data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +1 -1
  63. data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +1 -1
  64. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +1 -1
  65. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +1 -1
  66. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +1 -1
  67. data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +1 -1
  68. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
  69. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
  70. data/spec/dummy/db/schema.rb +101 -100
  71. data/spec/factories/profile.rb +0 -2
  72. data/spec/factories/user.rb +25 -31
  73. data/spec/fixtures/profiles.yml +7 -14
  74. data/spec/fixtures/roles.yml +1 -1
  75. data/spec/fixtures/user_has_roles.yml +5 -5
  76. data/spec/fixtures/users.yml +7 -0
  77. data/spec/models/profile_spec.rb +7 -7
  78. data/spec/models/role_spec.rb +1 -1
  79. data/spec/models/user_has_role_spec.rb +5 -5
  80. data/spec/models/user_spec.rb +6 -1
  81. metadata +11 -57
  82. data/spec/dummy/app/assets/config/manifest.js +0 -3
  83. data/spec/dummy/db/migrate/20191216131755_add_email_to_library_group.rb +0 -6
@@ -1,4 +1,4 @@
1
- class User < ApplicationRecord
1
+ class User < ActiveRecord::Base
2
2
  devise :database_authenticatable, #:registerable,
3
3
  :recoverable, :rememberable, :trackable, #, :validatable
4
4
  :lockable, lock_strategy: :none, unlock_strategy: :none
@@ -1,4 +1,4 @@
1
- class CreateLibraries < ActiveRecord::Migration[5.2]
1
+ class CreateLibraries < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :libraries do |t|
4
4
  t.string :name, index: true, null: false
@@ -20,6 +20,7 @@ class CreateLibraries < ActiveRecord::Migration[5.2]
20
20
  t.references :country
21
21
 
22
22
  t.timestamps
23
+ t.datetime :deleted_at
23
24
  end
24
25
  end
25
26
  end
@@ -1,4 +1,4 @@
1
- class CreateShelves < ActiveRecord::Migration[5.2]
1
+ class CreateShelves < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :shelves do |t|
4
4
  t.string :name, null: false
@@ -8,6 +8,7 @@ class CreateShelves < ActiveRecord::Migration[5.2]
8
8
  t.integer :items_count, default: 0, null: false
9
9
  t.integer :position
10
10
  t.timestamps
11
+ t.datetime :deleted_at
11
12
  end
12
13
  end
13
14
  end
@@ -1,4 +1,4 @@
1
- class CreateUserGroups < ActiveRecord::Migration[5.2]
1
+ class CreateUserGroups < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_groups do |t|
4
4
  t.string :name, not_null: true
@@ -6,6 +6,7 @@ class CreateUserGroups < ActiveRecord::Migration[5.2]
6
6
  t.text :note
7
7
  t.integer :position
8
8
  t.timestamps
9
+ t.datetime :deleted_at
9
10
  end
10
11
  end
11
12
  end
@@ -1,4 +1,4 @@
1
- class CreateLibraryGroups < ActiveRecord::Migration[5.2]
1
+ class CreateLibraryGroups < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :library_groups do |t|
4
4
  t.string :name, null: false
@@ -1,4 +1,4 @@
1
- class CreateBaskets < ActiveRecord::Migration[5.2]
1
+ class CreateBaskets < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :baskets do |t|
4
4
  t.references :user, index: true
@@ -1,4 +1,4 @@
1
- class CreateBookstores < ActiveRecord::Migration[5.2]
1
+ class CreateBookstores < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :bookstores do |t|
4
4
  t.text :name, null: false
@@ -9,6 +9,7 @@ class CreateBookstores < ActiveRecord::Migration[5.2]
9
9
  t.string :fax_number
10
10
  t.string :url
11
11
  t.integer :position
12
+ t.datetime :deleted_at
12
13
 
13
14
  t.timestamps
14
15
  end
@@ -1,4 +1,4 @@
1
- class CreateRequestStatusTypes < ActiveRecord::Migration[5.2]
1
+ class CreateRequestStatusTypes < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :request_status_types do |t|
4
4
  t.string :name, null: false
@@ -1,4 +1,4 @@
1
- class CreateRequestTypes < ActiveRecord::Migration[5.2]
1
+ class CreateRequestTypes < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :request_types do |t|
4
4
  t.string :name, null: false
@@ -1,10 +1,11 @@
1
- class CreateSubscriptions < ActiveRecord::Migration[5.2]
1
+ class CreateSubscriptions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :subscriptions do |t|
4
4
  t.text :title, null: false
5
5
  t.text :note
6
6
  t.references :user, index: true
7
7
  t.references :order_list, index: true
8
+ t.datetime :deleted_at
8
9
  t.integer :subscribes_count, default: 0, null: false
9
10
 
10
11
  t.timestamps
@@ -1,4 +1,4 @@
1
- class CreateSubscribes < ActiveRecord::Migration[5.2]
1
+ class CreateSubscribes < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :subscribes do |t|
4
4
  t.references :subscription, index: true, null: false
@@ -1,4 +1,4 @@
1
- class CreateSearchEngines < ActiveRecord::Migration[5.2]
1
+ class CreateSearchEngines < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :search_engines do |t|
4
4
  t.string :name, null: false
@@ -1,4 +1,4 @@
1
- class AddAdminNetworksToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddAdminNetworksToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  add_column :library_groups, :admin_networks, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddOpeningHourToLibrary < ActiveRecord::Migration[5.2]
1
+ class AddOpeningHourToLibrary < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  add_column :libraries, :opening_hour, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddUrlToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddUrlToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  add_column :library_groups, :url, :string, default: 'http://localhost:3000/'
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddValidPeriodForNewUserToUserGroup < ActiveRecord::Migration[5.2]
1
+ class AddValidPeriodForNewUserToUserGroup < ActiveRecord::Migration[4.2]
2
2
  def self.up
3
3
  add_column :user_groups, :valid_period_for_new_user, :integer, default: 0, null: false
4
4
  add_column :user_groups, :expired_at, :timestamp
@@ -1,4 +1,4 @@
1
- class AddIsilToLibrary < ActiveRecord::Migration[5.2]
1
+ class AddIsilToLibrary < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :libraries, :isil, :string
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateBudgetTypes < ActiveRecord::Migration[5.2]
1
+ class CreateBudgetTypes < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :budget_types do |t|
4
4
  t.string :name
@@ -1,4 +1,4 @@
1
- class CreateAccepts < ActiveRecord::Migration[5.2]
1
+ class CreateAccepts < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :accepts do |t|
4
4
  t.references :basket, index: true
@@ -1,4 +1,4 @@
1
- class AddClosedToShelf < ActiveRecord::Migration[5.2]
1
+ class AddClosedToShelf < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :shelves, :closed, :boolean, default: false, null: false
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddLatitudeAndLongitudeToLibrary < ActiveRecord::Migration[5.2]
1
+ class AddLatitudeAndLongitudeToLibrary < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :libraries, :latitude, :float
4
4
  add_column :libraries, :longitude, :float
@@ -1,4 +1,4 @@
1
- class CreateUserImportFiles < ActiveRecord::Migration[5.2]
1
+ class CreateUserImportFiles < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_import_files do |t|
4
4
  t.references :user, index: true
@@ -1,4 +1,4 @@
1
- class CreateUserImportResults < ActiveRecord::Migration[5.2]
1
+ class CreateUserImportResults < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_import_results do |t|
4
4
  t.references :user_import_file, index: true
@@ -1,8 +1,12 @@
1
- class CreateUserImportFileTransitions < ActiveRecord::Migration[5.2]
1
+ class CreateUserImportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_import_file_transitions do |t|
4
4
  t.string :to_state
5
- t.text :metadata, default: "{}"
5
+ if ActiveRecord::Base.configurations[Rails.env]["adapter"].try(:match, /mysql/)
6
+ t.text :metadata
7
+ else
8
+ t.text :metadata, default: "{}"
9
+ end
6
10
  t.integer :sort_key
7
11
  t.references :user_import_file, index: true
8
12
  t.timestamps
@@ -1,4 +1,4 @@
1
- class AddUserEncodingToUserImportFile < ActiveRecord::Migration[5.2]
1
+ class AddUserEncodingToUserImportFile < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :user_import_files, :user_encoding, :string
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateUserExportFiles < ActiveRecord::Migration[5.2]
1
+ class CreateUserExportFiles < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_export_files do |t|
4
4
  t.references :user, index: true
@@ -1,8 +1,12 @@
1
- class CreateUserExportFileTransitions < ActiveRecord::Migration[5.2]
1
+ class CreateUserExportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_export_file_transitions do |t|
4
4
  t.string :to_state
5
- t.text :metadata, default: "{}"
5
+ if ActiveRecord::Base.configurations[Rails.env]["adapter"].try(:match, /mysql/)
6
+ t.text :metadata
7
+ else
8
+ t.text :metadata, default: "{}"
9
+ end
6
10
  t.integer :sort_key
7
11
  t.references :user_export_file, index: true
8
12
  t.timestamps
@@ -1,4 +1,4 @@
1
- class AddDefaultLibraryIdToUserImportFile < ActiveRecord::Migration[5.2]
1
+ class AddDefaultLibraryIdToUserImportFile < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_reference :user_import_files, :default_library
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddDefaultUserGroupIdToUserImportFile < ActiveRecord::Migration[5.2]
1
+ class AddDefaultUserGroupIdToUserImportFile < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_reference :user_import_files, :default_user_group
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateColors < ActiveRecord::Migration[5.2]
1
+ class CreateColors < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :colors do |t|
4
4
  t.references :library_group, index: true
@@ -1,4 +1,4 @@
1
- class AddSettingsToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddSettingsToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :library_groups, :settings, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddErrorMessageToUserImportResult < ActiveRecord::Migration[5.2]
1
+ class AddErrorMessageToUserImportResult < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :user_import_results, :error_message, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateWithdraws < ActiveRecord::Migration[5.2]
1
+ class CreateWithdraws < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :withdraws do |t|
4
4
  t.references :basket, index: true
@@ -1,4 +1,4 @@
1
- class AddHtmlSnippetToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddHtmlSnippetToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :library_groups, :html_snippet, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddMostRecentToUserImportFileTransitions < ActiveRecord::Migration[5.2]
1
+ class AddMostRecentToUserImportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :user_import_file_transitions, :most_recent, :boolean, null: true
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddMostRecentToUserExportFileTransitions < ActiveRecord::Migration[5.2]
1
+ class AddMostRecentToUserExportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  def up
3
3
  add_column :user_export_file_transitions, :most_recent, :boolean, null: true
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddMaxNumberOfResultsToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddMaxNumberOfResultsToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :library_groups, :max_number_of_results, :integer, default: 500
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddFamilyNameFirstToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddFamilyNameFirstToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :library_groups, :family_name_first, :boolean, default: true
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddPubYearFacetRangeIntervalToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddPubYearFacetRangeIntervalToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :library_groups, :pub_year_facet_range_interval, :integer, default: 10
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddUserIdToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddUserIdToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_reference :library_groups, :user, index: true, foreign_key: true
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddCsvCharsetConversionToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddCsvCharsetConversionToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :library_groups, :csv_charset_conversion, :boolean, null: false, default: false
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddHeaderLogoToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddHeaderLogoToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_attachment :library_groups, :header_logo
4
4
  end
@@ -1,4 +1,4 @@
1
- class RenameLoginBannerToOldLoginBanner < ActiveRecord::Migration[5.2]
1
+ class RenameLoginBannerToOldLoginBanner < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  rename_column :library_groups, :login_banner, :old_login_banner
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddForeignKeyToLibraryGroupIdOnLibrary < ActiveRecord::Migration[5.2]
1
+ class AddForeignKeyToLibraryGroupIdOnLibrary < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_foreign_key :libraries, :library_groups, null: false
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddHeaderLogoMetaToLibraryGroup < ActiveRecord::Migration[5.2]
1
+ class AddHeaderLogoMetaToLibraryGroup < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :library_groups, :header_logo_meta, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Migration[5.2]
1
+ class AddConstraintsToMostRecentForUserImportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -1,4 +1,4 @@
1
- class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Migration[5.2]
1
+ class AddConstraintsToMostRecentForUserExportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  disable_ddl_transaction!
3
3
 
4
4
  def up
@@ -10,18 +10,18 @@
10
10
  #
11
11
  # It's strongly recommended that you check this file into your version control system.
12
12
 
13
- ActiveRecord::Schema.define(version: 2019_12_16_131755) do
13
+ ActiveRecord::Schema.define(version: 2019_07_13_115451) do
14
14
 
15
15
  # These are extensions that must be enabled in order to support this database
16
16
  enable_extension "pgcrypto"
17
17
  enable_extension "plpgsql"
18
18
 
19
- create_table "accepts", force: :cascade do |t|
20
- t.bigint "basket_id"
21
- t.bigint "item_id"
22
- t.bigint "librarian_id"
23
- t.datetime "created_at", null: false
24
- t.datetime "updated_at", null: false
19
+ create_table "accepts", id: :serial, force: :cascade do |t|
20
+ t.integer "basket_id"
21
+ t.integer "item_id"
22
+ t.integer "librarian_id"
23
+ t.datetime "created_at"
24
+ t.datetime "updated_at"
25
25
  t.index ["basket_id"], name: "index_accepts_on_basket_id"
26
26
  t.index ["item_id"], name: "index_accepts_on_item_id"
27
27
  t.index ["librarian_id"], name: "index_accepts_on_librarian_id"
@@ -166,16 +166,16 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
166
166
  t.index ["required_role_id"], name: "index_agents_on_required_role_id"
167
167
  end
168
168
 
169
- create_table "baskets", force: :cascade do |t|
170
- t.bigint "user_id"
169
+ create_table "baskets", id: :serial, force: :cascade do |t|
170
+ t.integer "user_id"
171
171
  t.text "note"
172
172
  t.integer "lock_version", default: 0, null: false
173
- t.datetime "created_at", null: false
174
- t.datetime "updated_at", null: false
173
+ t.datetime "created_at"
174
+ t.datetime "updated_at"
175
175
  t.index ["user_id"], name: "index_baskets_on_user_id"
176
176
  end
177
177
 
178
- create_table "bookstores", force: :cascade do |t|
178
+ create_table "bookstores", id: :serial, force: :cascade do |t|
179
179
  t.text "name", null: false
180
180
  t.string "zip_code"
181
181
  t.text "address"
@@ -184,17 +184,18 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
184
184
  t.string "fax_number"
185
185
  t.string "url"
186
186
  t.integer "position"
187
- t.datetime "created_at", null: false
188
- t.datetime "updated_at", null: false
187
+ t.datetime "deleted_at"
188
+ t.datetime "created_at"
189
+ t.datetime "updated_at"
189
190
  end
190
191
 
191
- create_table "budget_types", force: :cascade do |t|
192
+ create_table "budget_types", id: :serial, force: :cascade do |t|
192
193
  t.string "name"
193
194
  t.text "display_name"
194
195
  t.text "note"
195
196
  t.integer "position"
196
- t.datetime "created_at", null: false
197
- t.datetime "updated_at", null: false
197
+ t.datetime "created_at"
198
+ t.datetime "updated_at"
198
199
  t.jsonb "display_name_translations", default: {}, null: false
199
200
  end
200
201
 
@@ -303,13 +304,13 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
303
304
  t.datetime "updated_at"
304
305
  end
305
306
 
306
- create_table "colors", force: :cascade do |t|
307
- t.bigint "library_group_id"
307
+ create_table "colors", id: :serial, force: :cascade do |t|
308
+ t.integer "library_group_id"
308
309
  t.string "property"
309
310
  t.string "code"
310
311
  t.integer "position"
311
- t.datetime "created_at", null: false
312
- t.datetime "updated_at", null: false
312
+ t.datetime "created_at"
313
+ t.datetime "updated_at"
313
314
  t.index ["library_group_id"], name: "index_colors_on_library_group_id"
314
315
  end
315
316
 
@@ -508,7 +509,7 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
508
509
  t.index ["item_id", "user_group_id"], name: "index_lending_policies_on_item_id_and_user_group_id", unique: true
509
510
  end
510
511
 
511
- create_table "libraries", force: :cascade do |t|
512
+ create_table "libraries", id: :serial, force: :cascade do |t|
512
513
  t.string "name", null: false
513
514
  t.text "display_name"
514
515
  t.string "short_display_name", null: false
@@ -522,23 +523,23 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
522
523
  t.text "note"
523
524
  t.integer "call_number_rows", default: 1, null: false
524
525
  t.string "call_number_delimiter", default: "|", null: false
525
- t.bigint "library_group_id", null: false
526
+ t.integer "library_group_id", null: false
526
527
  t.integer "users_count", default: 0, null: false
527
528
  t.integer "position"
528
- t.bigint "country_id"
529
- t.datetime "created_at", null: false
530
- t.datetime "updated_at", null: false
529
+ t.integer "country_id"
530
+ t.datetime "created_at"
531
+ t.datetime "updated_at"
532
+ t.datetime "deleted_at"
531
533
  t.text "opening_hour"
532
534
  t.string "isil"
533
535
  t.float "latitude"
534
536
  t.float "longitude"
535
537
  t.jsonb "display_name_translations", default: {}, null: false
536
- t.index ["country_id"], name: "index_libraries_on_country_id"
537
538
  t.index ["library_group_id"], name: "index_libraries_on_library_group_id"
538
539
  t.index ["name"], name: "index_libraries_on_name"
539
540
  end
540
541
 
541
- create_table "library_groups", force: :cascade do |t|
542
+ create_table "library_groups", id: :serial, force: :cascade do |t|
542
543
  t.string "name", null: false
543
544
  t.text "display_name"
544
545
  t.string "short_name", null: false
@@ -547,8 +548,8 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
547
548
  t.text "note"
548
549
  t.integer "country_id"
549
550
  t.integer "position"
550
- t.datetime "created_at", null: false
551
- t.datetime "updated_at", null: false
551
+ t.datetime "created_at"
552
+ t.datetime "updated_at"
552
553
  t.text "admin_networks"
553
554
  t.string "url", default: "http://localhost:3000/"
554
555
  t.text "settings"
@@ -556,7 +557,7 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
556
557
  t.integer "max_number_of_results", default: 500
557
558
  t.boolean "family_name_first", default: true
558
559
  t.integer "pub_year_facet_range_interval", default: 10
559
- t.bigint "user_id"
560
+ t.integer "user_id"
560
561
  t.boolean "csv_charset_conversion", default: false, null: false
561
562
  t.string "header_logo_file_name"
562
563
  t.string "header_logo_content_type"
@@ -566,8 +567,6 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
566
567
  t.jsonb "display_name_translations", default: {}, null: false
567
568
  t.jsonb "login_banner_translations", default: {}, null: false
568
569
  t.jsonb "footer_banner_translations", default: {}, null: false
569
- t.string "email"
570
- t.index ["email"], name: "index_library_groups_on_email"
571
570
  t.index ["short_name"], name: "index_library_groups_on_short_name"
572
571
  t.index ["user_id"], name: "index_library_groups_on_user_id"
573
572
  end
@@ -835,18 +834,18 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
835
834
  t.index ["manifestation_id"], name: "index_produces_on_manifestation_id"
836
835
  end
837
836
 
838
- create_table "profiles", force: :cascade do |t|
839
- t.bigint "user_id"
840
- t.bigint "user_group_id"
841
- t.bigint "library_id"
837
+ create_table "profiles", id: :serial, force: :cascade do |t|
838
+ t.integer "user_id"
839
+ t.integer "user_group_id"
840
+ t.integer "library_id"
842
841
  t.string "locale"
843
842
  t.string "user_number"
844
843
  t.text "full_name"
845
844
  t.text "note"
846
845
  t.text "keyword_list"
847
- t.bigint "required_role_id"
848
- t.datetime "created_at", null: false
849
- t.datetime "updated_at", null: false
846
+ t.integer "required_role_id"
847
+ t.datetime "created_at"
848
+ t.datetime "updated_at"
850
849
  t.string "checkout_icalendar_token"
851
850
  t.boolean "save_checkout_history", default: false, null: false
852
851
  t.datetime "expired_at"
@@ -880,23 +879,23 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
880
879
  t.index ["expression_id"], name: "index_realizes_on_expression_id"
881
880
  end
882
881
 
883
- create_table "request_status_types", force: :cascade do |t|
882
+ create_table "request_status_types", id: :serial, force: :cascade do |t|
884
883
  t.string "name", null: false
885
884
  t.text "display_name"
886
885
  t.text "note"
887
886
  t.integer "position"
888
- t.datetime "created_at", null: false
889
- t.datetime "updated_at", null: false
887
+ t.datetime "created_at"
888
+ t.datetime "updated_at"
890
889
  t.jsonb "display_name_translations", default: {}, null: false
891
890
  end
892
891
 
893
- create_table "request_types", force: :cascade do |t|
892
+ create_table "request_types", id: :serial, force: :cascade do |t|
894
893
  t.string "name", null: false
895
894
  t.text "display_name"
896
895
  t.text "note"
897
896
  t.integer "position"
898
- t.datetime "created_at", null: false
899
- t.datetime "updated_at", null: false
897
+ t.datetime "created_at"
898
+ t.datetime "updated_at"
900
899
  t.jsonb "display_name_translations", default: {}, null: false
901
900
  end
902
901
 
@@ -1024,7 +1023,7 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1024
1023
  t.index ["resource_import_file_id"], name: "index_resource_import_results_on_resource_import_file_id"
1025
1024
  end
1026
1025
 
1027
- create_table "roles", force: :cascade do |t|
1026
+ create_table "roles", id: :serial, force: :cascade do |t|
1028
1027
  t.string "name", null: false
1029
1028
  t.string "display_name"
1030
1029
  t.text "note"
@@ -1035,7 +1034,7 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1035
1034
  t.jsonb "display_name_translations", default: {}, null: false
1036
1035
  end
1037
1036
 
1038
- create_table "search_engines", force: :cascade do |t|
1037
+ create_table "search_engines", id: :serial, force: :cascade do |t|
1039
1038
  t.string "name", null: false
1040
1039
  t.text "display_name"
1041
1040
  t.string "url", null: false
@@ -1045,8 +1044,8 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1045
1044
  t.text "additional_param"
1046
1045
  t.text "note"
1047
1046
  t.integer "position"
1048
- t.datetime "created_at", null: false
1049
- t.datetime "updated_at", null: false
1047
+ t.datetime "created_at"
1048
+ t.datetime "updated_at"
1050
1049
  t.jsonb "display_name_translations", default: {}, null: false
1051
1050
  end
1052
1051
 
@@ -1089,39 +1088,41 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1089
1088
  t.index ["series_statement_identifier"], name: "index_series_statements_on_series_statement_identifier"
1090
1089
  end
1091
1090
 
1092
- create_table "shelves", force: :cascade do |t|
1091
+ create_table "shelves", id: :serial, force: :cascade do |t|
1093
1092
  t.string "name", null: false
1094
1093
  t.text "display_name"
1095
1094
  t.text "note"
1096
- t.bigint "library_id", null: false
1095
+ t.integer "library_id", null: false
1097
1096
  t.integer "items_count", default: 0, null: false
1098
1097
  t.integer "position"
1099
- t.datetime "created_at", null: false
1100
- t.datetime "updated_at", null: false
1098
+ t.datetime "created_at"
1099
+ t.datetime "updated_at"
1100
+ t.datetime "deleted_at"
1101
1101
  t.boolean "closed", default: false, null: false
1102
1102
  t.jsonb "display_name_translations", default: {}, null: false
1103
1103
  t.index ["library_id"], name: "index_shelves_on_library_id"
1104
1104
  end
1105
1105
 
1106
- create_table "subscribes", force: :cascade do |t|
1107
- t.bigint "subscription_id", null: false
1106
+ create_table "subscribes", id: :serial, force: :cascade do |t|
1107
+ t.integer "subscription_id", null: false
1108
1108
  t.integer "work_id", null: false
1109
1109
  t.datetime "start_at", null: false
1110
1110
  t.datetime "end_at", null: false
1111
- t.datetime "created_at", null: false
1112
- t.datetime "updated_at", null: false
1111
+ t.datetime "created_at"
1112
+ t.datetime "updated_at"
1113
1113
  t.index ["subscription_id"], name: "index_subscribes_on_subscription_id"
1114
1114
  t.index ["work_id"], name: "index_subscribes_on_work_id"
1115
1115
  end
1116
1116
 
1117
- create_table "subscriptions", force: :cascade do |t|
1117
+ create_table "subscriptions", id: :serial, force: :cascade do |t|
1118
1118
  t.text "title", null: false
1119
1119
  t.text "note"
1120
- t.bigint "user_id"
1121
- t.bigint "order_list_id"
1120
+ t.integer "user_id"
1121
+ t.integer "order_list_id"
1122
+ t.datetime "deleted_at"
1122
1123
  t.integer "subscribes_count", default: 0, null: false
1123
- t.datetime "created_at", null: false
1124
- t.datetime "updated_at", null: false
1124
+ t.datetime "created_at"
1125
+ t.datetime "updated_at"
1125
1126
  t.index ["order_list_id"], name: "index_subscriptions_on_order_list_id"
1126
1127
  t.index ["user_id"], name: "index_subscriptions_on_user_id"
1127
1128
  end
@@ -1159,13 +1160,13 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1159
1160
  t.index ["user_id"], name: "index_user_checkout_stats_on_user_id"
1160
1161
  end
1161
1162
 
1162
- create_table "user_export_file_transitions", force: :cascade do |t|
1163
+ create_table "user_export_file_transitions", id: :serial, force: :cascade do |t|
1163
1164
  t.string "to_state"
1164
1165
  t.text "metadata", default: "{}"
1165
1166
  t.integer "sort_key"
1166
- t.bigint "user_export_file_id"
1167
- t.datetime "created_at", null: false
1168
- t.datetime "updated_at", null: false
1167
+ t.integer "user_export_file_id"
1168
+ t.datetime "created_at"
1169
+ t.datetime "updated_at"
1169
1170
  t.boolean "most_recent", null: false
1170
1171
  t.index ["sort_key", "user_export_file_id"], name: "index_user_export_file_transitions_on_sort_key_and_file_id", unique: true
1171
1172
  t.index ["user_export_file_id", "most_recent"], name: "index_user_export_file_transitions_parent_most_recent", unique: true, where: "most_recent"
@@ -1173,15 +1174,15 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1173
1174
  t.index ["user_export_file_id"], name: "index_user_export_file_transitions_on_user_export_file_id"
1174
1175
  end
1175
1176
 
1176
- create_table "user_export_files", force: :cascade do |t|
1177
- t.bigint "user_id"
1177
+ create_table "user_export_files", id: :serial, force: :cascade do |t|
1178
+ t.integer "user_id"
1178
1179
  t.string "user_export_file_name"
1179
1180
  t.string "user_export_content_type"
1180
1181
  t.bigint "user_export_file_size"
1181
1182
  t.datetime "user_export_updated_at"
1182
1183
  t.datetime "executed_at"
1183
- t.datetime "created_at", null: false
1184
- t.datetime "updated_at", null: false
1184
+ t.datetime "created_at"
1185
+ t.datetime "updated_at"
1185
1186
  t.index ["user_id"], name: "index_user_export_files_on_user_id"
1186
1187
  end
1187
1188
 
@@ -1204,13 +1205,14 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1204
1205
  t.index ["user_group_id"], name: "index_user_group_has_checkout_types_on_user_group_id"
1205
1206
  end
1206
1207
 
1207
- create_table "user_groups", force: :cascade do |t|
1208
+ create_table "user_groups", id: :serial, force: :cascade do |t|
1208
1209
  t.string "name"
1209
1210
  t.text "display_name"
1210
1211
  t.text "note"
1211
1212
  t.integer "position"
1212
- t.datetime "created_at", null: false
1213
- t.datetime "updated_at", null: false
1213
+ t.datetime "created_at"
1214
+ t.datetime "updated_at"
1215
+ t.datetime "deleted_at"
1214
1216
  t.integer "valid_period_for_new_user", default: 0, null: false
1215
1217
  t.datetime "expired_at"
1216
1218
  t.integer "number_of_day_to_notify_overdue", default: 1, null: false
@@ -1219,30 +1221,30 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1219
1221
  t.jsonb "display_name_translations", default: {}, null: false
1220
1222
  end
1221
1223
 
1222
- create_table "user_has_roles", force: :cascade do |t|
1223
- t.bigint "user_id", null: false
1224
- t.bigint "role_id", null: false
1225
- t.datetime "created_at", null: false
1226
- t.datetime "updated_at", null: false
1224
+ create_table "user_has_roles", id: :serial, force: :cascade do |t|
1225
+ t.integer "user_id", null: false
1226
+ t.integer "role_id", null: false
1227
+ t.datetime "created_at"
1228
+ t.datetime "updated_at"
1227
1229
  t.index ["role_id"], name: "index_user_has_roles_on_role_id"
1228
1230
  t.index ["user_id"], name: "index_user_has_roles_on_user_id"
1229
1231
  end
1230
1232
 
1231
- create_table "user_import_file_transitions", force: :cascade do |t|
1233
+ create_table "user_import_file_transitions", id: :serial, force: :cascade do |t|
1232
1234
  t.string "to_state"
1233
1235
  t.text "metadata", default: "{}"
1234
1236
  t.integer "sort_key"
1235
- t.bigint "user_import_file_id"
1236
- t.datetime "created_at", null: false
1237
- t.datetime "updated_at", null: false
1237
+ t.integer "user_import_file_id"
1238
+ t.datetime "created_at"
1239
+ t.datetime "updated_at"
1238
1240
  t.boolean "most_recent", null: false
1239
1241
  t.index ["sort_key", "user_import_file_id"], name: "index_user_import_file_transitions_on_sort_key_and_file_id", unique: true
1240
1242
  t.index ["user_import_file_id", "most_recent"], name: "index_user_import_file_transitions_parent_most_recent", unique: true, where: "most_recent"
1241
1243
  t.index ["user_import_file_id"], name: "index_user_import_file_transitions_on_user_import_file_id"
1242
1244
  end
1243
1245
 
1244
- create_table "user_import_files", force: :cascade do |t|
1245
- t.bigint "user_id"
1246
+ create_table "user_import_files", id: :serial, force: :cascade do |t|
1247
+ t.integer "user_id"
1246
1248
  t.text "note"
1247
1249
  t.datetime "executed_at"
1248
1250
  t.string "user_import_file_name"
@@ -1252,22 +1254,20 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1252
1254
  t.string "user_import_fingerprint"
1253
1255
  t.string "edit_mode"
1254
1256
  t.text "error_message"
1255
- t.datetime "created_at", null: false
1256
- t.datetime "updated_at", null: false
1257
+ t.datetime "created_at"
1258
+ t.datetime "updated_at"
1257
1259
  t.string "user_encoding"
1258
- t.bigint "default_library_id"
1259
- t.bigint "default_user_group_id"
1260
- t.index ["default_library_id"], name: "index_user_import_files_on_default_library_id"
1261
- t.index ["default_user_group_id"], name: "index_user_import_files_on_default_user_group_id"
1260
+ t.integer "default_library_id"
1261
+ t.integer "default_user_group_id"
1262
1262
  t.index ["user_id"], name: "index_user_import_files_on_user_id"
1263
1263
  end
1264
1264
 
1265
- create_table "user_import_results", force: :cascade do |t|
1266
- t.bigint "user_import_file_id"
1267
- t.bigint "user_id"
1265
+ create_table "user_import_results", id: :serial, force: :cascade do |t|
1266
+ t.integer "user_import_file_id"
1267
+ t.integer "user_id"
1268
1268
  t.text "body"
1269
- t.datetime "created_at", null: false
1270
- t.datetime "updated_at", null: false
1269
+ t.datetime "created_at"
1270
+ t.datetime "updated_at"
1271
1271
  t.text "error_message"
1272
1272
  t.index ["user_id"], name: "index_user_import_results_on_user_id"
1273
1273
  t.index ["user_import_file_id"], name: "index_user_import_results_on_user_import_file_id"
@@ -1311,6 +1311,7 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1311
1311
  t.datetime "created_at"
1312
1312
  t.datetime "updated_at"
1313
1313
  t.string "username"
1314
+ t.datetime "deleted_at"
1314
1315
  t.datetime "expired_at"
1315
1316
  t.integer "failed_attempts", default: 0
1316
1317
  t.string "unlock_token"
@@ -1324,10 +1325,10 @@ ActiveRecord::Schema.define(version: 2019_12_16_131755) do
1324
1325
  t.index ["username"], name: "index_users_on_username", unique: true
1325
1326
  end
1326
1327
 
1327
- create_table "withdraws", force: :cascade do |t|
1328
- t.bigint "basket_id"
1329
- t.bigint "item_id"
1330
- t.bigint "librarian_id"
1328
+ create_table "withdraws", id: :serial, force: :cascade do |t|
1329
+ t.integer "basket_id"
1330
+ t.integer "item_id"
1331
+ t.integer "librarian_id"
1331
1332
  t.datetime "created_at", null: false
1332
1333
  t.datetime "updated_at", null: false
1333
1334
  t.index ["basket_id"], name: "index_withdraws_on_basket_id"