X-Git-Url: https://projects.mako.cc/source/selectricity/blobdiff_plain/6a935d078f20d2b1b0d60f0a30c41a642d40758a..5e74f498cd2f8d765e309ca52a45a7c2db0a1a6f:/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 index 0000000..d52b828 --- /dev/null +++ b/db/migrate/001_move_to_attachment_fu.rb @@ -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