Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save mihaic195/bf64a972f0daf455e856db756b53592f to your computer and use it in GitHub Desktop.
Save mihaic195/bf64a972f0daf455e856db756b53592f to your computer and use it in GitHub Desktop.
Migration to remove paperclip columns from models
class RemovePaperclipColumnsFromModels < ActiveRecord::Migration[5.2]
def up
remove_column :model, :logo_content_type
remove_column :model, :logo_file_name
remove_column :model, :logo_file_size
remove_column :model, :logo_fingerprint
remove_column :model, :logo_updated_at
end
def down
add_column :model, :logo_content_type, :string
add_column :model, :logo_file_name, :sting
add_column :model, :logo_file_size, :integer
add_column :model, :logo_fingerprint, :string
add_column :model, :logo_updated_at, :datetime
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment