Remove paperclip attachments from migrations [SCI-3908]

This commit is contained in:
Oleksii Kriuchykhin 2019-10-03 13:45:54 +02:00
parent 260fcd6e89
commit 52bbf6740d
8 changed files with 0 additions and 30 deletions

View file

@ -1,9 +0,0 @@
class AddUserColumns < ActiveRecord::Migration[4.2]
def up
add_attachment :users, :avatar
end
def down
remove_attachment :users, :avatar
end
end

View file

@ -4,7 +4,6 @@ class CreateAssets < ActiveRecord::Migration[4.2]
t.timestamps null: false
end
add_attachment :assets, :file
add_index :assets, :created_at
end
end

View file

@ -5,6 +5,5 @@ class CreateTempFiles < ActiveRecord::Migration[4.2]
t.timestamps null: false
end
add_attachment :temp_files, :file
end
end

View file

@ -19,7 +19,6 @@ class AddSearchQueryIndexes < ActiveRecord::Migration[4.2]
add_gist_index :tags, :name
add_gist_index :steps, :name
add_gist_index :results, :name
add_gist_index :assets, :file_file_name
# There's already semi-useless BTree index on samples
remove_index :samples, :name
@ -42,7 +41,6 @@ class AddSearchQueryIndexes < ActiveRecord::Migration[4.2]
remove_index :tags, :name
remove_index :steps, :name
remove_index :results, :name
remove_index :assets, :file_file_name
# Re-add semi-useless BTree index on samples
remove_index :samples, :name

View file

@ -1,9 +0,0 @@
class AddAttachmentWorkflowimgToExperiments < ActiveRecord::Migration[4.2]
def self.up
add_attachment :experiments, :workflowimg
end
def self.down
remove_attachment :experiments, :workflowimg
end
end

View file

@ -4,7 +4,5 @@ class CreateZipExports < ActiveRecord::Migration[4.2]
t.references :user, index: true, foreign_key: true
t.timestamps null: false
end
add_attachment :zip_exports, :zip_file
end
end

View file

@ -44,9 +44,6 @@ class UpdateIndexesForFasterSearch < ActiveRecord::Migration[4.2]
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
@ -115,7 +112,6 @@ class UpdateIndexesForFasterSearch < ActiveRecord::Migration[4.2]
add_gin_index_without_tags :result_texts, :text
add_gin_index_without_tags :reports, :name
add_gin_index_without_tags :reports, :description
add_gin_index_without_tags :assets, :file_file_name
add_gin_index_without_tags :samples, :name
add_gin_index_without_tags :sample_types, :name
add_gin_index_without_tags :sample_groups, :name
@ -151,7 +147,6 @@ class UpdateIndexesForFasterSearch < ActiveRecord::Migration[4.2]
remove_index :result_texts, :text
remove_index :reports, :name
remove_index :reports, :description
remove_index :assets, :file_file_name
remove_index :samples, :name
remove_index :sample_types, :name
remove_index :sample_groups, :name

View file

@ -1,7 +1,6 @@
class AddAttachmentImageToTinyMceAssets < ActiveRecord::Migration[4.2]
def change
create_table :tiny_mce_assets do |t|
t.attachment :image
t.integer :estimated_size, default: 0, null: false
t.references :step, index: true
t.references :team, index: true