added attachment_fu and made the set of changes
[selectricity] / db / migrate / 001_move_to_attachment_fu.rb
diff --git a/db/migrate/001_move_to_attachment_fu.rb b/db/migrate/001_move_to_attachment_fu.rb
new file mode 100644 (file)
index 0000000..d52b828
--- /dev/null
@@ -0,0 +1,29 @@
+class MoveToAttachmentFu < ActiveRecord::Migration
+  def self.up
+    drop_table :pictures
+
+    # create attachment_fu metadata table
+    create_table :pictures do |t|
+      t.column :filename,     :string
+      t.column :content_type, :string
+      t.column :size,         :integer
+      t.column :width,        :integer
+      t.column :height,       :integer
+      t.column :parent_id,    :integer
+      t.column :thumbnail,    :string
+      t.column :created_at,   :datetime
+      t.column "candidate_id", :integer
+    end    
+  end
+
+  def self.down
+    drop_table :pictures
+
+    create_table "pictures", :force => true do |t|
+      t.column "filename",     :string,  :limit => 200
+      t.column "data",         :binary
+      t.column "filetype",     :string,  :limit => 100
+      t.column "candidate_id", :integer
+    end
+  end
+end

Benjamin Mako Hill || Want to submit a patch?