Skip to content

Instantly share code, notes, and snippets.

@jcarley
Created December 29, 2011 17:56
Show Gist options
  • Save jcarley/1535280 to your computer and use it in GitHub Desktop.
Save jcarley/1535280 to your computer and use it in GitHub Desktop.
Example Paperclip migration file
class AddAttachmentAvatarToUser < ActiveRecord::Migration
def self.up
add_column :users, :avatar_file_name, :string
add_column :users, :avatar_content_type, :string
add_column :users, :avatar_file_size, :integer
add_column :users, :avatar_updated_at, :datetime
end
def self.down
remove_column :users, :avatar_file_name
remove_column :users, :avatar_content_type
remove_column :users, :avatar_file_size
remove_column :users, :avatar_updated_at
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment