@@ -0,0 +1,19 @@
+class ConvertAttachmentToPaperclip < ActiveRecord::Migration
+  def self.up
+    change_table :attachments do |attachment|
+      attachment.rename :filename, :attachment_file_name
+      attachment.rename :size, :attachment_file_size
+      attachment.rename :content_type, :attachment_content_type
+      attachment.datetime :attachment_updated_at 
+
+      # Removing child thumbnails as its not required for paperclip 
+      Attachment.delete_all("parent_id is not null")
+
+      attachment.remove :parent_id, :thumbnail, :width, :height, :is_default
+    end
+  end
+
+  def self.down
+    raise ActiveRecord::IrreversibleMigration, "Cannot recover deleted data"
+  end
+end
This was a change from the `change` method to `self.up` and `self.down` with the `IrreversibleMigration`, isn't it? I think we missed the restriction that we do not want any migrations in the ohloh-ui repository: they all have to be in the ohloh repository for tracking. That said; we would not be able to apply this migration until we are ready to deploy PURR in to production since it would break the `attachment` model. However, we would want to run this migration every Monday after successful restoration of the production database into ohloh-qa-db.