enju_question 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +14 -0
  3. data/Rakefile +1 -1
  4. data/lib/enju_question/version.rb +1 -1
  5. data/spec/dummy/app/models/application_record.rb +3 -0
  6. data/spec/dummy/config/application.rb +1 -1
  7. data/spec/dummy/db/migrate/001_create_agents.rb +0 -2
  8. data/spec/dummy/db/migrate/005_create_manifestations.rb +3 -4
  9. data/spec/dummy/db/migrate/059_create_libraries.rb +3 -5
  10. data/spec/dummy/db/migrate/069_create_shelves.rb +1 -2
  11. data/spec/dummy/db/migrate/080_create_library_groups.rb +1 -2
  12. data/spec/dummy/db/migrate/120_create_baskets.rb +1 -2
  13. data/spec/dummy/db/migrate/20081006090811_create_subscriptions.rb +2 -5
  14. data/spec/dummy/db/migrate/20081006093246_create_subscribes.rb +1 -2
  15. data/spec/dummy/db/migrate/20081025083323_create_countries.rb +6 -5
  16. data/spec/dummy/db/migrate/20081025083905_create_languages.rb +1 -0
  17. data/spec/dummy/db/migrate/20081027150907_create_picture_files.rb +1 -3
  18. data/spec/dummy/db/migrate/20091012101112_add_dcndl_schema.rb +2 -2
  19. data/spec/dummy/db/migrate/20100925074559_create_agent_import_results.rb +0 -1
  20. data/spec/dummy/db/migrate/20120125152919_add_title_subseries_transcription_to_series_statement.rb +1 -0
  21. data/spec/dummy/db/migrate/20120129020544_add_budget_type_id_to_item.rb +1 -0
  22. data/spec/dummy/db/migrate/20120319120638_add_content_type_id_to_manifestation.rb +1 -0
  23. data/spec/dummy/db/migrate/20120319173203_create_accepts.rb +3 -6
  24. data/spec/dummy/db/migrate/20130506175834_create_identifiers.rb +1 -1
  25. data/spec/dummy/db/migrate/20140110122216_create_user_import_files.rb +1 -1
  26. data/spec/dummy/db/migrate/20140110131010_create_user_import_results.rb +2 -2
  27. data/spec/dummy/db/migrate/20140519170214_create_resource_import_file_transitions.rb +6 -2
  28. data/spec/dummy/db/migrate/20140519171220_create_import_request_transitions.rb +6 -2
  29. data/spec/dummy/db/migrate/20140524020735_create_agent_import_file_transitions.rb +6 -2
  30. data/spec/dummy/db/migrate/20140524074813_create_user_import_file_transitions.rb +2 -3
  31. data/spec/dummy/db/migrate/20140614141500_create_resource_export_file_transitions.rb +6 -2
  32. data/spec/dummy/db/migrate/20140709113413_create_user_export_files.rb +1 -1
  33. data/spec/dummy/db/migrate/20140709113905_create_user_export_file_transitions.rb +2 -2
  34. data/spec/dummy/db/migrate/20140720170714_add_default_library_id_to_user_import_file.rb +1 -1
  35. data/spec/dummy/db/migrate/20140720170735_add_default_user_group_id_to_user_import_file.rb +1 -1
  36. data/spec/dummy/db/migrate/20140813182425_add_publication_place_to_manifestation.rb +5 -0
  37. data/spec/dummy/db/migrate/20140821151023_create_colors.rb +1 -3
  38. data/spec/dummy/db/migrate/20140822114527_add_error_message_to_resource_import_result.rb +5 -0
  39. data/spec/dummy/db/migrate/20140823083524_add_extent_to_manifestation.rb +5 -0
  40. data/spec/dummy/db/migrate/20140823094847_add_dimensions_to_manifestation.rb +5 -0
  41. data/spec/dummy/db/migrate/20140823095740_rename_manifestation_periodical_to_serial.rb +9 -0
  42. data/spec/dummy/db/migrate/20150117111136_add_foreign_key_to_items_referencing_manifestations.rb +5 -0
  43. data/spec/dummy/db/migrate/20150924115059_create_withdraws.rb +3 -5
  44. data/spec/dummy/db/migrate/20151125004028_add_profile_id_to_agent.rb +6 -0
  45. data/spec/dummy/db/migrate/20151213070943_add_translation_table_to_library_group.rb +11 -5
  46. data/spec/dummy/db/migrate/20151213072705_add_footer_banner_to_library_group.rb +15 -2
  47. data/spec/dummy/db/migrate/20160801080612_add_most_recent_to_import_request_transitions.rb +9 -0
  48. data/spec/dummy/db/migrate/20160801080619_add_most_recent_to_resource_import_file_transitions.rb +9 -0
  49. data/spec/dummy/db/migrate/20160801080637_add_most_recent_to_resource_export_file_transitions.rb +9 -0
  50. data/spec/dummy/db/migrate/20160801080643_add_most_recent_to_agent_import_file_transitions.rb +9 -0
  51. data/spec/dummy/db/migrate/20160811102604_add_picture_width_to_picture_file.rb +6 -0
  52. data/spec/dummy/db/migrate/20160820004638_add_attachment_attachment_to_carrier_types.rb +11 -0
  53. data/spec/dummy/db/migrate/20170305064014_add_csv_charset_conversion_to_library_group.rb +5 -0
  54. data/spec/dummy/db/migrate/20171014084528_add_header_logo_to_library_group.rb +5 -0
  55. data/spec/dummy/db/migrate/20171119051258_set_not_null_to_manifestation_id_on_items.rb +5 -0
  56. data/spec/dummy/db/migrate/20171126133835_rename_login_banner_to_old_login_banner.rb +5 -0
  57. data/spec/dummy/db/migrate/20171126135238_add_foreign_key_to_library_group_id_on_library.rb +5 -0
  58. data/spec/dummy/db/migrate/20180102162311_add_header_logo_meta_to_library_group.rb +5 -0
  59. data/spec/dummy/db/migrate/20180107160726_add_constraints_to_most_recent_for_user_import_file_transitions.rb +13 -0
  60. data/spec/dummy/db/migrate/20180107160740_add_constraints_to_most_recent_for_user_export_file_transitions.rb +13 -0
  61. data/spec/dummy/db/migrate/20180107161311_add_constraints_to_most_recent_for_agent_import_file_transitions.rb +13 -0
  62. data/spec/dummy/db/migrate/20180107161331_add_constraints_to_most_recent_for_resource_import_file_transitions.rb +13 -0
  63. data/spec/dummy/db/migrate/20180107161347_add_constraints_to_most_recent_for_resource_export_file_transitions.rb +13 -0
  64. data/spec/dummy/db/migrate/20180107161410_add_constraints_to_most_recent_for_import_request_transitions.rb +13 -0
  65. data/spec/dummy/db/migrate/20190818075603_add_memo_to_manifestation.rb +5 -0
  66. data/spec/dummy/db/migrate/20190818075628_add_memo_to_item.rb +5 -0
  67. data/spec/dummy/db/migrate/20200425072340_create_manifestation_custom_properties.rb +12 -0
  68. data/spec/dummy/db/migrate/20200425072349_create_item_custom_properties.rb +12 -0
  69. data/spec/dummy/db/migrate/20200425074758_create_manifestation_custom_values.rb +12 -0
  70. data/spec/dummy/db/migrate/20200425074822_create_item_custom_values.rb +12 -0
  71. data/spec/dummy/db/schema.rb +89 -16
  72. data/spec/factories/profile.rb +11 -3
  73. data/spec/fixtures/library_groups.yml +37 -20
  74. data/spec/views/questions/index.rss.builder_spec.rb +1 -2
  75. metadata +116 -24
  76. data/README.rdoc +0 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 033a763f7dc9343c5002e4941528421c4654bae5d9430adc08c6222367873611
4
- data.tar.gz: eae0376c57975ee1ebef9bd895ea2942ad5fcd70c713998f4dec62a44006e9b6
3
+ metadata.gz: 1335440d268b07e23768f83fcc5fbee0ada2624a78ac756a76d398e4feae9295
4
+ data.tar.gz: 7532956a4f2fda224cc1e86d6953506572282af3530800ff03f1c917e4da5c4c
5
5
  SHA512:
6
- metadata.gz: 72c1152b9b6689a8f0bca4d99a4aa5c2235c730f5b18b513e683c9925f72e93e70f2ffe723646d141066e0a5271334323d19a61843e5998ad5cfbf134ed5a405
7
- data.tar.gz: 8dc736e60d6a7bcf7b22a78e8f83345b1374e90383be99d38809f1efe4230bab17b966f6594b11514ed9cbf11bf4ee0c0f0634e1c1afd96458f72d7ca8e7dffd
6
+ metadata.gz: 0fd0ae3a4e301f99b9f6e95bfe8559075ad1d802861bb2afffae080aa8dbaa153bb2738d2534149ed4e0664fea5c97cc250836940e6f779f1495f1ca087c955e
7
+ data.tar.gz: de109980848ed8107d27a54a72f80370a0bcead01894b43d05c2eaf5586eec5d13ab3001a82cdea0918ca6b5357f81026efbbe12d6fd4ee1b0a401c068c09157
@@ -0,0 +1,14 @@
1
+ # EnjuQuestion
2
+ [<img src="https://travis-ci.com/next-l/enju_question.svg?branch=1.3"
3
+ alt="Build Status" />](https://travis-ci.com/next-l/enju_question) [<img
4
+ src="https://coveralls.io/repos/next-l/enju_question/badge.svg?branch=1.3&serv
5
+ ice=github" alt="Coverage Status"
6
+ />](https://coveralls.io/github/next-l/enju_question?branch=1.3) [<img
7
+ src="https://hakiri.io/github/next-l/enju_question/1.3.svg" alt="security"
8
+ />](https://hakiri.io/github/next-l/enju_question/1.3)
9
+
10
+ This project rocks and uses MIT-LICENSE.
11
+
12
+ ## 製作者・貢献者 (Authors and contributors)
13
+ * [TANABE, Kosuke](https://github.com/nabeta) ([@nabeta](https://twitter.com/nabeta))
14
+ * [Project Next-L](https://www.next-l.jp) ([@ProjectNextL](https://twitter.com/ProjectNextL))
data/Rakefile CHANGED
@@ -16,7 +16,7 @@ RDoc::Task.new(:rdoc) do |rdoc|
16
16
  rdoc.rdoc_dir = 'rdoc'
17
17
  rdoc.title = 'EnjuQuestion'
18
18
  rdoc.options << '--line-numbers'
19
- rdoc.rdoc_files.include('README.rdoc')
19
+ rdoc.rdoc_files.include('README.md')
20
20
  rdoc.rdoc_files.include('lib/**/*.rb')
21
21
  end
22
22
 
@@ -1,3 +1,3 @@
1
1
  module EnjuQuestion
2
- VERSION = "0.3.1"
2
+ VERSION = "0.3.2".freeze
3
3
  end
@@ -0,0 +1,3 @@
1
+ class ApplicationRecord < ActiveRecord::Base
2
+ self.abstract_class = true
3
+ end
@@ -11,7 +11,7 @@ require "enju_bookmark"
11
11
  module Dummy
12
12
  class Application < Rails::Application
13
13
  # Initialize configuration defaults for originally generated Rails version.
14
- config.load_defaults 5.1
14
+ config.load_defaults 5.2
15
15
 
16
16
  # Settings in config/environments/* take precedence over those specified here.
17
17
  # Application configuration should go into files in config/initializers
@@ -1,7 +1,6 @@
1
1
  class CreateAgents < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :agents do |t|
4
- t.integer :user_id
5
4
  t.string :last_name
6
5
  t.string :middle_name
7
6
  t.string :first_name
@@ -43,7 +42,6 @@ class CreateAgents < ActiveRecord::Migration[4.2]
43
42
  t.text :email
44
43
  t.text :url
45
44
  end
46
- add_index :agents, :user_id, unique: true
47
45
  add_index :agents, :language_id
48
46
  add_index :agents, :country_id
49
47
  add_index :agents, :required_role_id
@@ -13,7 +13,6 @@ class CreateManifestations < ActiveRecord::Migration[4.2]
13
13
  t.string :access_address
14
14
  t.integer :language_id, default: 1, null: false
15
15
  t.integer :carrier_type_id, default: 1, null: false
16
- t.integer :extent_id, default: 1, null: false
17
16
  t.integer :start_page
18
17
  t.integer :end_page
19
18
  t.integer :height
@@ -33,10 +32,10 @@ class CreateManifestations < ActiveRecord::Migration[4.2]
33
32
  t.integer :frequency_id, default: 1, null: false
34
33
  t.boolean :subscription_master, default: false, null: false
35
34
  end
36
- # add_index :manifestations, :carrier_type_id
37
- # add_index :manifestations, :required_role_id
35
+ #add_index :manifestations, :carrier_type_id
36
+ #add_index :manifestations, :required_role_id
38
37
  add_index :manifestations, :access_address
39
- # add_index :manifestations, :frequency_id
38
+ #add_index :manifestations, :frequency_id
40
39
  add_index :manifestations, :manifestation_identifier
41
40
  add_index :manifestations, :updated_at
42
41
  add_index :manifestations, :date_of_publication
@@ -1,7 +1,7 @@
1
1
  class CreateLibraries < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :libraries do |t|
4
- t.string :name, null: false
4
+ t.string :name, index: true, null: false
5
5
  t.text :display_name
6
6
  t.string :short_display_name, null: false
7
7
  t.string :zip_code
@@ -14,15 +14,13 @@ class CreateLibraries < ActiveRecord::Migration[4.2]
14
14
  t.text :note
15
15
  t.integer :call_number_rows, default: 1, null: false
16
16
  t.string :call_number_delimiter, default: "|", null: false
17
- t.integer :library_group_id, default: 1, null: false
17
+ t.references :library_group, index: true, null: false
18
18
  t.integer :users_count, default: 0, null: false
19
19
  t.integer :position
20
- t.integer :country_id
20
+ t.references :country
21
21
 
22
22
  t.timestamps
23
23
  t.datetime :deleted_at
24
24
  end
25
- add_index :libraries, :library_group_id
26
- add_index :libraries, :name, unique: true
27
25
  end
28
26
  end
@@ -4,12 +4,11 @@ class CreateShelves < ActiveRecord::Migration[4.2]
4
4
  t.string :name, null: false
5
5
  t.text :display_name
6
6
  t.text :note
7
- t.integer :library_id, default: 1, null: false
7
+ t.references :library, index: true, null: false
8
8
  t.integer :items_count, default: 0, null: false
9
9
  t.integer :position
10
10
  t.timestamps
11
11
  t.datetime :deleted_at
12
12
  end
13
- add_index :shelves, :library_id
14
13
  end
15
14
  end
@@ -3,7 +3,7 @@ class CreateLibraryGroups < ActiveRecord::Migration[4.2]
3
3
  create_table :library_groups do |t|
4
4
  t.string :name, null: false
5
5
  t.text :display_name
6
- t.string :short_name, null: false
6
+ t.string :short_name, index: true, null: false
7
7
  t.text :my_networks
8
8
  t.text :login_banner
9
9
  t.text :note
@@ -12,6 +12,5 @@ class CreateLibraryGroups < ActiveRecord::Migration[4.2]
12
12
 
13
13
  t.timestamps
14
14
  end
15
- add_index :library_groups, :short_name
16
15
  end
17
16
  end
@@ -1,12 +1,11 @@
1
1
  class CreateBaskets < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :baskets do |t|
4
- t.integer :user_id
4
+ t.references :user, index: true
5
5
  t.text :note
6
6
  t.integer :lock_version, default: 0, null: false
7
7
 
8
8
  t.timestamps
9
9
  end
10
- add_index :baskets, :user_id
11
10
  end
12
11
  end
@@ -3,15 +3,12 @@ class CreateSubscriptions < ActiveRecord::Migration[4.2]
3
3
  create_table :subscriptions do |t|
4
4
  t.text :title, null: false
5
5
  t.text :note
6
- # t.integer :subscription_list_id, :integer
7
- t.integer :user_id
8
- t.integer :order_list_id
6
+ t.references :user, index: true
7
+ t.references :order_list, index: true
9
8
  t.datetime :deleted_at
10
9
  t.integer :subscribes_count, default: 0, null: false
11
10
 
12
11
  t.timestamps
13
12
  end
14
- add_index :subscriptions, :user_id
15
- add_index :subscriptions, :order_list_id
16
13
  end
17
14
  end
@@ -1,14 +1,13 @@
1
1
  class CreateSubscribes < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :subscribes do |t|
4
- t.integer :subscription_id, null: false
4
+ t.references :subscription, index: true, null: false
5
5
  t.integer :work_id, null: false
6
6
  t.datetime :start_at, null: false
7
7
  t.datetime :end_at, null: false
8
8
 
9
9
  t.timestamps
10
10
  end
11
- add_index :subscribes, :subscription_id
12
11
  add_index :subscribes, :work_id
13
12
  end
14
13
  end
@@ -1,17 +1,18 @@
1
1
  class CreateCountries < ActiveRecord::Migration[4.2]
2
+
2
3
  # ISO 3166 is the International Standard for country codes.
3
4
  #
4
- # ISO 3166-1:2006 Codes for the representation of names of countries and their subdivisions - Part 1:
5
- # Country codes which is what most users know as ISO's country codes. First published in 1974, it is has since
6
- # then become one of the world's most popular and most widely used standard solution for coding country names.
7
- # It contains a two-letter code which is recommended as the general purpose code, a three-letter code which has
5
+ # ISO 3166-1:2006 Codes for the representation of names of countries and their subdivisions - Part 1:
6
+ # Country codes which is what most users know as ISO's country codes. First published in 1974, it is has since
7
+ # then become one of the world's most popular and most widely used standard solution for coding country names.
8
+ # It contains a two-letter code which is recommended as the general purpose code, a three-letter code which has
8
9
  # better mnenomic properties and a numeric-3 code which can be useful if script independence of the codes is important.
9
10
  #
10
11
  # http://www.iso.org/iso/country_codes/background_on_iso_3166/what_is_iso_3166.htm
11
12
 
12
13
  def change
13
14
  create_table :countries do |t|
14
- t.string :name, size: 80, null: false
15
+ t.string :name, size: 80, null: false
15
16
  t.text :display_name
16
17
  t.string :alpha_2, size: 2
17
18
  t.string :alpha_3, size: 3
@@ -1,4 +1,5 @@
1
1
  class CreateLanguages < ActiveRecord::Migration[4.2]
2
+
2
3
  # ISO 639 is the set of international standards that lists short codes for language names.
3
4
  # Note this doesn't include macrolanguages (dialects)
4
5
  # Information on macrolanguages http://en.wikipedia.org/wiki/ISO_639_macrolanguage
@@ -3,13 +3,11 @@ class CreatePictureFiles < ActiveRecord::Migration[4.2]
3
3
  create_table :picture_files do |t|
4
4
  t.integer :picture_attachable_id
5
5
  t.string :picture_attachable_type
6
- t.string :content_type
7
6
  t.text :title
8
- t.string :thumbnail
9
7
  t.integer :position
10
8
 
11
9
  t.timestamps
12
10
  end
13
- add_index :picture_files, %i[picture_attachable_id picture_attachable_type], name: "index_picture_files_on_picture_attachable_id_and_type"
11
+ add_index :picture_files, [:picture_attachable_id, :picture_attachable_type], name: "index_picture_files_on_picture_attachable_id_and_type"
14
12
  end
15
13
  end
@@ -8,7 +8,7 @@ class AddDcndlSchema < ActiveRecord::Migration[4.2]
8
8
  add_column :manifestations, :valid_until, :timestamp
9
9
  add_column :manifestations, :date_submitted, :timestamp
10
10
  add_column :manifestations, :date_accepted, :timestamp
11
- add_column :manifestations, :date_caputured, :timestamp
11
+ add_column :manifestations, :date_captured, :timestamp
12
12
  rename_column :manifestations, :copyright_date, :date_copyrighted
13
13
  end
14
14
 
@@ -21,7 +21,7 @@ class AddDcndlSchema < ActiveRecord::Migration[4.2]
21
21
  remove_column :manifestations, :valid_until
22
22
  remove_column :manifestations, :date_submitted
23
23
  remove_column :manifestations, :date_accepted
24
- remove_column :manifestations, :date_caputured
24
+ remove_column :manifestations, :date_captured
25
25
  rename_column :manifestations, :date_copyrighted, :copyright_date
26
26
  end
27
27
  end
@@ -3,7 +3,6 @@ class CreateAgentImportResults < ActiveRecord::Migration[4.2]
3
3
  create_table :agent_import_results do |t|
4
4
  t.integer :agent_import_file_id
5
5
  t.integer :agent_id
6
- t.integer :user_id
7
6
  t.text :body
8
7
 
9
8
  t.timestamps
@@ -1,5 +1,6 @@
1
1
  class AddTitleSubseriesTranscriptionToSeriesStatement < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :series_statements, :title_subseries_transcription, :text
4
+
4
5
  end
5
6
  end
@@ -1,5 +1,6 @@
1
1
  class AddBudgetTypeIdToItem < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :items, :budget_type_id, :integer
4
+
4
5
  end
5
6
  end
@@ -1,5 +1,6 @@
1
1
  class AddContentTypeIdToManifestation < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  add_column :manifestations, :content_type_id, :integer, default: 1
4
+
4
5
  end
5
6
  end
@@ -1,14 +1,11 @@
1
1
  class CreateAccepts < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :accepts do |t|
4
- t.integer :basket_id
5
- t.integer :item_id
6
- t.integer :librarian_id
4
+ t.references :basket, index: true
5
+ t.references :item, index: true
6
+ t.references :librarian, index: true
7
7
 
8
8
  t.timestamps
9
9
  end
10
-
11
- add_index :accepts, :basket_id
12
- add_index :accepts, :item_id
13
10
  end
14
11
  end
@@ -9,7 +9,7 @@ class CreateIdentifiers < ActiveRecord::Migration[4.2]
9
9
 
10
10
  t.timestamps
11
11
  end
12
- add_index :identifiers, %i[body identifier_type_id]
12
+ add_index :identifiers, [:body, :identifier_type_id]
13
13
  add_index :identifiers, :manifestation_id
14
14
  end
15
15
  end
@@ -1,7 +1,7 @@
1
1
  class CreateUserImportFiles < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_import_files do |t|
4
- t.integer :user_id
4
+ t.references :user, index: true
5
5
  t.text :note
6
6
  t.datetime :executed_at
7
7
  t.string :user_import_file_name
@@ -1,8 +1,8 @@
1
1
  class CreateUserImportResults < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :user_import_results do |t|
4
- t.integer :user_import_file_id
5
- t.integer :user_id
4
+ t.references :user_import_file, index: true
5
+ t.references :user, index: true
6
6
  t.text :body
7
7
 
8
8
  t.timestamps
@@ -2,13 +2,17 @@ class CreateResourceImportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :resource_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.integer :resource_import_file_id
8
12
  t.timestamps
9
13
  end
10
14
 
11
15
  add_index :resource_import_file_transitions, :resource_import_file_id, name: "index_resource_import_file_transitions_on_file_id"
12
- add_index :resource_import_file_transitions, %i[sort_key resource_import_file_id], unique: true, name: "index_resource_import_file_transitions_on_sort_key_and_file_id"
16
+ add_index :resource_import_file_transitions, [:sort_key, :resource_import_file_id], unique: true, name: "index_resource_import_file_transitions_on_sort_key_and_file_id"
13
17
  end
14
18
  end
@@ -2,13 +2,17 @@ class CreateImportRequestTransitions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :import_request_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.integer :import_request_id
8
12
  t.timestamps
9
13
  end
10
14
 
11
15
  add_index :import_request_transitions, :import_request_id
12
- add_index :import_request_transitions, %i[sort_key import_request_id], unique: true, name: "index_import_request_transitions_on_sort_key_and_request_id"
16
+ add_index :import_request_transitions, [:sort_key, :import_request_id], unique: true, name: "index_import_request_transitions_on_sort_key_and_request_id"
13
17
  end
14
18
  end
@@ -2,13 +2,17 @@ class CreateAgentImportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :agent_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.integer :agent_import_file_id
8
12
  t.timestamps
9
13
  end
10
14
 
11
15
  add_index :agent_import_file_transitions, :agent_import_file_id
12
- add_index :agent_import_file_transitions, %i[sort_key agent_import_file_id], unique: true, name: "index_agent_import_file_transitions_on_sort_key_and_file_id"
16
+ add_index :agent_import_file_transitions, [:sort_key, :agent_import_file_id], unique: true, name: "index_agent_import_file_transitions_on_sort_key_and_file_id"
13
17
  end
14
18
  end
@@ -8,11 +8,10 @@ class CreateUserImportFileTransitions < ActiveRecord::Migration[4.2]
8
8
  t.text :metadata, default: "{}"
9
9
  end
10
10
  t.integer :sort_key
11
- t.integer :user_import_file_id
11
+ t.references :user_import_file, index: true
12
12
  t.timestamps
13
13
  end
14
14
 
15
- add_index :user_import_file_transitions, :user_import_file_id
16
- add_index :user_import_file_transitions, %i[sort_key user_import_file_id], unique: true, name: "index_user_import_file_transitions_on_sort_key_and_file_id"
15
+ add_index :user_import_file_transitions, [:sort_key, :user_import_file_id], unique: true, name: "index_user_import_file_transitions_on_sort_key_and_file_id"
17
16
  end
18
17
  end
@@ -2,13 +2,17 @@ class CreateResourceExportFileTransitions < ActiveRecord::Migration[4.2]
2
2
  def change
3
3
  create_table :resource_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.integer :resource_export_file_id
8
12
  t.timestamps
9
13
  end
10
14
 
11
15
  add_index :resource_export_file_transitions, :resource_export_file_id, name: "index_resource_export_file_transitions_on_file_id"
12
- add_index :resource_export_file_transitions, %i[sort_key resource_export_file_id], unique: true, name: "index_resource_export_file_transitions_on_sort_key_and_file_id"
16
+ add_index :resource_export_file_transitions, [:sort_key, :resource_export_file_id], unique: true, name: "index_resource_export_file_transitions_on_sort_key_and_file_id"
13
17
  end
14
18
  end