mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-20 14:45:56 +08:00
commit
76ab8d0d3c
3
Gemfile
3
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'
|
||||
|
|
10
Gemfile.lock
10
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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class DeviseCreateUsers < ActiveRecord::Migration
|
||||
class DeviseCreateUsers < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table(:users) do |t|
|
||||
## General user data
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddUserColumns < ActiveRecord::Migration
|
||||
class AddUserColumns < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_attachment :users, :avatar
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class CreateOrganizations < ActiveRecord::Migration
|
||||
class CreateOrganizations < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :teams do |t|
|
||||
## General info
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class CreateSteps < ActiveRecord::Migration
|
||||
class CreateSteps < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :steps do |t|
|
||||
t.string :name
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class CreateAssets < ActiveRecord::Migration
|
||||
class CreateAssets < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :assets do |t|
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class CreateResults < ActiveRecord::Migration
|
||||
class CreateResults < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :results do |t|
|
||||
t.string :name
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddMyModuleGroupsToProject < ActiveRecord::Migration
|
||||
class AddMyModuleGroupsToProject < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_column :my_module_groups, :project_id, :integer
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddIndexToSampleName < ActiveRecord::Migration
|
||||
class AddIndexToSampleName < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
add_index :samples, :name
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class RemoveUniqueOrganizationNameIndex < ActiveRecord::Migration
|
||||
class RemoveUniqueOrganizationNameIndex < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
remove_index :teams, :name
|
||||
add_index :teams, :name
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 }
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
end
|
||||
|
|
|
@ -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
|
||||
end
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddPublishedOnToProtocols < ActiveRecord::Migration
|
||||
class AddPublishedOnToProtocols < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :protocols, :published_on, :datetime
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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|
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class RenameDuplicateColumns < ActiveRecord::Migration
|
||||
class RenameDuplicateColumns < ActiveRecord::Migration[4.2]
|
||||
require 'set'
|
||||
|
||||
def up
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
class ReportGroupingRemoval < ActiveRecord::Migration
|
||||
def up
|
||||
class ReportGroupingRemoval < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
remove_column :reports, :grouped_by
|
||||
end
|
||||
|
||||
|
|
|
@ -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
|
||||
end
|
||||
|
|
|
@ -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
|
||||
end
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddExperimentLevel < ActiveRecord::Migration
|
||||
class AddExperimentLevel < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
# Create experiments table
|
||||
create_table :experiments do |t|
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddAttachmentWorkflowimgToExperiments < ActiveRecord::Migration
|
||||
class AddAttachmentWorkflowimgToExperiments < ActiveRecord::Migration[4.2]
|
||||
def self.up
|
||||
add_attachment :experiments, :workflowimg
|
||||
end
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class CreateNotifications < ActiveRecord::Migration
|
||||
class CreateNotifications < ActiveRecord::Migration[4.2]
|
||||
def change
|
||||
create_table :notifications do |t|
|
||||
t.string :title
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class AddEmailSystemNotificationSettingToUser < ActiveRecord::Migration
|
||||
class AddEmailSystemNotificationSettingToUser < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
add_column :users,
|
||||
:system_message_notification_email,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
class RenameNonUniqueSampleTypesGroups < ActiveRecord::Migration
|
||||
class RenameNonUniqueSampleTypesGroups < ActiveRecord::Migration[4.2]
|
||||
def up
|
||||
Team.find_each do |team|
|
||||
st_ids = []
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue