diff --git a/Gemfile b/Gemfile index 7577cb5f2..8a86bfb71 100644 --- a/Gemfile +++ b/Gemfile @@ -71,6 +71,9 @@ gem 'tinymce-rails', '~> 4.6.4' # Rich text editor gem 'base62' # Used for smart annotations gem 'newrelic_rpm' +gem 'devise_security_extension', + git: 'https://github.com/phatworx/devise_security_extension.git', + ref: 'b2ee978' group :development, :test do gem 'listen', '~> 3.0' diff --git a/Gemfile.lock b/Gemfile.lock index 418ded2c5..0ae455d1b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -12,6 +12,15 @@ GIT sneaky-save (0.1.2) activerecord (>= 3.2.0) +GIT + remote: https://github.com/phatworx/devise_security_extension.git + revision: b2ee978af7d49f0fb0e7271c6ac074dfb4d39353 + ref: b2ee978 + specs: + devise_security_extension (0.10.0) + devise (>= 3.0.0, < 5.0) + railties (>= 3.2.6, < 6.0) + GEM remote: http://rubygems.org/ specs: @@ -386,6 +395,7 @@ DEPENDENCIES devise (~> 4.3.0) devise-async devise_invitable + devise_security_extension! faker figaro font-awesome-rails (~> 4.7.0.2) diff --git a/app/controllers/users/invitations_controller.rb b/app/controllers/users/invitations_controller.rb index 21cf02977..bd199cd7a 100644 --- a/app/controllers/users/invitations_controller.rb +++ b/app/controllers/users/invitations_controller.rb @@ -7,7 +7,7 @@ module Users before_action :check_invite_users_permission, only: :invite_users - before_filter :update_sanitized_params, only: :update + before_action :update_sanitized_params, only: :update def update # Instantialize a new team with the provided name diff --git a/db/migrate/20150713060702_devise_create_users.rb b/db/migrate/20150713060702_devise_create_users.rb index 15f651d46..470826e79 100644 --- a/db/migrate/20150713060702_devise_create_users.rb +++ b/db/migrate/20150713060702_devise_create_users.rb @@ -1,4 +1,4 @@ -class DeviseCreateUsers < ActiveRecord::Migration +class DeviseCreateUsers < ActiveRecord::Migration[4.2] def change create_table(:users) do |t| ## General user data diff --git a/db/migrate/20150713061603_add_user_columns.rb b/db/migrate/20150713061603_add_user_columns.rb index 54153ea3d..0d37c1a2d 100644 --- a/db/migrate/20150713061603_add_user_columns.rb +++ b/db/migrate/20150713061603_add_user_columns.rb @@ -1,4 +1,4 @@ -class AddUserColumns < ActiveRecord::Migration +class AddUserColumns < ActiveRecord::Migration[4.2] def up add_attachment :users, :avatar end diff --git a/db/migrate/20150713063224_create_organizations.rb b/db/migrate/20150713063224_create_organizations.rb index b68bc47f9..84ec93e61 100644 --- a/db/migrate/20150713063224_create_organizations.rb +++ b/db/migrate/20150713063224_create_organizations.rb @@ -1,4 +1,4 @@ -class CreateOrganizations < ActiveRecord::Migration +class CreateOrganizations < ActiveRecord::Migration[4.2] def change create_table :teams do |t| ## General info diff --git a/db/migrate/20150713070738_create_user_organizations.rb b/db/migrate/20150713070738_create_user_organizations.rb index 298a9141f..04dc7b3ea 100644 --- a/db/migrate/20150713070738_create_user_organizations.rb +++ b/db/migrate/20150713070738_create_user_organizations.rb @@ -1,4 +1,4 @@ -class CreateUserOrganizations < ActiveRecord::Migration +class CreateUserOrganizations < ActiveRecord::Migration[4.2] def change create_table :user_teams do |t| t.column :role, :integer, null: false, default: 1 diff --git a/db/migrate/20150713071921_create_projects.rb b/db/migrate/20150713071921_create_projects.rb index 3ce88c6b4..acfb2f2af 100644 --- a/db/migrate/20150713071921_create_projects.rb +++ b/db/migrate/20150713071921_create_projects.rb @@ -1,4 +1,4 @@ -class CreateProjects < ActiveRecord::Migration +class CreateProjects < ActiveRecord::Migration[4.2] def change create_table :projects do |t| t.string :name, null: false diff --git a/db/migrate/20150713072417_create_user_projects.rb b/db/migrate/20150713072417_create_user_projects.rb index c7ecfa696..4823b2520 100644 --- a/db/migrate/20150713072417_create_user_projects.rb +++ b/db/migrate/20150713072417_create_user_projects.rb @@ -1,4 +1,4 @@ -class CreateUserProjects < ActiveRecord::Migration +class CreateUserProjects < ActiveRecord::Migration[4.2] def change create_table :user_projects do |t| t.column :role, :integer, default: 0 diff --git a/db/migrate/20150714125221_add_archive_to_projects.rb b/db/migrate/20150714125221_add_archive_to_projects.rb index f8e4e9c52..e79e7e3f2 100644 --- a/db/migrate/20150714125221_add_archive_to_projects.rb +++ b/db/migrate/20150714125221_add_archive_to_projects.rb @@ -1,4 +1,4 @@ -class AddArchiveToProjects < ActiveRecord::Migration +class AddArchiveToProjects < ActiveRecord::Migration[4.2] def change add_column :projects, :archived, :boolean, { default: false, null: false } add_column :projects, :archived_on, :datetime diff --git a/db/migrate/20150715122019_create_logs.rb b/db/migrate/20150715122019_create_logs.rb index 6c0359628..7d6b6c867 100644 --- a/db/migrate/20150715122019_create_logs.rb +++ b/db/migrate/20150715122019_create_logs.rb @@ -1,4 +1,4 @@ -class CreateLogs < ActiveRecord::Migration +class CreateLogs < ActiveRecord::Migration[4.2] def change create_table :logs do |t| t.integer :team_id, null: false diff --git a/db/migrate/20150715124934_create_my_modules.rb b/db/migrate/20150715124934_create_my_modules.rb index fb231234d..0e04e8c48 100644 --- a/db/migrate/20150715124934_create_my_modules.rb +++ b/db/migrate/20150715124934_create_my_modules.rb @@ -1,4 +1,4 @@ -class CreateMyModules < ActiveRecord::Migration +class CreateMyModules < ActiveRecord::Migration[4.2] def change create_table :my_modules do |t| t.string :name, null: false diff --git a/db/migrate/20150715131400_create_project_comments.rb b/db/migrate/20150715131400_create_project_comments.rb index fc4cf9e26..e1b21c984 100644 --- a/db/migrate/20150715131400_create_project_comments.rb +++ b/db/migrate/20150715131400_create_project_comments.rb @@ -1,4 +1,4 @@ -class CreateProjectComments < ActiveRecord::Migration +class CreateProjectComments < ActiveRecord::Migration[4.2] def change create_table :project_comments do |t| t.integer :project_id, null: false diff --git a/db/migrate/20150715132459_create_my_module_comments.rb b/db/migrate/20150715132459_create_my_module_comments.rb index fe6f34946..002a294a1 100644 --- a/db/migrate/20150715132459_create_my_module_comments.rb +++ b/db/migrate/20150715132459_create_my_module_comments.rb @@ -1,4 +1,4 @@ -class CreateMyModuleComments < ActiveRecord::Migration +class CreateMyModuleComments < ActiveRecord::Migration[4.2] def change create_table :my_module_comments do |t| t.integer :my_module_id, null: false diff --git a/db/migrate/20150715132920_create_tags.rb b/db/migrate/20150715132920_create_tags.rb index df4785d76..7ee44f5d3 100644 --- a/db/migrate/20150715132920_create_tags.rb +++ b/db/migrate/20150715132920_create_tags.rb @@ -1,4 +1,4 @@ -class CreateTags < ActiveRecord::Migration +class CreateTags < ActiveRecord::Migration[4.2] def change create_table :tags do |t| t.string :name, null:false diff --git a/db/migrate/20150715133511_create_my_modules_and_tags.rb b/db/migrate/20150715133511_create_my_modules_and_tags.rb index dd916ca4d..15dcdfbdf 100644 --- a/db/migrate/20150715133511_create_my_modules_and_tags.rb +++ b/db/migrate/20150715133511_create_my_modules_and_tags.rb @@ -1,4 +1,4 @@ -class CreateMyModulesAndTags < ActiveRecord::Migration +class CreateMyModulesAndTags < ActiveRecord::Migration[4.2] def change create_table :my_module_tags do |t| t.belongs_to :my_module, index: true diff --git a/db/migrate/20150715133709_create_my_module_groups.rb b/db/migrate/20150715133709_create_my_module_groups.rb index 37ad4c2af..35f469a81 100644 --- a/db/migrate/20150715133709_create_my_module_groups.rb +++ b/db/migrate/20150715133709_create_my_module_groups.rb @@ -1,4 +1,4 @@ -class CreateMyModuleGroups < ActiveRecord::Migration +class CreateMyModuleGroups < ActiveRecord::Migration[4.2] def change create_table :my_module_groups do |t| t.string :name, null: false diff --git a/db/migrate/20150715134133_create_connections.rb b/db/migrate/20150715134133_create_connections.rb index 819cdc410..94638539d 100644 --- a/db/migrate/20150715134133_create_connections.rb +++ b/db/migrate/20150715134133_create_connections.rb @@ -1,4 +1,4 @@ -class CreateConnections < ActiveRecord::Migration +class CreateConnections < ActiveRecord::Migration[4.2] def change create_table :connections do |t| t.integer :input_id, null: false diff --git a/db/migrate/20150715135452_create_steps.rb b/db/migrate/20150715135452_create_steps.rb index 312cc5e9e..ba73c24da 100644 --- a/db/migrate/20150715135452_create_steps.rb +++ b/db/migrate/20150715135452_create_steps.rb @@ -1,4 +1,4 @@ -class CreateSteps < ActiveRecord::Migration +class CreateSteps < ActiveRecord::Migration[4.2] def change create_table :steps do |t| t.string :name diff --git a/db/migrate/20150715141810_create_assets.rb b/db/migrate/20150715141810_create_assets.rb index 63e0f5604..f51df23de 100644 --- a/db/migrate/20150715141810_create_assets.rb +++ b/db/migrate/20150715141810_create_assets.rb @@ -1,4 +1,4 @@ -class CreateAssets < ActiveRecord::Migration +class CreateAssets < ActiveRecord::Migration[4.2] def change create_table :assets do |t| diff --git a/db/migrate/20150715142704_create_step_assets.rb b/db/migrate/20150715142704_create_step_assets.rb index 7e711cb45..d7da480aa 100644 --- a/db/migrate/20150715142704_create_step_assets.rb +++ b/db/migrate/20150715142704_create_step_assets.rb @@ -1,4 +1,4 @@ -class CreateStepAssets < ActiveRecord::Migration +class CreateStepAssets < ActiveRecord::Migration[4.2] def change create_table :step_assets do |t| t.integer :step_id, null: false diff --git a/db/migrate/20150715142929_create_result_assets.rb b/db/migrate/20150715142929_create_result_assets.rb index 661073237..268a287d7 100644 --- a/db/migrate/20150715142929_create_result_assets.rb +++ b/db/migrate/20150715142929_create_result_assets.rb @@ -1,4 +1,4 @@ -class CreateResultAssets < ActiveRecord::Migration +class CreateResultAssets < ActiveRecord::Migration[4.2] def change create_table :result_assets do |t| t.integer :result_id, null: false diff --git a/db/migrate/20150715143134_create_results.rb b/db/migrate/20150715143134_create_results.rb index 4f7bce5d5..a61c98f81 100644 --- a/db/migrate/20150715143134_create_results.rb +++ b/db/migrate/20150715143134_create_results.rb @@ -1,4 +1,4 @@ -class CreateResults < ActiveRecord::Migration +class CreateResults < ActiveRecord::Migration[4.2] def change create_table :results do |t| t.string :name diff --git a/db/migrate/20150716060140_create_result_comments.rb b/db/migrate/20150716060140_create_result_comments.rb index 4aae1aadc..cab91468e 100644 --- a/db/migrate/20150716060140_create_result_comments.rb +++ b/db/migrate/20150716060140_create_result_comments.rb @@ -1,4 +1,4 @@ -class CreateResultComments < ActiveRecord::Migration +class CreateResultComments < ActiveRecord::Migration[4.2] def change create_table :result_comments do |t| t.integer :result_id, null: false diff --git a/db/migrate/20150716061004_create_comments.rb b/db/migrate/20150716061004_create_comments.rb index 79d333cf0..8028a8bf1 100644 --- a/db/migrate/20150716061004_create_comments.rb +++ b/db/migrate/20150716061004_create_comments.rb @@ -1,4 +1,4 @@ -class CreateComments < ActiveRecord::Migration +class CreateComments < ActiveRecord::Migration[4.2] def change create_table :comments do |t| t.string :message, null: false diff --git a/db/migrate/20150716061555_create_step_comments.rb b/db/migrate/20150716061555_create_step_comments.rb index 824ef7f20..4e7bce7a0 100644 --- a/db/migrate/20150716061555_create_step_comments.rb +++ b/db/migrate/20150716061555_create_step_comments.rb @@ -1,4 +1,4 @@ -class CreateStepComments < ActiveRecord::Migration +class CreateStepComments < ActiveRecord::Migration[4.2] def change create_table :step_comments do |t| t.integer :step_id, null: false diff --git a/db/migrate/20150716061937_create_tables.rb b/db/migrate/20150716061937_create_tables.rb index 86a96f6bd..ad9abefa6 100644 --- a/db/migrate/20150716061937_create_tables.rb +++ b/db/migrate/20150716061937_create_tables.rb @@ -1,4 +1,4 @@ -class CreateTables < ActiveRecord::Migration +class CreateTables < ActiveRecord::Migration[4.2] def change create_table :tables do |t| t.binary :contents, null: false, limit: 20.megabyte diff --git a/db/migrate/20150716062013_create_checklists.rb b/db/migrate/20150716062013_create_checklists.rb index 60c3180f8..382b9ece1 100644 --- a/db/migrate/20150716062013_create_checklists.rb +++ b/db/migrate/20150716062013_create_checklists.rb @@ -1,4 +1,4 @@ -class CreateChecklists < ActiveRecord::Migration +class CreateChecklists < ActiveRecord::Migration[4.2] def change create_table :checklists do |t| t.string :name, null: false diff --git a/db/migrate/20150716062110_create_checklist_items.rb b/db/migrate/20150716062110_create_checklist_items.rb index 8a10eaae4..ec4c35069 100644 --- a/db/migrate/20150716062110_create_checklist_items.rb +++ b/db/migrate/20150716062110_create_checklist_items.rb @@ -1,4 +1,4 @@ -class CreateChecklistItems < ActiveRecord::Migration +class CreateChecklistItems < ActiveRecord::Migration[4.2] def change create_table :checklist_items do |t| t.string :text, null: false diff --git a/db/migrate/20150716062801_create_samples.rb b/db/migrate/20150716062801_create_samples.rb index 0b824541e..24b21bb28 100644 --- a/db/migrate/20150716062801_create_samples.rb +++ b/db/migrate/20150716062801_create_samples.rb @@ -1,4 +1,4 @@ -class CreateSamples < ActiveRecord::Migration +class CreateSamples < ActiveRecord::Migration[4.2] def change create_table :samples do |t| t.string :name, null: false diff --git a/db/migrate/20150716064453_create_activities.rb b/db/migrate/20150716064453_create_activities.rb index 5573a349e..47da33ea5 100644 --- a/db/migrate/20150716064453_create_activities.rb +++ b/db/migrate/20150716064453_create_activities.rb @@ -1,4 +1,4 @@ -class CreateActivities < ActiveRecord::Migration +class CreateActivities < ActiveRecord::Migration[4.2] def change create_table :activities do |t| t.integer :my_module_id, null: false diff --git a/db/migrate/20150716120130_create_sample_my_modules.rb b/db/migrate/20150716120130_create_sample_my_modules.rb index 3ed3555f7..3bef031b0 100644 --- a/db/migrate/20150716120130_create_sample_my_modules.rb +++ b/db/migrate/20150716120130_create_sample_my_modules.rb @@ -1,4 +1,4 @@ -class CreateSampleMyModules < ActiveRecord::Migration +class CreateSampleMyModules < ActiveRecord::Migration[4.2] def change create_table :sample_my_modules do |t| t.integer :sample_id, null: false diff --git a/db/migrate/20150716120659_create_sample_comments.rb b/db/migrate/20150716120659_create_sample_comments.rb index 161413ff4..19d580668 100644 --- a/db/migrate/20150716120659_create_sample_comments.rb +++ b/db/migrate/20150716120659_create_sample_comments.rb @@ -1,4 +1,4 @@ -class CreateSampleComments < ActiveRecord::Migration +class CreateSampleComments < ActiveRecord::Migration[4.2] def change create_table :sample_comments do |t| t.integer :sample_id, null: false diff --git a/db/migrate/20150717084645_create_result_texts.rb b/db/migrate/20150717084645_create_result_texts.rb index 7b566bf72..c1b13d867 100644 --- a/db/migrate/20150717084645_create_result_texts.rb +++ b/db/migrate/20150717084645_create_result_texts.rb @@ -1,4 +1,4 @@ -class CreateResultTexts < ActiveRecord::Migration +class CreateResultTexts < ActiveRecord::Migration[4.2] def change create_table :result_texts do |t| t.string :text, null: false diff --git a/db/migrate/20150717085043_create_step_tables.rb b/db/migrate/20150717085043_create_step_tables.rb index 716f22a2c..c3f00ce07 100644 --- a/db/migrate/20150717085043_create_step_tables.rb +++ b/db/migrate/20150717085043_create_step_tables.rb @@ -1,4 +1,4 @@ -class CreateStepTables < ActiveRecord::Migration +class CreateStepTables < ActiveRecord::Migration[4.2] def change create_table :step_tables do |t| t.integer :step_id, null: false diff --git a/db/migrate/20150717085133_create_result_tables.rb b/db/migrate/20150717085133_create_result_tables.rb index ab35abd78..f60e1144a 100644 --- a/db/migrate/20150717085133_create_result_tables.rb +++ b/db/migrate/20150717085133_create_result_tables.rb @@ -1,4 +1,4 @@ -class CreateResultTables < ActiveRecord::Migration +class CreateResultTables < ActiveRecord::Migration[4.2] def change create_table :result_tables do |t| t.integer :result_id, null: false diff --git a/db/migrate/20150722095027_create_user_my_modules.rb b/db/migrate/20150722095027_create_user_my_modules.rb index e82912680..05fef3fec 100644 --- a/db/migrate/20150722095027_create_user_my_modules.rb +++ b/db/migrate/20150722095027_create_user_my_modules.rb @@ -1,4 +1,4 @@ -class CreateUserMyModules < ActiveRecord::Migration +class CreateUserMyModules < ActiveRecord::Migration[4.2] def change create_table :user_my_modules do |t| t.integer :user_id, null: false diff --git a/db/migrate/20150722112911_add_foreign_keys.rb b/db/migrate/20150722112911_add_foreign_keys.rb index 02d96a385..8660eedc5 100644 --- a/db/migrate/20150722112911_add_foreign_keys.rb +++ b/db/migrate/20150722112911_add_foreign_keys.rb @@ -1,4 +1,4 @@ -class AddForeignKeys < ActiveRecord::Migration +class AddForeignKeys < ActiveRecord::Migration[4.2] def change add_foreign_key :my_modules, :my_module_groups add_foreign_key :project_comments, :comments diff --git a/db/migrate/20150723134648_add_confirmable_to_devise.rb b/db/migrate/20150723134648_add_confirmable_to_devise.rb index b1f0d28b0..ed9b7f553 100644 --- a/db/migrate/20150723134648_add_confirmable_to_devise.rb +++ b/db/migrate/20150723134648_add_confirmable_to_devise.rb @@ -1,4 +1,4 @@ -class AddConfirmableToDevise < ActiveRecord::Migration +class AddConfirmableToDevise < ActiveRecord::Migration[4.2] def up add_column :users, :confirmation_token, :string add_column :users, :confirmed_at, :datetime diff --git a/db/migrate/20150730090021_add_my_module_groups_to_project.rb b/db/migrate/20150730090021_add_my_module_groups_to_project.rb index 7352a61df..92652df4e 100644 --- a/db/migrate/20150730090021_add_my_module_groups_to_project.rb +++ b/db/migrate/20150730090021_add_my_module_groups_to_project.rb @@ -1,4 +1,4 @@ -class AddMyModuleGroupsToProject < ActiveRecord::Migration +class AddMyModuleGroupsToProject < ActiveRecord::Migration[4.2] def change add_column :my_module_groups, :project_id, :integer diff --git a/db/migrate/20150804055341_add_color_to_tags.rb b/db/migrate/20150804055341_add_color_to_tags.rb index 03ad53cd3..874abadd9 100644 --- a/db/migrate/20150804055341_add_color_to_tags.rb +++ b/db/migrate/20150804055341_add_color_to_tags.rb @@ -1,4 +1,4 @@ -class AddColorToTags < ActiveRecord::Migration +class AddColorToTags < ActiveRecord::Migration[4.2] def change add_column :tags, :color, :string, { default: "#ff0000", null: false } end diff --git a/db/migrate/20150820120553_create_sample_groups.rb b/db/migrate/20150820120553_create_sample_groups.rb index b379f8a6f..699b2c2a6 100644 --- a/db/migrate/20150820120553_create_sample_groups.rb +++ b/db/migrate/20150820120553_create_sample_groups.rb @@ -1,4 +1,4 @@ -class CreateSampleGroups < ActiveRecord::Migration +class CreateSampleGroups < ActiveRecord::Migration[4.2] def change create_table :sample_groups do |t| t.string :name, null: false diff --git a/db/migrate/20150820123018_create_sample_types.rb b/db/migrate/20150820123018_create_sample_types.rb index a51d45c12..fc84a46ad 100644 --- a/db/migrate/20150820123018_create_sample_types.rb +++ b/db/migrate/20150820123018_create_sample_types.rb @@ -1,4 +1,4 @@ -class CreateSampleTypes < ActiveRecord::Migration +class CreateSampleTypes < ActiveRecord::Migration[4.2] def change create_table :sample_types do |t| t.string :name, null: false diff --git a/db/migrate/20150820124022_add_default_columns_to_samples.rb b/db/migrate/20150820124022_add_default_columns_to_samples.rb index 41d361460..cac7fe40b 100644 --- a/db/migrate/20150820124022_add_default_columns_to_samples.rb +++ b/db/migrate/20150820124022_add_default_columns_to_samples.rb @@ -1,4 +1,4 @@ -class AddDefaultColumnsToSamples < ActiveRecord::Migration +class AddDefaultColumnsToSamples < ActiveRecord::Migration[4.2] def change add_column :samples, :sample_group_id, :integer add_column :samples, :sample_type_id, :integer diff --git a/db/migrate/20150827130647_create_custom_fields.rb b/db/migrate/20150827130647_create_custom_fields.rb index 4f6ee6b08..7c27f935c 100644 --- a/db/migrate/20150827130647_create_custom_fields.rb +++ b/db/migrate/20150827130647_create_custom_fields.rb @@ -1,4 +1,4 @@ -class CreateCustomFields < ActiveRecord::Migration +class CreateCustomFields < ActiveRecord::Migration[4.2] def change create_table :custom_fields do |t| t.string :name, null: false diff --git a/db/migrate/20150827130822_create_sample_custom_fields.rb b/db/migrate/20150827130822_create_sample_custom_fields.rb index 5cb52dec2..520bf1c2a 100644 --- a/db/migrate/20150827130822_create_sample_custom_fields.rb +++ b/db/migrate/20150827130822_create_sample_custom_fields.rb @@ -1,4 +1,4 @@ -class CreateSampleCustomFields < ActiveRecord::Migration +class CreateSampleCustomFields < ActiveRecord::Migration[4.2] def change create_table :sample_custom_fields do |t| t.string :value, null: false diff --git a/db/migrate/20150911125914_add_project_to_tags.rb b/db/migrate/20150911125914_add_project_to_tags.rb index 2766b2ead..1033eb76b 100644 --- a/db/migrate/20150911125914_add_project_to_tags.rb +++ b/db/migrate/20150911125914_add_project_to_tags.rb @@ -1,4 +1,4 @@ -class AddProjectToTags < ActiveRecord::Migration +class AddProjectToTags < ActiveRecord::Migration[4.2] def change # Add project ID reference, make it nullable at first add_column :tags, :project_id, :integer, { null: true } diff --git a/db/migrate/20150915074650_create_reports.rb b/db/migrate/20150915074650_create_reports.rb index b0ab25881..54787b372 100644 --- a/db/migrate/20150915074650_create_reports.rb +++ b/db/migrate/20150915074650_create_reports.rb @@ -1,4 +1,4 @@ -class CreateReports < ActiveRecord::Migration +class CreateReports < ActiveRecord::Migration[4.2] def change create_table :reports do |t| t.string :name, null: false diff --git a/db/migrate/20150923065605_create_temp_files.rb b/db/migrate/20150923065605_create_temp_files.rb index 771fe259f..e992266ed 100644 --- a/db/migrate/20150923065605_create_temp_files.rb +++ b/db/migrate/20150923065605_create_temp_files.rb @@ -1,4 +1,4 @@ -class CreateTempFiles < ActiveRecord::Migration +class CreateTempFiles < ActiveRecord::Migration[4.2] def change create_table :temp_files do |t| t.string :session_id, null: false diff --git a/db/migrate/20150923110208_add_archive_to_my_modules.rb b/db/migrate/20150923110208_add_archive_to_my_modules.rb index 115c6ba8f..88c57980f 100644 --- a/db/migrate/20150923110208_add_archive_to_my_modules.rb +++ b/db/migrate/20150923110208_add_archive_to_my_modules.rb @@ -1,7 +1,6 @@ -class AddArchiveToMyModules < ActiveRecord::Migration +class AddArchiveToMyModules < ActiveRecord::Migration[4.2] def change add_column :my_modules, :archived, :boolean, { default: false, null: false } add_column :my_modules, :archived_on, :datetime end end - diff --git a/db/migrate/20150923154140_add_index_to_sample_name.rb b/db/migrate/20150923154140_add_index_to_sample_name.rb index 1d8965d07..4b2dd64b6 100644 --- a/db/migrate/20150923154140_add_index_to_sample_name.rb +++ b/db/migrate/20150923154140_add_index_to_sample_name.rb @@ -1,4 +1,4 @@ -class AddIndexToSampleName < ActiveRecord::Migration +class AddIndexToSampleName < ActiveRecord::Migration[4.2] def change add_index :samples, :name end diff --git a/db/migrate/20150924115001_create_report_elements.rb b/db/migrate/20150924115001_create_report_elements.rb index 6f0cd909a..0ef310429 100644 --- a/db/migrate/20150924115001_create_report_elements.rb +++ b/db/migrate/20150924115001_create_report_elements.rb @@ -1,4 +1,4 @@ -class CreateReportElements < ActiveRecord::Migration +class CreateReportElements < ActiveRecord::Migration[4.2] def change create_table :report_elements do |t| t.integer :position, null: false diff --git a/db/migrate/20150924181017_add_archive_to_results.rb b/db/migrate/20150924181017_add_archive_to_results.rb index 06ef93e38..99cc20675 100644 --- a/db/migrate/20150924181017_add_archive_to_results.rb +++ b/db/migrate/20150924181017_add_archive_to_results.rb @@ -1,4 +1,4 @@ -class AddArchiveToResults < ActiveRecord::Migration +class AddArchiveToResults < ActiveRecord::Migration[4.2] def change add_column :results, :archived, :boolean, { default: false, null: false } add_column :results, :archived_on, :datetime diff --git a/db/migrate/20151005122041_add_created_by_to_assets.rb b/db/migrate/20151005122041_add_created_by_to_assets.rb index fffe966cf..d7496e30b 100644 --- a/db/migrate/20151005122041_add_created_by_to_assets.rb +++ b/db/migrate/20151005122041_add_created_by_to_assets.rb @@ -1,4 +1,4 @@ -class AddCreatedByToAssets < ActiveRecord::Migration +class AddCreatedByToAssets < ActiveRecord::Migration[4.2] def change tables = [:assets, :checklists, :checklist_items, :my_module_groups, :my_module_tags, :my_modules, :teams, :projects, diff --git a/db/migrate/20151021082639_add_pg_trgm_support.rb b/db/migrate/20151021082639_add_pg_trgm_support.rb index 73bebf20c..f390b9986 100644 --- a/db/migrate/20151021082639_add_pg_trgm_support.rb +++ b/db/migrate/20151021082639_add_pg_trgm_support.rb @@ -1,7 +1,7 @@ require File.expand_path('app/helpers/database_helper') include DatabaseHelper -class AddPgTrgmSupport < ActiveRecord::Migration +class AddPgTrgmSupport < ActiveRecord::Migration[4.2] def up if db_adapter_is? "PostgreSQL" then create_extension :pg_trgm diff --git a/db/migrate/20151021085335_add_search_query_indexes.rb b/db/migrate/20151021085335_add_search_query_indexes.rb index d98d4bda8..c8b67aa35 100644 --- a/db/migrate/20151021085335_add_search_query_indexes.rb +++ b/db/migrate/20151021085335_add_search_query_indexes.rb @@ -1,7 +1,7 @@ require File.expand_path('app/helpers/database_helper') include DatabaseHelper -class AddSearchQueryIndexes < ActiveRecord::Migration +class AddSearchQueryIndexes < ActiveRecord::Migration[4.2] def up add_index :projects, :team_id add_index :user_teams, :user_id diff --git a/db/migrate/20151022123530_remove_unique_organization_name_index.rb b/db/migrate/20151022123530_remove_unique_organization_name_index.rb index 8bc0b97cd..37f09cb70 100644 --- a/db/migrate/20151022123530_remove_unique_organization_name_index.rb +++ b/db/migrate/20151022123530_remove_unique_organization_name_index.rb @@ -1,4 +1,4 @@ -class RemoveUniqueOrganizationNameIndex < ActiveRecord::Migration +class RemoveUniqueOrganizationNameIndex < ActiveRecord::Migration[4.2] def up remove_index :teams, :name add_index :teams, :name diff --git a/db/migrate/20151028091615_add_counter_cache_to_samples.rb b/db/migrate/20151028091615_add_counter_cache_to_samples.rb index 209ed057c..64a50aa06 100644 --- a/db/migrate/20151028091615_add_counter_cache_to_samples.rb +++ b/db/migrate/20151028091615_add_counter_cache_to_samples.rb @@ -1,4 +1,4 @@ -class AddCounterCacheToSamples < ActiveRecord::Migration +class AddCounterCacheToSamples < ActiveRecord::Migration[4.2] def up add_column :samples, :nr_of_modules_assigned_to, :integer, :default => 0 add_column :my_modules, :nr_of_assigned_samples, :integer, :default => 0 diff --git a/db/migrate/20151103155048_add_btree_gist_extension.rb b/db/migrate/20151103155048_add_btree_gist_extension.rb index dd082e86b..ac4125317 100644 --- a/db/migrate/20151103155048_add_btree_gist_extension.rb +++ b/db/migrate/20151103155048_add_btree_gist_extension.rb @@ -1,7 +1,7 @@ require File.expand_path('app/helpers/database_helper') include DatabaseHelper -class AddBtreeGistExtension < ActiveRecord::Migration +class AddBtreeGistExtension < ActiveRecord::Migration[4.2] def up if db_adapter_is? "PostgreSQL" then create_extension :btree_gist diff --git a/db/migrate/20151111135802_reset_assigned_samples_counters.rb b/db/migrate/20151111135802_reset_assigned_samples_counters.rb index 2447f26a9..6bd44f991 100644 --- a/db/migrate/20151111135802_reset_assigned_samples_counters.rb +++ b/db/migrate/20151111135802_reset_assigned_samples_counters.rb @@ -1,4 +1,4 @@ -class ResetAssignedSamplesCounters < ActiveRecord::Migration +class ResetAssignedSamplesCounters < ActiveRecord::Migration[4.2] def change Sample.find_each do |sample| Sample.reset_counters(sample.id, :sample_my_modules) diff --git a/db/migrate/20151117083839_add_project_reference_to_activity.rb b/db/migrate/20151117083839_add_project_reference_to_activity.rb index 1da4062be..e6493984c 100644 --- a/db/migrate/20151117083839_add_project_reference_to_activity.rb +++ b/db/migrate/20151117083839_add_project_reference_to_activity.rb @@ -1,4 +1,4 @@ -class AddProjectReferenceToActivity < ActiveRecord::Migration +class AddProjectReferenceToActivity < ActiveRecord::Migration[4.2] def up # Make my module reference nullable change_column_null :activities, :my_module_id, true diff --git a/db/migrate/20151119141714_create_asset_text_data.rb b/db/migrate/20151119141714_create_asset_text_data.rb index 9ea3b592b..9cc111abd 100644 --- a/db/migrate/20151119141714_create_asset_text_data.rb +++ b/db/migrate/20151119141714_create_asset_text_data.rb @@ -1,8 +1,8 @@ -class CreateAssetTextData < ActiveRecord::Migration +class CreateAssetTextData < ActiveRecord::Migration[4.2] def change create_table :asset_text_data do |t| t.text :data, null: false - t.integer :asset_id, null: false + t.integer :asset_id, null: false t.timestamps null: false end add_foreign_key :asset_text_data, :assets diff --git a/db/migrate/20151130160157_add_text_search_vector_to_asset_text_data.rb b/db/migrate/20151130160157_add_text_search_vector_to_asset_text_data.rb index 7a9a24f3a..3a36b682a 100644 --- a/db/migrate/20151130160157_add_text_search_vector_to_asset_text_data.rb +++ b/db/migrate/20151130160157_add_text_search_vector_to_asset_text_data.rb @@ -1,7 +1,7 @@ require File.expand_path('app/helpers/database_helper') include DatabaseHelper -class AddTextSearchVectorToAssetTextData < ActiveRecord::Migration +class AddTextSearchVectorToAssetTextData < ActiveRecord::Migration[4.2] def change add_column :asset_text_data, :data_vector, :tsvector diff --git a/db/migrate/20151203100514_add_workflow_order_to_my_modules.rb b/db/migrate/20151203100514_add_workflow_order_to_my_modules.rb index 701a24710..5aed71d94 100644 --- a/db/migrate/20151203100514_add_workflow_order_to_my_modules.rb +++ b/db/migrate/20151203100514_add_workflow_order_to_my_modules.rb @@ -1,4 +1,4 @@ -class AddWorkflowOrderToMyModules < ActiveRecord::Migration +class AddWorkflowOrderToMyModules < ActiveRecord::Migration[4.2] def up add_column :my_modules, :workflow_order, :integer, { null: false, default: -1} end diff --git a/db/migrate/20151207151820_add_timezone_to_user.rb b/db/migrate/20151207151820_add_timezone_to_user.rb index abc92216a..62d9d2680 100644 --- a/db/migrate/20151207151820_add_timezone_to_user.rb +++ b/db/migrate/20151207151820_add_timezone_to_user.rb @@ -1,4 +1,4 @@ -class AddTimezoneToUser < ActiveRecord::Migration +class AddTimezoneToUser < ActiveRecord::Migration[4.2] def change add_column :users, :time_zone, :string, :default => "UTC" end diff --git a/db/migrate/20151214110800_add_organization_management_support.rb b/db/migrate/20151214110800_add_organization_management_support.rb index 1236576cf..5fd52c60e 100644 --- a/db/migrate/20151214110800_add_organization_management_support.rb +++ b/db/migrate/20151214110800_add_organization_management_support.rb @@ -1,7 +1,7 @@ require File.expand_path('app/helpers/database_helper') include DatabaseHelper -class AddOrganizationManagementSupport < ActiveRecord::Migration +class AddOrganizationManagementSupport < ActiveRecord::Migration[4.2] def up # Add nullable description to team add_column :teams, :description, :string diff --git a/db/migrate/20151215103642_add_foreign_keys_to_tables.rb b/db/migrate/20151215103642_add_foreign_keys_to_tables.rb index a780a1fc2..e1239d618 100644 --- a/db/migrate/20151215103642_add_foreign_keys_to_tables.rb +++ b/db/migrate/20151215103642_add_foreign_keys_to_tables.rb @@ -1,4 +1,4 @@ -class AddForeignKeysToTables < ActiveRecord::Migration +class AddForeignKeysToTables < ActiveRecord::Migration[4.2] def change tables = [:assets, :checklists, :checklist_items, :my_module_groups, :my_module_tags, :my_modules, :teams, :projects, diff --git a/db/migrate/20151215134147_add_text_search_vector_to_tables.rb b/db/migrate/20151215134147_add_text_search_vector_to_tables.rb index 39d91b6b7..b490bb1d3 100644 --- a/db/migrate/20151215134147_add_text_search_vector_to_tables.rb +++ b/db/migrate/20151215134147_add_text_search_vector_to_tables.rb @@ -1,7 +1,7 @@ require File.expand_path('app/helpers/database_helper') include DatabaseHelper -class AddTextSearchVectorToTables < ActiveRecord::Migration +class AddTextSearchVectorToTables < ActiveRecord::Migration[4.2] def change add_column :tables, :data_vector, :tsvector diff --git a/db/migrate/20151216095259_generate_text_search_vector_for_table_contents.rb b/db/migrate/20151216095259_generate_text_search_vector_for_table_contents.rb index d733008c0..3b1a46969 100644 --- a/db/migrate/20151216095259_generate_text_search_vector_for_table_contents.rb +++ b/db/migrate/20151216095259_generate_text_search_vector_for_table_contents.rb @@ -1,7 +1,7 @@ require File.expand_path('app/helpers/database_helper') include DatabaseHelper -class GenerateTextSearchVectorForTableContents < ActiveRecord::Migration +class GenerateTextSearchVectorForTableContents < ActiveRecord::Migration[4.2] def up if db_adapter_is? "PostgreSQL" then execute <<-SQL diff --git a/db/migrate/20160114155705_create_delayed_jobs.rb b/db/migrate/20160114155705_create_delayed_jobs.rb index 471f95e2d..bd1bbbf31 100644 --- a/db/migrate/20160114155705_create_delayed_jobs.rb +++ b/db/migrate/20160114155705_create_delayed_jobs.rb @@ -1,4 +1,4 @@ -class CreateDelayedJobs < ActiveRecord::Migration +class CreateDelayedJobs < ActiveRecord::Migration[4.2] def self.up create_table :delayed_jobs, force: true do |table| table.integer :priority, default: 0, null: false # Allows some jobs to jump to the front of the queue diff --git a/db/migrate/20160118114850_remove_private_organizations.rb b/db/migrate/20160118114850_remove_private_organizations.rb index fe07f5be7..952022d53 100644 --- a/db/migrate/20160118114850_remove_private_organizations.rb +++ b/db/migrate/20160118114850_remove_private_organizations.rb @@ -1,4 +1,4 @@ -class RemovePrivateOrganizations < ActiveRecord::Migration +class RemovePrivateOrganizations < ActiveRecord::Migration[4.2] def up remove_foreign_key :teams, column: :private_user_id remove_index :teams, :private_user_id diff --git a/db/migrate/20160119101947_add_position_to_checklist_item.rb b/db/migrate/20160119101947_add_position_to_checklist_item.rb index 63a7a2a14..afe8ed3ad 100644 --- a/db/migrate/20160119101947_add_position_to_checklist_item.rb +++ b/db/migrate/20160119101947_add_position_to_checklist_item.rb @@ -1,4 +1,4 @@ -class AddPositionToChecklistItem < ActiveRecord::Migration +class AddPositionToChecklistItem < ActiveRecord::Migration[4.2] def change add_column :checklist_items, :position, :integer, { default: 0, null: false } diff --git a/db/migrate/20160125200130_devise_invitable_add_to_users.rb b/db/migrate/20160125200130_devise_invitable_add_to_users.rb index 788529ab3..5856cd76f 100644 --- a/db/migrate/20160125200130_devise_invitable_add_to_users.rb +++ b/db/migrate/20160125200130_devise_invitable_add_to_users.rb @@ -1,4 +1,4 @@ -class DeviseInvitableAddToUsers < ActiveRecord::Migration +class DeviseInvitableAddToUsers < ActiveRecord::Migration[4.2] def up change_table :users do |t| t.string :invitation_token diff --git a/db/migrate/20160125205500_add_empty_field_to_asset.rb b/db/migrate/20160125205500_add_empty_field_to_asset.rb index 0a6a96dec..375ac3db3 100644 --- a/db/migrate/20160125205500_add_empty_field_to_asset.rb +++ b/db/migrate/20160125205500_add_empty_field_to_asset.rb @@ -1,4 +1,4 @@ -class AddEmptyFieldToAsset < ActiveRecord::Migration +class AddEmptyFieldToAsset < ActiveRecord::Migration[4.2] def up add_column :assets, :file_present, :boolean, default: false Asset.update_all(file_present: true) @@ -8,4 +8,4 @@ class AddEmptyFieldToAsset < ActiveRecord::Migration def down remove_column :assets, :file_present end -end \ No newline at end of file +end diff --git a/db/migrate/20160201085344_add_tutorial_status_field_to_user.rb b/db/migrate/20160201085344_add_tutorial_status_field_to_user.rb index 5fd99a9fb..9b0055eb0 100644 --- a/db/migrate/20160201085344_add_tutorial_status_field_to_user.rb +++ b/db/migrate/20160201085344_add_tutorial_status_field_to_user.rb @@ -1,4 +1,4 @@ -class AddTutorialStatusFieldToUser < ActiveRecord::Migration +class AddTutorialStatusFieldToUser < ActiveRecord::Migration[4.2] def up add_column :users, :tutorial_status, :integer, default: 0 @@ -11,4 +11,4 @@ class AddTutorialStatusFieldToUser < ActiveRecord::Migration def down remove_column :users, :tutorial_status end -end \ No newline at end of file +end diff --git a/db/migrate/20160205192344_migrate_organizations_structure.rb b/db/migrate/20160205192344_migrate_organizations_structure.rb index a5563fffd..fd58a291d 100644 --- a/db/migrate/20160205192344_migrate_organizations_structure.rb +++ b/db/migrate/20160205192344_migrate_organizations_structure.rb @@ -1,4 +1,4 @@ -class MigrateOrganizationsStructure < ActiveRecord::Migration +class MigrateOrganizationsStructure < ActiveRecord::Migration[4.2] def up # Update estimated size of all assets Asset.includes(:asset_text_datum).find_each do |asset| diff --git a/db/migrate/20160407063323_create_protocols.rb b/db/migrate/20160407063323_create_protocols.rb index 582e11e09..41d1f05d7 100644 --- a/db/migrate/20160407063323_create_protocols.rb +++ b/db/migrate/20160407063323_create_protocols.rb @@ -1,4 +1,4 @@ -class CreateProtocols < ActiveRecord::Migration +class CreateProtocols < ActiveRecord::Migration[4.2] def up # First, create protocol table create_table :protocols do |t| diff --git a/db/migrate/20160421100400_add_published_on_to_protocols.rb b/db/migrate/20160421100400_add_published_on_to_protocols.rb index a39d5f61b..31b787dae 100644 --- a/db/migrate/20160421100400_add_published_on_to_protocols.rb +++ b/db/migrate/20160421100400_add_published_on_to_protocols.rb @@ -1,4 +1,4 @@ -class AddPublishedOnToProtocols < ActiveRecord::Migration +class AddPublishedOnToProtocols < ActiveRecord::Migration[4.2] def up add_column :protocols, :published_on, :datetime diff --git a/db/migrate/20160425133500_add_counter_cache_to_protocols.rb b/db/migrate/20160425133500_add_counter_cache_to_protocols.rb index b8edf86a0..6906a649b 100644 --- a/db/migrate/20160425133500_add_counter_cache_to_protocols.rb +++ b/db/migrate/20160425133500_add_counter_cache_to_protocols.rb @@ -1,4 +1,4 @@ -class AddCounterCacheToProtocols < ActiveRecord::Migration +class AddCounterCacheToProtocols < ActiveRecord::Migration[4.2] def up add_column :protocols, :nr_of_synced_children, :integer, default: 0 diff --git a/db/migrate/20160429082100_add_counter_cache_to_protocol_keywords.rb b/db/migrate/20160429082100_add_counter_cache_to_protocol_keywords.rb index 6f9566fe6..ca3053589 100644 --- a/db/migrate/20160429082100_add_counter_cache_to_protocol_keywords.rb +++ b/db/migrate/20160429082100_add_counter_cache_to_protocol_keywords.rb @@ -1,4 +1,4 @@ -class AddCounterCacheToProtocolKeywords < ActiveRecord::Migration +class AddCounterCacheToProtocolKeywords < ActiveRecord::Migration[4.2] def up add_column :protocol_keywords, :nr_of_protocols, :integer, default: 0 diff --git a/db/migrate/20160429102200_add_organization_id_to_protocol_keywords.rb b/db/migrate/20160429102200_add_organization_id_to_protocol_keywords.rb index b49d1622e..8e4c93f5d 100644 --- a/db/migrate/20160429102200_add_organization_id_to_protocol_keywords.rb +++ b/db/migrate/20160429102200_add_organization_id_to_protocol_keywords.rb @@ -1,4 +1,4 @@ -class AddOrganizationIdToProtocolKeywords < ActiveRecord::Migration +class AddOrganizationIdToProtocolKeywords < ActiveRecord::Migration[4.2] def up add_column :protocol_keywords, :team_id, :integer add_foreign_key :protocol_keywords, :teams, column: :team_id diff --git a/db/migrate/20160513143117_refresh_assigned_samples_counters.rb b/db/migrate/20160513143117_refresh_assigned_samples_counters.rb index 242a29682..4f503cdd9 100644 --- a/db/migrate/20160513143117_refresh_assigned_samples_counters.rb +++ b/db/migrate/20160513143117_refresh_assigned_samples_counters.rb @@ -1,4 +1,4 @@ -class RefreshAssignedSamplesCounters < ActiveRecord::Migration +class RefreshAssignedSamplesCounters < ActiveRecord::Migration[4.2] def up # Reset the counters for assigned samples Sample.find_each do |sample| diff --git a/db/migrate/20160513165000_rename_duplicate_columns.rb b/db/migrate/20160513165000_rename_duplicate_columns.rb index 904729927..5c1028665 100644 --- a/db/migrate/20160513165000_rename_duplicate_columns.rb +++ b/db/migrate/20160513165000_rename_duplicate_columns.rb @@ -1,4 +1,4 @@ -class RenameDuplicateColumns < ActiveRecord::Migration +class RenameDuplicateColumns < ActiveRecord::Migration[4.2] require 'set' def up diff --git a/db/migrate/20160527152000_report_grouping_removal.rb b/db/migrate/20160527152000_report_grouping_removal.rb index dc24d5733..a06d77d39 100644 --- a/db/migrate/20160527152000_report_grouping_removal.rb +++ b/db/migrate/20160527152000_report_grouping_removal.rb @@ -1,5 +1,5 @@ -class ReportGroupingRemoval < ActiveRecord::Migration - def up +class ReportGroupingRemoval < ActiveRecord::Migration[4.2] + def up remove_column :reports, :grouped_by end diff --git a/db/migrate/20160531094100_rename_synced_children_to_linked_children.rb b/db/migrate/20160531094100_rename_synced_children_to_linked_children.rb index a908c1815..9bc25e6c3 100644 --- a/db/migrate/20160531094100_rename_synced_children_to_linked_children.rb +++ b/db/migrate/20160531094100_rename_synced_children_to_linked_children.rb @@ -1,4 +1,4 @@ -class RenameSyncedChildrenToLinkedChildren < ActiveRecord::Migration +class RenameSyncedChildrenToLinkedChildren < ActiveRecord::Migration[4.2] def up rename_column :protocols, :nr_of_synced_children, :nr_of_linked_children end @@ -6,4 +6,4 @@ class RenameSyncedChildrenToLinkedChildren < ActiveRecord::Migration def down rename_column :protocols, :nr_of_linked_children, :nr_of_synced_children end -end \ No newline at end of file +end diff --git a/db/migrate/20160704110900_remove_keywords_from_module_protocols.rb b/db/migrate/20160704110900_remove_keywords_from_module_protocols.rb index 08ed502ce..5adb4913f 100644 --- a/db/migrate/20160704110900_remove_keywords_from_module_protocols.rb +++ b/db/migrate/20160704110900_remove_keywords_from_module_protocols.rb @@ -1,4 +1,4 @@ -class RemoveKeywordsFromModuleProtocols < ActiveRecord::Migration +class RemoveKeywordsFromModuleProtocols < ActiveRecord::Migration[4.2] def up Protocol.find_each do |p| if p.in_module? then @@ -6,4 +6,4 @@ class RemoveKeywordsFromModuleProtocols < ActiveRecord::Migration end end end -end \ No newline at end of file +end diff --git a/db/migrate/20160722082700_add_experiment_level.rb b/db/migrate/20160722082700_add_experiment_level.rb index 5ee783e09..1e13c55ba 100644 --- a/db/migrate/20160722082700_add_experiment_level.rb +++ b/db/migrate/20160722082700_add_experiment_level.rb @@ -1,4 +1,4 @@ -class AddExperimentLevel < ActiveRecord::Migration +class AddExperimentLevel < ActiveRecord::Migration[4.2] def up # Create experiments table create_table :experiments do |t| diff --git a/db/migrate/20160803082801_add_experiment_to_report_elements.rb b/db/migrate/20160803082801_add_experiment_to_report_elements.rb index 1dfca0bb7..b2b9e7694 100644 --- a/db/migrate/20160803082801_add_experiment_to_report_elements.rb +++ b/db/migrate/20160803082801_add_experiment_to_report_elements.rb @@ -1,4 +1,4 @@ -class AddExperimentToReportElements < ActiveRecord::Migration +class AddExperimentToReportElements < ActiveRecord::Migration[4.2] def up add_column :report_elements, :experiment_id, :integer add_foreign_key :report_elements, :experiments diff --git a/db/migrate/20160808083040_add_attachment_workflowimg_to_experiments.rb b/db/migrate/20160808083040_add_attachment_workflowimg_to_experiments.rb index c0d469667..5095d1542 100644 --- a/db/migrate/20160808083040_add_attachment_workflowimg_to_experiments.rb +++ b/db/migrate/20160808083040_add_attachment_workflowimg_to_experiments.rb @@ -1,4 +1,4 @@ -class AddAttachmentWorkflowimgToExperiments < ActiveRecord::Migration +class AddAttachmentWorkflowimgToExperiments < ActiveRecord::Migration[4.2] def self.up add_attachment :experiments, :workflowimg end diff --git a/db/migrate/20160809074757_update_my_module_coordinate.rb b/db/migrate/20160809074757_update_my_module_coordinate.rb index 510271f51..20634e17d 100644 --- a/db/migrate/20160809074757_update_my_module_coordinate.rb +++ b/db/migrate/20160809074757_update_my_module_coordinate.rb @@ -1,4 +1,4 @@ -class UpdateMyModuleCoordinate < ActiveRecord::Migration +class UpdateMyModuleCoordinate < ActiveRecord::Migration[4.2] def change MyModule.find_each do |my_module| x = my_module.x diff --git a/db/migrate/20160928114119_create_notifications.rb b/db/migrate/20160928114119_create_notifications.rb index 033651646..e5d8be530 100644 --- a/db/migrate/20160928114119_create_notifications.rb +++ b/db/migrate/20160928114119_create_notifications.rb @@ -1,4 +1,4 @@ -class CreateNotifications < ActiveRecord::Migration +class CreateNotifications < ActiveRecord::Migration[4.2] def change create_table :notifications do |t| t.string :title diff --git a/db/migrate/20160928114915_create_user_notifications.rb b/db/migrate/20160928114915_create_user_notifications.rb index 4d52905e9..4656c0db2 100644 --- a/db/migrate/20160928114915_create_user_notifications.rb +++ b/db/migrate/20160928114915_create_user_notifications.rb @@ -1,4 +1,4 @@ -class CreateUserNotifications < ActiveRecord::Migration +class CreateUserNotifications < ActiveRecord::Migration[4.2] def change create_table :user_notifications do |t| t.belongs_to :user, index: true, foreign_key: true diff --git a/db/migrate/20161004074754_add_notifications_settings_to_user.rb b/db/migrate/20161004074754_add_notifications_settings_to_user.rb index d9599c118..b2ad0a33e 100644 --- a/db/migrate/20161004074754_add_notifications_settings_to_user.rb +++ b/db/migrate/20161004074754_add_notifications_settings_to_user.rb @@ -1,4 +1,4 @@ -class AddNotificationsSettingsToUser < ActiveRecord::Migration +class AddNotificationsSettingsToUser < ActiveRecord::Migration[4.2] def up add_column :users, :assignments_notification, :boolean, default: true add_column :users, :recent_notification, :boolean, default: true diff --git a/db/migrate/20161006065203_add_email_notification_settings_to_user.rb b/db/migrate/20161006065203_add_email_notification_settings_to_user.rb index 31f9e8bad..06f70a541 100644 --- a/db/migrate/20161006065203_add_email_notification_settings_to_user.rb +++ b/db/migrate/20161006065203_add_email_notification_settings_to_user.rb @@ -1,4 +1,4 @@ -class AddEmailNotificationSettingsToUser < ActiveRecord::Migration +class AddEmailNotificationSettingsToUser < ActiveRecord::Migration[4.2] def up add_column :users, :assignments_notification_email, :boolean, default: false add_column :users, :recent_notification_email, :boolean, default: false diff --git a/db/migrate/20161011074804_add_current_organization_to_user.rb b/db/migrate/20161011074804_add_current_organization_to_user.rb index 31cea5d63..26bd8034f 100644 --- a/db/migrate/20161011074804_add_current_organization_to_user.rb +++ b/db/migrate/20161011074804_add_current_organization_to_user.rb @@ -1,4 +1,4 @@ -class AddCurrentOrganizationToUser < ActiveRecord::Migration +class AddCurrentOrganizationToUser < ActiveRecord::Migration[4.2] def up add_column :users, :current_team_id, :integer add_foreign_key :users, :teams, column: :current_team_id diff --git a/db/migrate/20161012112900_add_email_system_notification_setting_to_user.rb b/db/migrate/20161012112900_add_email_system_notification_setting_to_user.rb index 90e760b2e..04e5eddc4 100644 --- a/db/migrate/20161012112900_add_email_system_notification_setting_to_user.rb +++ b/db/migrate/20161012112900_add_email_system_notification_setting_to_user.rb @@ -1,4 +1,4 @@ -class AddEmailSystemNotificationSettingToUser < ActiveRecord::Migration +class AddEmailSystemNotificationSettingToUser < ActiveRecord::Migration[4.2] def up add_column :users, :system_message_notification_email, diff --git a/db/migrate/20161123161514_create_samples_tables.rb b/db/migrate/20161123161514_create_samples_tables.rb index 83b715547..8c874b10f 100644 --- a/db/migrate/20161123161514_create_samples_tables.rb +++ b/db/migrate/20161123161514_create_samples_tables.rb @@ -1,4 +1,4 @@ -class CreateSamplesTables < ActiveRecord::Migration +class CreateSamplesTables < ActiveRecord::Migration[4.2] def change create_table :samples_tables do |t| t.jsonb :status, null: false, diff --git a/db/migrate/20161125153600_rename_non_unique_sample_types_groups.rb b/db/migrate/20161125153600_rename_non_unique_sample_types_groups.rb index 1b3ee5680..2c6abaf33 100644 --- a/db/migrate/20161125153600_rename_non_unique_sample_types_groups.rb +++ b/db/migrate/20161125153600_rename_non_unique_sample_types_groups.rb @@ -1,4 +1,4 @@ -class RenameNonUniqueSampleTypesGroups < ActiveRecord::Migration +class RenameNonUniqueSampleTypesGroups < ActiveRecord::Migration[4.2] def up Team.find_each do |team| st_ids = [] diff --git a/db/migrate/20161129111100_add_wopi.rb b/db/migrate/20161129111100_add_wopi.rb index c3c15f419..9e9d35b63 100644 --- a/db/migrate/20161129111100_add_wopi.rb +++ b/db/migrate/20161129111100_add_wopi.rb @@ -1,4 +1,4 @@ -class AddWopi < ActiveRecord::Migration +class AddWopi < ActiveRecord::Migration[4.2] def up add_column :assets, :lock, :string, limit: 1024 add_column :assets, :lock_ttl, :integer diff --git a/db/migrate/20161129171012_add_authentication_token_to_users.rb b/db/migrate/20161129171012_add_authentication_token_to_users.rb index cf69f8ee5..578c5395f 100644 --- a/db/migrate/20161129171012_add_authentication_token_to_users.rb +++ b/db/migrate/20161129171012_add_authentication_token_to_users.rb @@ -1,4 +1,4 @@ -class AddAuthenticationTokenToUsers < ActiveRecord::Migration +class AddAuthenticationTokenToUsers < ActiveRecord::Migration[4.2] def change add_column :users, :authentication_token, :string, limit: 30 add_index :users, :authentication_token, unique: true diff --git a/db/migrate/20161208145354_add_processing_to_assets.rb b/db/migrate/20161208145354_add_processing_to_assets.rb index 97cff9034..badc57561 100644 --- a/db/migrate/20161208145354_add_processing_to_assets.rb +++ b/db/migrate/20161208145354_add_processing_to_assets.rb @@ -1,4 +1,4 @@ -class AddProcessingToAssets < ActiveRecord::Migration +class AddProcessingToAssets < ActiveRecord::Migration[4.2] def change add_column :assets, :file_processing, :boolean end diff --git a/db/migrate/20170105162500_add_index_to_users_full_name.rb b/db/migrate/20170105162500_add_index_to_users_full_name.rb index 539634924..4a980c1cb 100644 --- a/db/migrate/20170105162500_add_index_to_users_full_name.rb +++ b/db/migrate/20170105162500_add_index_to_users_full_name.rb @@ -1,4 +1,4 @@ -class AddIndexToUsersFullName < ActiveRecord::Migration +class AddIndexToUsersFullName < ActiveRecord::Migration[4.2] def change add_index :users, :full_name end diff --git a/db/migrate/20170116143350_add_name_to_tables.rb b/db/migrate/20170116143350_add_name_to_tables.rb index 78f74d218..ce2a2513e 100644 --- a/db/migrate/20170116143350_add_name_to_tables.rb +++ b/db/migrate/20170116143350_add_name_to_tables.rb @@ -1,4 +1,4 @@ -class AddNameToTables < ActiveRecord::Migration +class AddNameToTables < ActiveRecord::Migration[4.2] def change add_column :tables, :name, :string, default: '', index: true end diff --git a/db/migrate/20170124135736_rename_organization_to_team.rb b/db/migrate/20170124135736_rename_organization_to_team.rb index 474b1e046..c01c77c52 100644 --- a/db/migrate/20170124135736_rename_organization_to_team.rb +++ b/db/migrate/20170124135736_rename_organization_to_team.rb @@ -1,4 +1,4 @@ -class RenameOrganizationToTeam < ActiveRecord::Migration +class RenameOrganizationToTeam < ActiveRecord::Migration[4.2] def up unless ActiveRecord::Base.connection.table_exists?('organizations') && ActiveRecord::Base.connection.table_exists?('user_organizations') diff --git a/db/migrate/20170207100731_add_state_to_tasks.rb b/db/migrate/20170207100731_add_state_to_tasks.rb index f1452b61e..626a2f622 100644 --- a/db/migrate/20170207100731_add_state_to_tasks.rb +++ b/db/migrate/20170207100731_add_state_to_tasks.rb @@ -1,4 +1,4 @@ -class AddStateToTasks < ActiveRecord::Migration +class AddStateToTasks < ActiveRecord::Migration[4.2] def up add_column :my_modules, :state, diff --git a/db/migrate/20170217141402_create_settings_table.rb b/db/migrate/20170217141402_create_settings_table.rb index 27608f44e..111349360 100644 --- a/db/migrate/20170217141402_create_settings_table.rb +++ b/db/migrate/20170217141402_create_settings_table.rb @@ -1,4 +1,4 @@ -class CreateSettingsTable < ActiveRecord::Migration +class CreateSettingsTable < ActiveRecord::Migration[4.2] def change create_table :settings do |t| t.text :type, null: false diff --git a/db/migrate/20170306121855_convert_comments_to_sti_model.rb b/db/migrate/20170306121855_convert_comments_to_sti_model.rb index c42c23669..7b9016c07 100644 --- a/db/migrate/20170306121855_convert_comments_to_sti_model.rb +++ b/db/migrate/20170306121855_convert_comments_to_sti_model.rb @@ -1,4 +1,4 @@ -class ConvertCommentsToStiModel < ActiveRecord::Migration +class ConvertCommentsToStiModel < ActiveRecord::Migration[4.2] def change add_column :comments, :type, :string add_column :comments, :associated_id, :integer diff --git a/db/migrate/20170321131116_create_zip_exports.rb b/db/migrate/20170321131116_create_zip_exports.rb index 5794d9e45..19e0cf688 100644 --- a/db/migrate/20170321131116_create_zip_exports.rb +++ b/db/migrate/20170321131116_create_zip_exports.rb @@ -1,4 +1,4 @@ -class CreateZipExports < ActiveRecord::Migration +class CreateZipExports < ActiveRecord::Migration[4.2] def change create_table :zip_exports do |t| t.references :user, index: true, foreign_key: true diff --git a/db/migrate/20170322095856_add_team_id_to_asset_and_tables.rb b/db/migrate/20170322095856_add_team_id_to_asset_and_tables.rb index fa6a8b2ae..b15a10423 100644 --- a/db/migrate/20170322095856_add_team_id_to_asset_and_tables.rb +++ b/db/migrate/20170322095856_add_team_id_to_asset_and_tables.rb @@ -1,4 +1,4 @@ -class AddTeamIdToAssetAndTables < ActiveRecord::Migration +class AddTeamIdToAssetAndTables < ActiveRecord::Migration[4.2] def change add_column :assets, :team_id, :integer add_index :assets, :team_id diff --git a/db/migrate/20170330092353_remove_logs_table.rb b/db/migrate/20170330092353_remove_logs_table.rb index 75028158f..98fe0b580 100644 --- a/db/migrate/20170330092353_remove_logs_table.rb +++ b/db/migrate/20170330092353_remove_logs_table.rb @@ -1,4 +1,4 @@ -class RemoveLogsTable < ActiveRecord::Migration +class RemoveLogsTable < ActiveRecord::Migration[4.2] def change drop_table :logs end diff --git a/db/migrate/20170404150845_remove_default_user_project_role_value.rb b/db/migrate/20170404150845_remove_default_user_project_role_value.rb index 68718203e..4a13d353b 100644 --- a/db/migrate/20170404150845_remove_default_user_project_role_value.rb +++ b/db/migrate/20170404150845_remove_default_user_project_role_value.rb @@ -1,4 +1,4 @@ -class RemoveDefaultUserProjectRoleValue < ActiveRecord::Migration +class RemoveDefaultUserProjectRoleValue < ActiveRecord::Migration[4.2] def up change_column_default(:user_projects, :role, nil) end diff --git a/db/migrate/20170407082423_update_indexes_for_faster_search.rb b/db/migrate/20170407082423_update_indexes_for_faster_search.rb index f5a4013da..403c466d5 100644 --- a/db/migrate/20170407082423_update_indexes_for_faster_search.rb +++ b/db/migrate/20170407082423_update_indexes_for_faster_search.rb @@ -1,56 +1,96 @@ require File.expand_path('app/helpers/database_helper') include DatabaseHelper -class UpdateIndexesForFasterSearch < ActiveRecord::Migration +class UpdateIndexesForFasterSearch < ActiveRecord::Migration[4.2] def up if db_adapter_is? 'PostgreSQL' # Removing old indexes - remove_index :projects, :name if index_exists?(:projects, :name) - remove_index :my_modules, :name if index_exists?(:my_modules, :name) - if index_exists?(:my_modules, :description) - remove_index :my_modules, :description + if index_name_exists? :projects, :index_projects_on_name + remove_index :projects, name: :index_projects_on_name end - remove_index :protocols, :name if index_exists?(:protocols, :name) - if index_exists?(:protocols, :description) - remove_index :protocols, :description + if index_name_exists? :my_modules, :index_my_modules_on_name + remove_index :my_modules, name: :index_my_modules_on_name end - remove_index :protocols, :authors if index_exists?(:protocols, :authors) - if index_exists?(:protocol_keywords, :name) - remove_index :protocol_keywords, :name + if index_name_exists? :my_modules, :index_my_modules_on_description + remove_index :my_modules, name: :index_my_modules_on_description end - if index_exists?(:my_module_groups, :name) - remove_index :my_module_groups, :name + if index_name_exists? :protocols, :index_protocols_on_name + remove_index :protocols, name: :index_protocols_on_name end - remove_index :tags, :name if index_exists?(:tags, :name) - remove_index :results, :name if index_exists?(:results, :name) - remove_index :result_texts, :text if index_exists?(:result_texts, :text) - remove_index :reports, :name if index_exists?(:reports, :name) - if index_exists?(:reports, :description) - remove_index :reports, :description + if index_name_exists? :protocols, :index_protocols_on_description + remove_index :protocols, name: :index_protocols_on_description end - if index_exists?(:assets, :file_file_name) - remove_index :assets, :file_file_name + if index_name_exists? :protocols, :index_protocols_on_authors + remove_index :protocols, name: :index_protocols_on_authors end - remove_index :samples, :name if index_exists?(:samples, :name) - remove_index :sample_types, :name if index_exists?(:sample_types, :name) - remove_index :sample_groups, :name if index_exists?(:sample_groups, :name) - if index_exists?(:sample_custom_fields, :value) - remove_index :sample_custom_fields, :value + if index_name_exists? :protocol_keywords, :index_protocol_keywords_on_name + remove_index :protocol_keywords, name: :index_protocol_keywords_on_name end - remove_index :steps, :name if index_exists?(:steps, :name) - remove_index :steps, :description if index_exists?(:steps, :description) - remove_index :checklists, :name if index_exists?(:checklists, :name) - if index_exists?(:checklist_items, :text) - remove_index :checklist_items, :text + if index_name_exists? :my_module_groups, :index_my_module_groups_on_name + remove_index :my_module_groups, name: :index_my_module_groups_on_name end - remove_index :tables, :name if index_exists?(:tables, :name) - remove_index :users, :full_name if index_exists?(:users, :full_name) - remove_index :comments, :message if index_exists?(:comments, :message) - remove_index :comments, :type if index_exists?(:comments, :type) - if index_exists?(:protocols, :protocol_type) - remove_index :protocols, :protocol_type + if index_name_exists? :tags, :index_tags_on_name + remove_index :tags, name: :index_tags_on_name + end + if index_name_exists? :results, :index_results_on_name + remove_index :results, name: :index_results_on_name + end + if index_name_exists? :result_texts, :index_result_texts_on_text + remove_index :result_texts, name: :index_result_texts_on_text + end + if index_name_exists? :reports, :index_reports_on_name + remove_index :reports, name: :index_reports_on_name + end + if index_name_exists? :reports, :index_reports_on_description + remove_index :reports, name: :index_reports_on_description + end + if index_name_exists?(:assets, :index_assets_on_file_file_name) + remove_index :assets, name: :index_assets_on_file_file_name + end + if index_name_exists? :samples, :index_samples_on_name + remove_index :samples, name: :index_samples_on_name + end + if index_name_exists? :sample_types, :index_sample_types_on_name + remove_index :sample_types, name: :index_sample_types_on_name + end + if index_name_exists? :sample_groups, :index_sample_groups_on_name + remove_index :sample_groups, name: :index_sample_groups_on_name + end + if index_name_exists? :sample_custom_fields, + :index_sample_custom_fields_on_value + remove_index :sample_custom_fields, + name: :index_sample_custom_fields_on_value + end + if index_name_exists? :steps, :index_steps_on_name + remove_index :steps, name: :index_steps_on_name + end + if index_name_exists? :steps, :index_steps_on_description + remove_index :steps, name: :index_steps_on_description + end + if index_name_exists? :checklists, :index_checklists_on_name + remove_index :checklists, name: :index_checklists_on_name + end + if index_name_exists? :checklist_items, :index_checklist_items_on_text + remove_index :checklist_items, name: :index_checklist_items_on_text + end + if index_name_exists? :tables, :index_tables_on_name + remove_index :tables, name: :index_tables_on_name + end + if index_name_exists? :users, :index_users_on_full_name + remove_index :users, name: :index_users_on_full_name + end + if index_name_exists? :comments, :index_comments_on_message + remove_index :comments, name: :index_comments_on_message + end + if index_name_exists? :comments, :index_comments_on_type + remove_index :comments, name: :index_comments_on_type + end + if index_name_exists? :protocols, :index_protocols_on_protocol_type + remove_index :protocols, name: :index_protocols_on_protocol_type + end + if index_name_exists? :checklists, :index_checklists_on_step_id + remove_index :checklists, name: :index_checklists_on_step_id end - remove_index :checklists, :step_id if index_exists?(:checklists, :step_id) execute( "CREATE OR REPLACE FUNCTION diff --git a/db/migrate/20170407104322_remove_default_checklist_item_position_value.rb b/db/migrate/20170407104322_remove_default_checklist_item_position_value.rb index 1ca021449..8807cbd4d 100644 --- a/db/migrate/20170407104322_remove_default_checklist_item_position_value.rb +++ b/db/migrate/20170407104322_remove_default_checklist_item_position_value.rb @@ -1,4 +1,4 @@ -class RemoveDefaultChecklistItemPositionValue < ActiveRecord::Migration +class RemoveDefaultChecklistItemPositionValue < ActiveRecord::Migration[4.2] def up change_column :checklist_items, :position, diff --git a/db/migrate/20170418153541_add_experiment_to_activities.rb b/db/migrate/20170418153541_add_experiment_to_activities.rb index 58ef688e0..03042c788 100644 --- a/db/migrate/20170418153541_add_experiment_to_activities.rb +++ b/db/migrate/20170418153541_add_experiment_to_activities.rb @@ -1,4 +1,4 @@ -class AddExperimentToActivities < ActiveRecord::Migration +class AddExperimentToActivities < ActiveRecord::Migration[4.2] def change add_reference :activities, :experiment, index: true, foreign_key: true end diff --git a/db/migrate/20170420075905_add_attachment_image_to_tiny_mce_assets.rb b/db/migrate/20170420075905_add_attachment_image_to_tiny_mce_assets.rb index 07eba08b3..0e38a78ee 100644 --- a/db/migrate/20170420075905_add_attachment_image_to_tiny_mce_assets.rb +++ b/db/migrate/20170420075905_add_attachment_image_to_tiny_mce_assets.rb @@ -1,4 +1,4 @@ -class AddAttachmentImageToTinyMceAssets < ActiveRecord::Migration +class AddAttachmentImageToTinyMceAssets < ActiveRecord::Migration[4.2] def change create_table :tiny_mce_assets do |t| t.attachment :image diff --git a/db/migrate/20170515073041_add_experiments_order_to_projects.rb b/db/migrate/20170515073041_add_experiments_order_to_projects.rb index 173f0a271..693980a74 100644 --- a/db/migrate/20170515073041_add_experiments_order_to_projects.rb +++ b/db/migrate/20170515073041_add_experiments_order_to_projects.rb @@ -1,4 +1,4 @@ -class AddExperimentsOrderToProjects < ActiveRecord::Migration +class AddExperimentsOrderToProjects < ActiveRecord::Migration[4.2] def change add_column :projects, :experiments_order, :string end diff --git a/db/migrate/20170515141252_add_custom_repositories.rb b/db/migrate/20170515141252_add_custom_repositories.rb index 2fe559f4f..f62de9b58 100644 --- a/db/migrate/20170515141252_add_custom_repositories.rb +++ b/db/migrate/20170515141252_add_custom_repositories.rb @@ -1,4 +1,4 @@ -class AddCustomRepositories < ActiveRecord::Migration +class AddCustomRepositories < ActiveRecord::Migration[4.2] def change create_table :repositories do |t| t.belongs_to :team, index: true