enju_seed 0.4.0.rc.1 → 0.4.0.rc.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  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 +3 -3
  6. data/app/models/profile.rb +9 -9
  7. data/app/models/role.rb +2 -2
  8. data/app/models/user_has_role.rb +6 -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 +1 -2
  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/version.rb +1 -1
  19. data/spec/dummy/app/models/user.rb +1 -1
  20. data/spec/dummy/db/migrate/059_create_libraries.rb +1 -2
  21. data/spec/dummy/db/migrate/069_create_shelves.rb +1 -2
  22. data/spec/dummy/db/migrate/077_create_user_groups.rb +1 -2
  23. data/spec/dummy/db/migrate/080_create_library_groups.rb +1 -1
  24. data/spec/dummy/db/migrate/120_create_baskets.rb +1 -1
  25. data/spec/dummy/db/migrate/124_create_bookstores.rb +1 -2
  26. data/spec/dummy/db/migrate/130_create_request_status_types.rb +1 -1
  27. data/spec/dummy/db/migrate/131_create_request_types.rb +1 -1
  28. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +1 -2
  29. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +1 -1
  30. data/spec/dummy/db/migrate/20081023092436_create_search_engines.rb +1 -1
  31. data/spec/dummy/db/migrate/20100211105551_add_admin_networks_to_library_group.rb +1 -1
  32. data/spec/dummy/db/migrate/20100314190054_add_opening_hour_to_library.rb +1 -1
  33. data/spec/dummy/db/migrate/20110222073537_add_url_to_library_group.rb +1 -1
  34. data/spec/dummy/db/migrate/20110318183304_add_valid_period_for_new_user_to_user_group.rb +1 -1
  35. data/spec/dummy/db/migrate/20120105074911_add_isil_to_library.rb +1 -1
  36. data/spec/dummy/db/migrate/20120129014038_create_budget_types.rb +1 -1
  37. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +1 -1
  38. data/spec/dummy/db/migrate/20120510140958_add_closed_to_shelf.rb +1 -1
  39. data/spec/dummy/db/migrate/20130412083556_add_latitude_and_longitude_to_library.rb +1 -1
  40. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
  41. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +1 -1
  42. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +2 -6
  43. data/spec/dummy/db/migrate/20140628072217_add_user_encoding_to_user_import_file.rb +1 -1
  44. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +1 -1
  45. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +2 -6
  46. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
  47. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
  48. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +1 -1
  49. data/spec/dummy/db/migrate/20150221063719_add_settings_to_library_group.rb +1 -1
  50. data/spec/dummy/db/migrate/20150506105356_add_error_message_to_user_import_result.rb +1 -1
  51. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +1 -1
  52. data/spec/dummy/db/migrate/20160610093229_add_html_snippet_to_library_group.rb +1 -1
  53. data/spec/dummy/db/migrate/20160627232219_add_most_recent_to_user_import_file_transitions.rb +1 -1
  54. data/spec/dummy/db/migrate/20160627232316_add_most_recent_to_user_export_file_transitions.rb +1 -1
  55. data/spec/dummy/db/migrate/20160813191647_add_max_number_of_results_to_library_group.rb +1 -1
  56. data/spec/dummy/db/migrate/20160813191733_add_family_name_first_to_library_group.rb +1 -1
  57. data/spec/dummy/db/migrate/20160813192542_add_pub_year_facet_range_interval_to_library_group.rb +1 -1
  58. data/spec/dummy/db/migrate/20160813203039_add_user_id_to_library_group.rb +1 -1
  59. data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +1 -1
  60. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +1 -1
  61. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +1 -1
  62. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +1 -1
  63. data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +1 -1
  64. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +1 -1
  65. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +1 -1
  66. data/spec/dummy/db/migrate/20191216131755_add_email_to_library_group.rb +6 -0
  67. data/spec/dummy/db/schema.rb +100 -101
  68. data/spec/dummy/db/test.sqlite3 +0 -0
  69. data/spec/fixtures/profiles.yml +7 -7
  70. data/spec/fixtures/roles.yml +1 -1
  71. data/spec/fixtures/user_has_roles.yml +5 -5
  72. data/spec/models/profile_spec.rb +7 -7
  73. data/spec/models/role_spec.rb +1 -1
  74. data/spec/models/user_has_role_spec.rb +5 -5
  75. metadata +257 -253
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3eb7783992df08a7f2b7ffa7d88c8301bdd6420e1642169cb6dbb57d7746790
4
- data.tar.gz: 2626fd3315092d7af9ead73d5cafb47cc83ec1a5f067d1aa4d1ef44a6396dde2
3
+ metadata.gz: 77bf05eb53d054c79b891f6970a7e80277be554a4f4ce49588cc7836a2506f8a
4
+ data.tar.gz: 2b925b9a23968bd6a08ba40214e09523902e470da8ccc3e7ad5c43e3b5843134
5
5
  SHA512:
6
- metadata.gz: 79c4094fb4962cc4fa22892ca087ad4bad144b0d80a8d81e460dae9be21f93691b5d24fed3ab85cdfbfdf543942ea5e30817fe2629705880fdba8e48b80b1c04
7
- data.tar.gz: cee4b40822562a0e03f523dc5790c46ad0e8e957fae71f00fc792f5fb110454fa7e834596f86d278711ce75c2b86cb74f75fc29056f854cdbf0367d9d303e8ff
6
+ metadata.gz: fc7a73ccff4bf3621c210082b8856b633655e794f5c6efd04153d62e28cf88ae6522d0e428e1c8d8f6a626c5f9e5613dbf3c6e3e0719470201bd0e2e541bb4ad
7
+ data.tar.gz: d9d5d19fa8b23b459b14964e3bc68de2094931faa5b41bdcffba4bd835e49f64f3295d7374f8320e2ede400f78a29a2303f026e6b8929b20971a93ae53c0ae26
data/README.md CHANGED
@@ -1,5 +1,5 @@
1
1
  # EnjuSeed
2
- ![](https://github.com/next-l/enju_seed/workflows/Ruby/badge.svg?branch=2.x)
2
+ [![CircleCI](https://circleci.com/gh/next-l/enju_seed/tree/2.x.svg?style=svg)](https://circleci.com/gh/next-l/enju_seed/tree/2.x)
3
3
  [![Coverage Status](https://coveralls.io/repos/github/next-l/enju_seed/badge.svg?branch=2.x)](https://coveralls.io/github/next-l/enju_seed?branch=2.x)
4
4
 
5
5
  This project rocks and uses MIT-LICENSE.
@@ -8,7 +8,7 @@ class ProfilesController < ApplicationController
8
8
  # GET /profiles.json
9
9
  def index
10
10
  if params[:username].present?
11
- profile = User.where(username: params[:username]).first.try(:profile)
11
+ profile = User.find_by(username: params[:username]).try(:profile)
12
12
  if profile
13
13
  redirect_to profile
14
14
  return
@@ -116,7 +116,7 @@ class ProfilesController < ApplicationController
116
116
  respond_to do |format|
117
117
  if @profile.save
118
118
  if @profile.user
119
- @profile.user.role = Role.where(name: 'User').first
119
+ @profile.user.role = Role.find_by(name: 'User')
120
120
  flash[:temporary_password] = password
121
121
  end
122
122
  format.html { redirect_to @profile, notice: t('controller.successfully_created', model: t('activerecord.models.profile')) }
@@ -132,7 +132,7 @@ class ProfilesController < ApplicationController
132
132
  # PUT /profiles/1
133
133
  # PUT /profiles/1.json
134
134
  def update
135
- @profile.update_attributes(profile_update_params)
135
+ @profile.update(profile_update_params)
136
136
  if @profile.user
137
137
  if @profile.user.auto_generated_password == "1"
138
138
  password = @profile.user.set_auto_generated_password
@@ -35,7 +35,7 @@ class RolesController < ApplicationController
35
35
  end
36
36
 
37
37
  respond_to do |format|
38
- if @role.update_attributes(role_params)
38
+ if @role.update(role_params)
39
39
  format.html { redirect_to @role, notice: t('controller.successfully_updated', model: t('activerecord.models.role')) }
40
40
  format.json { head :no_content }
41
41
  else
@@ -176,7 +176,7 @@ module EnjuSeed
176
176
  # @return [Object]
177
177
  def check_role_before_destroy
178
178
  if has_role?('Administrator')
179
- if Role.where(name: 'Administrator').first.users.count == 1
179
+ if Role.find_by(name: 'Administrator').users.count == 1
180
180
  raise username + 'This is the last administrator in this system.'
181
181
  end
182
182
  end
@@ -209,7 +209,7 @@ module EnjuSeed
209
209
  # @return [Boolean]
210
210
  def last_librarian?
211
211
  if has_role?('Librarian')
212
- role = Role.where(name: 'Librarian').first
212
+ role = Role.find_by(name: 'Librarian')
213
213
  return true if role.users.count == 1
214
214
  false
215
215
  end
@@ -244,7 +244,7 @@ module EnjuSeed
244
244
 
245
245
  # 最後の管理者を削除しようとした
246
246
  if has_role?('Administrator')
247
- if Role.where(name: 'Administrator').first.users.count == 1
247
+ if Role.find_by(name: 'Administrator').users.count == 1
248
248
  errors[:base] << I18n.t('user.last_administrator')
249
249
  end
250
250
  end
@@ -1,4 +1,4 @@
1
- class Profile < ActiveRecord::Base
1
+ class Profile < ApplicationRecord
2
2
  scope :administrators, -> { joins(user: :role).where('roles.name = ?', 'Administrator') }
3
3
  scope :librarians, -> { joins(user: :role).where('roles.name = ? OR roles.name = ?', 'Administrator', 'Librarian') }
4
4
  belongs_to :user, dependent: :destroy, optional: true
@@ -50,7 +50,7 @@ class Profile < ActiveRecord::Base
50
50
  # 既定のユーザ権限を設定します。
51
51
  # @return [void]
52
52
  def set_role_and_agent
53
- self.required_role = Role.where(name: 'Librarian').first unless required_role
53
+ self.required_role = Role.find_by(name: 'Librarian') unless required_role
54
54
  self.locale = I18n.default_locale.to_s unless locale
55
55
  end
56
56
 
@@ -77,18 +77,18 @@ end
77
77
  #
78
78
  # Table name: profiles
79
79
  #
80
- # id :integer not null, primary key
81
- # user_id :integer
82
- # user_group_id :integer
83
- # library_id :integer
80
+ # id :bigint not null, primary key
81
+ # user_id :bigint
82
+ # user_group_id :bigint
83
+ # library_id :bigint
84
84
  # locale :string
85
85
  # user_number :string
86
86
  # full_name :text
87
87
  # note :text
88
88
  # keyword_list :text
89
- # required_role_id :integer
90
- # created_at :datetime
91
- # updated_at :datetime
89
+ # required_role_id :bigint
90
+ # created_at :datetime not null
91
+ # updated_at :datetime not null
92
92
  # checkout_icalendar_token :string
93
93
  # save_checkout_history :boolean default(FALSE), not null
94
94
  # expired_at :datetime
@@ -1,4 +1,4 @@
1
- class Role < ActiveRecord::Base
1
+ class Role < ApplicationRecord
2
2
  include MasterModel
3
3
  validates :name, presence: true, format: { with: /\A[A-Za-z][a-z_,]*[a-z]\z/ }
4
4
  has_many :user_has_roles
@@ -22,7 +22,7 @@ end
22
22
  #
23
23
  # Table name: roles
24
24
  #
25
- # id :integer not null, primary key
25
+ # id :bigint not null, primary key
26
26
  # name :string not null
27
27
  # display_name :string
28
28
  # note :text
@@ -1,4 +1,4 @@
1
- class UserHasRole < ActiveRecord::Base
1
+ class UserHasRole < ApplicationRecord
2
2
  belongs_to :user
3
3
  belongs_to :role
4
4
  accepts_nested_attributes_for :role
@@ -8,9 +8,9 @@ end
8
8
  #
9
9
  # Table name: user_has_roles
10
10
  #
11
- # id :integer not null, primary key
12
- # user_id :integer not null
13
- # role_id :integer not null
14
- # created_at :datetime
15
- # updated_at :datetime
11
+ # id :bigint not null, primary key
12
+ # user_id :bigint not null
13
+ # role_id :bigint not null
14
+ # created_at :datetime not null
15
+ # updated_at :datetime not null
16
16
  #
@@ -3,7 +3,7 @@
3
3
 
4
4
  <div class="field">
5
5
  <%= f.label :name %><br />
6
- <%= f.text_field :name %>
6
+ <%= f.text_field :name, required: true %>
7
7
  </div>
8
8
  <div class="field">
9
9
  <%= f.label :display_name %><br />
@@ -1,4 +1,4 @@
1
- class CreateRoles < ActiveRecord::Migration[4.2]
1
+ class CreateRoles < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table "roles" do |t|
4
4
  t.column :name, :string, null: false
@@ -1,4 +1,4 @@
1
- class CreateUserHasRoles < ActiveRecord::Migration[4.2]
1
+ class CreateUserHasRoles < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :user_has_roles do |t|
4
4
  t.references :user, index: true, foreign_key: true, null: false
@@ -1,7 +1,6 @@
1
- class AddAdditionalAttributesToUser < ActiveRecord::Migration[4.2]
1
+ class AddAdditionalAttributesToUser < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :users, :username, :string
4
- add_column :users, :deleted_at, :datetime
5
4
  add_column :users, :expired_at, :datetime
6
5
 
7
6
  add_column :users, :failed_attempts, :integer, default: 0
@@ -1,4 +1,4 @@
1
- class CreateProfiles < ActiveRecord::Migration[4.2]
1
+ class CreateProfiles < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :profiles do |t|
4
4
  t.references :user, index: true, foreign_key: true
@@ -1,4 +1,4 @@
1
- class DropEmailUniqueConstraintEnjuLeafRc10 < ActiveRecord::Migration[4.2]
1
+ class DropEmailUniqueConstraintEnjuLeafRc10 < ActiveRecord::Migration[5.2]
2
2
  def up
3
3
  remove_index :users, :email
4
4
  add_index :users, :email
@@ -1,4 +1,4 @@
1
- class AddExpiredAtToProfile < ActiveRecord::Migration[4.2]
1
+ class AddExpiredAtToProfile < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :profiles, :expired_at, :datetime
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddFullNameTranscriptionToProfile < ActiveRecord::Migration[4.2]
1
+ class AddFullNameTranscriptionToProfile < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :profiles, :full_name_transcription, :text
4
4
  end
@@ -1,4 +1,4 @@
1
- class AddDateOfBirthToProfile < ActiveRecord::Migration[4.2]
1
+ class AddDateOfBirthToProfile < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :profiles, :date_of_birth, :datetime
4
4
  end
@@ -1,3 +1,3 @@
1
1
  module EnjuSeed
2
- VERSION = "0.4.0.rc.1"
2
+ VERSION = "0.4.0.rc.2".freeze
3
3
  end
@@ -1,4 +1,4 @@
1
- class User < ActiveRecord::Base
1
+ class User < ApplicationRecord
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[4.2]
1
+ class CreateLibraries < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :libraries do |t|
4
4
  t.string :name, index: true, null: false
@@ -20,7 +20,6 @@ class CreateLibraries < ActiveRecord::Migration[4.2]
20
20
  t.references :country
21
21
 
22
22
  t.timestamps
23
- t.datetime :deleted_at
24
23
  end
25
24
  end
26
25
  end
@@ -1,4 +1,4 @@
1
- class CreateShelves < ActiveRecord::Migration[4.2]
1
+ class CreateShelves < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :shelves do |t|
4
4
  t.string :name, null: false
@@ -8,7 +8,6 @@ class CreateShelves < ActiveRecord::Migration[4.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
12
11
  end
13
12
  end
14
13
  end
@@ -1,4 +1,4 @@
1
- class CreateUserGroups < ActiveRecord::Migration[4.2]
1
+ class CreateUserGroups < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :user_groups do |t|
4
4
  t.string :name, not_null: true
@@ -6,7 +6,6 @@ class CreateUserGroups < ActiveRecord::Migration[4.2]
6
6
  t.text :note
7
7
  t.integer :position
8
8
  t.timestamps
9
- t.datetime :deleted_at
10
9
  end
11
10
  end
12
11
  end
@@ -1,4 +1,4 @@
1
- class CreateLibraryGroups < ActiveRecord::Migration[4.2]
1
+ class CreateLibraryGroups < ActiveRecord::Migration[5.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[4.2]
1
+ class CreateBaskets < ActiveRecord::Migration[5.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[4.2]
1
+ class CreateBookstores < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :bookstores do |t|
4
4
  t.text :name, null: false
@@ -9,7 +9,6 @@ class CreateBookstores < ActiveRecord::Migration[4.2]
9
9
  t.string :fax_number
10
10
  t.string :url
11
11
  t.integer :position
12
- t.datetime :deleted_at
13
12
 
14
13
  t.timestamps
15
14
  end
@@ -1,4 +1,4 @@
1
- class CreateRequestStatusTypes < ActiveRecord::Migration[4.2]
1
+ class CreateRequestStatusTypes < ActiveRecord::Migration[5.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[4.2]
1
+ class CreateRequestTypes < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :request_types do |t|
4
4
  t.string :name, null: false
@@ -1,11 +1,10 @@
1
- class CreateSubscriptions < ActiveRecord::Migration[4.2]
1
+ class CreateSubscriptions < ActiveRecord::Migration[5.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
9
8
  t.integer :subscribes_count, default: 0, null: false
10
9
 
11
10
  t.timestamps
@@ -1,4 +1,4 @@
1
- class CreateSubscribes < ActiveRecord::Migration[4.2]
1
+ class CreateSubscribes < ActiveRecord::Migration[5.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[4.2]
1
+ class CreateSearchEngines < ActiveRecord::Migration[5.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[4.2]
1
+ class AddAdminNetworksToLibraryGroup < ActiveRecord::Migration[5.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[4.2]
1
+ class AddOpeningHourToLibrary < ActiveRecord::Migration[5.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[4.2]
1
+ class AddUrlToLibraryGroup < ActiveRecord::Migration[5.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[4.2]
1
+ class AddValidPeriodForNewUserToUserGroup < ActiveRecord::Migration[5.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[4.2]
1
+ class AddIsilToLibrary < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  add_column :libraries, :isil, :string
4
4
  end
@@ -1,4 +1,4 @@
1
- class CreateBudgetTypes < ActiveRecord::Migration[4.2]
1
+ class CreateBudgetTypes < ActiveRecord::Migration[5.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[4.2]
1
+ class CreateAccepts < ActiveRecord::Migration[5.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[4.2]
1
+ class AddClosedToShelf < ActiveRecord::Migration[5.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[4.2]
1
+ class AddLatitudeAndLongitudeToLibrary < ActiveRecord::Migration[5.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[4.2]
1
+ class CreateUserImportFiles < ActiveRecord::Migration[5.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[4.2]
1
+ class CreateUserImportResults < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :user_import_results do |t|
4
4
  t.references :user_import_file, index: true
@@ -1,12 +1,8 @@
1
- class CreateUserImportFileTransitions < ActiveRecord::Migration[4.2]
1
+ class CreateUserImportFileTransitions < ActiveRecord::Migration[5.2]
2
2
  def change
3
3
  create_table :user_import_file_transitions do |t|
4
4
  t.string :to_state
5
- if ActiveRecord::Base.configurations[Rails.env]["adapter"].try(:match, /mysql/)
6
- t.text :metadata
7
- else
8
- t.text :metadata, default: "{}"
9
- end
5
+ t.text :metadata, default: "{}"
10
6
  t.integer :sort_key
11
7
  t.references :user_import_file, index: true
12
8
  t.timestamps