aboutsummaryrefslogtreecommitdiffstats
path: root/spec/dummy/db/migrate/20110802081565_create_refinerycms_images_schema.rb
blob: 6c4e079898a26106fc053134a9c09b9e5748ba15 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class CreateRefinerycmsImagesSchema < ActiveRecord::Migration
  def self.up
    create_table ::Refinery::Image.table_name, :force => true do |t|
      t.string   "image_mime_type"
      t.string   "image_name"
      t.integer  "image_size"
      t.integer  "image_width"
      t.integer  "image_height"
      t.datetime "created_at"
      t.datetime "updated_at"
      t.string   "image_uid"
      t.string   "image_ext"
    end unless ::Refinery::Image.table_exists?
  end

  def self.down
    [::Image].reject{|m|
      !(defined?(m) and m.respond_to?(:table_name))
    }.each do |model|
      drop_table model.table_name if model.table_exists?
    end
  end
end